Instructions To Candidates: Duration: Not Set
Instructions To Candidates: Duration: Not Set
Mr Barwick The quantity of a particular product in stock is stored as a binary number using two bytes.
There are 312 tins of beans left in stock.
Please note that you may see slight differences
between this paper and the original.
Duration: Not set How would this quantity be represented as a binary number in the computer?
Candidates answer on the Question paper.
(b). The name of a product is stored using characters from the computer's character set.
[3]
ii. Using normalised floating point binary representation using 4 bits for the mantissa
and 4 for the exponent, represent the denary value −1.75. You must show your
working.
2(a). Convert the denary number 43 into an 8 bit binary number.
[1]
[2]
(b). Using binary subtraction, calculate your answer to the following. You must show your
working.
3. Burger House is a fast food restaurant which wants to encourage healthy eating amongst
its younger diners.
a.
[2] i. Shown below in Fig.2 is the Burger House children’s menu.
(c). Using two’s complement convert the denary number −43 into an 8 bit binary number. You
must show your working.
[2]
(d). i. Using normalised floating point binary representation using 4 bits for the mantissa
and 4 for the exponent, represent the denary value 1.75. You must show your
working.
Children receive a free toy when they select a meal (i.e. one burger, one side
dish and one dessert) made up of only healthy options.
[2] ● Let g be a Boolean value for if a child has chosen a grilled chicken
burger.
● Let s be a Boolean value for if a child has chosen salad.
● Let c be a Boolean value for if a child has chosen carrot sticks.
● Let f be a Boolean value for if a child has chosen fruit salad.
● Let t be a Boolean value for whether a child receives a toy.
t=
Simplified expression:
[3]
b. [4]
ii. Burger House wants to add this logic into its till system.
Complete the code below assuming that g,s,c,f and t are Boolean variables
with the same meaning as part (i).
5. Laser Tag is a game where teams of players move round an arena shooting each other
with infrared guns. Players wear sensors that keep track of how many times they have
been hit by the laser. This is known as being ‘tagged’.
At the end of each match players upload their score to a computer. The computer stores
the scores in the order they are received in a 2D array called . The array stores the
[2]
team as an integer (1 for green, 2 for red) and their score. An extract of the array called
is shown below. The first entry shows a green team member scored 45 points and the
next shows a red team member scored 30 points.
1 45
2 30
4. An electronics engineer needs a circuit with the following logic. 2 46
1 31
(A∧B) ∨ (¬A∧B) ∨ (¬C∧¬D) 1 10
1 32
Complete and use the Karnaugh map below to simplify the expression above.
2 2
Once all the players have uploaded their scores the computer adds up the scores for each
team.
Using pseudocode write a program for a procedural language that works out and outputs
the total score for each team. You may assume that there are always 20 players.
[6]
6. A software company decides to release a duplicate file finder which it has named
“De-Duplicator”. Duplicate files are files that are exactly the same (bit for bit identical).
Space is often wasted on computers by having multiple versions of the same file.
Duplicate file finders are programs that find and identify duplicate files on a hard drive so
that they can be removed.
De-Duplicator creates a tree to represent directories and files on the system. It then
traverses each directory and file represented in the tree. It does this using a depth-first
traversal. State what order it will visit each of the files as shown in Fig.1 below. 7(a). Atlas Airlines runs flights across cities in Europe. It stores the prices of different flights in
its computer system.
[3]
ii. Rather than storing cities in an array you could use a linked list.
State a data structure that would be suited to represent the data above. Describe a difference between an array and a linked list.
[1]
(b). A function tripCost has been written that takes in two cities and returns the price of a [2]
direct flight between them.
.
Rome Barcelona
BCN
International
DUB Dublin
LIS Lisbon
i. Write a program in the language or pseudocode of your choice that uses the cities London
array to calculate and output the cost of a given journey as a monetary value. In the LHR
Heathrow
case above this would be £950.
Paris, Charles
CDG
De Gaulle
PRG Prague
RKV Reykjavik
FCO Rome, Fiumicino
[5]
(e). Using floating point representation with 4 bits for the exponent and 4 bits for the
[6] mantissa, add together the following floating point binary numbers and write the answer
as a normalised floating point number with 4 bits mantissa and 4 bit exponent.
[3]
8(a). State which bitwise manipulation on 00010101 would have achieved the same result as
the calculation on part (a).
[1]
(f). Demonstrate subtraction in binary using 8-bit two’s complement using the equivalent of
the denary calculation 47-23. You must show all working.
(b). Two equal (unsigned) integers, shown below, are added together. Calculate the result,
showing your working.
[4]
[2]
9(a). The truth table below has two inputs, A and B, and two outputs, S and C.
(c). Convert the denary number -52 into an 8-bit binary number using two’s complement.
[2]
(d). Describe why two’s complement may be preferable to sign and magnitude.
[1]
[2]
ii. Write a logic expression for C in terms of A and B.
[1]
[1]
iii. Use the expressions for S and C to draw a single logic circuit for the truth table.
[1]
[2]
(b). Using the denary number 89 as an example, explain the relationship between binary and
hexadecimal representations.
(b). Using the rules for manipulating Boolean expressions simplify the following:
A ∧B ∨ A∧(B∨C) ∨ B∧(B∨C)
[3]
[4]
(c). i. Change the denary number -89 into a two's complement, 8 bit binary number.
[1]
[1]
ii. A binary coded decimal number.
[3]
(d). i. Add the two binary answers which you obtained, using 8 bit arithmetic.
(b). The program contains a module which clears the display using a routine to insert a space
in each element of the array using the following algorithm.
[2]
[3]
The program contains a module which displays a message at a given position using the
algorithm below. For example, DisplayString(“HELLO”,2,1) should display the message
“HELLO” on the second row, starting from the first column.
11(a). The organisers of an international football competition are planning to use a large
electronic score board to display information to spectators in the stadium. The board can
display three lines of text of 15 characters each.
The program stores the text to be displayed in an array called Board, so that
● Board(1,1) contains the letter in the top left corner of the display board
● Board(3,15) contains the letter in the bottom right corner of the display board.
MID(Message,i,1) returns the character at position i in the string.
A module in the program updates the display every time the contents of this array are
changed.
State the identifier, number of dimensions and most appropriate data type of the array
Board.
Identifier ......................................................................... 12(a). A Huffman code is a type of binary code where characters are represented by binary
numbers of different lengths. A possible Huffman code for a character set of four
Number of dimensions ......................................................................... characters is:
State how the word CAB would be represented in this code. (d).
[1]
The source of the message needs a routine to encode messages into the Huffman code.
The routine should allow the user to enter a message and output the encoded message.
The following algorithm takes a message as binary digits, one at a time, from a source and
outputs the message that is being transmitted. Write this routine in a high level language you have studied, stating the name of the
language you have used. Yo u should use good program writing techniques to ensure that
your routine is easy to understand.
You can assume that the message consists only of the characters A, B, C and D.
Name of
language
Routine
[2]
[7]
(c). State what the operation + does on line 04. State the name of this operation.
(e). Programming language environments provide several facilities for editing and debugging
[2] programs.
Name two of these facilities. Describe how each can be used when writing the routine in
part (e).
1
When a pupil tops up a card, the following algorithm is used to update the amount of
credit on the card. The algorithm is written in pseudocode.
[6]
For each item of data, state the most appropriate data type and the size in bytes. (c). Explain the difference in the use of = in lines 06 and 07, identifying the type of operator
being used in each case.
Item Data type Size in bytes
The card's six digit identification number
The amount of credit on the card
Whether the owner of the card is entitled to
free school meals
[6]
[4]
[3]
Complete the algorithm for this routine by filling in the spaces.
[3]
[8]
(e). When a new pupil is given a card, the record for the card needs to be inserted into the file.
The quality of written communication will be assessed in your answer to this question. Calculate their denary values.
R = 000110100101
[3]
ii. 01001110
[3]
ii. State one type of data structure that is always considered to be static.
(b). A real binary number may be represented in floating point binary notation using 7 bits for
the mantissa followed by 5 bits for the exponent, both in two's complement binary.
i. State which of the binary numbers P and Q is normalised. Give a reason for your
answer. iii. State the meaning of the term dynamic.
P = 101100110001
Q = 110100110011
[2]
(b). Write the denary number +3.5 as a normalised binary number in the format described in
(a).
16(a). A real binary number may be represented in normalised floating point binary notation
using 5 bits for the mantissa followed by 3 bits for the exponent, both in two's
complement binary.
[3]
The following binary numbers are in the format described.
X and Y are the maximum possible values for each of their formats.
[1]
[3] [1]
ii. 10100111 iii. Explain the trade-off between accuracy and range when representing numbers,
using the denary values of X and Y in your answer.
[3]
[4] Data type Size in bytes
Date (dd/mm/yyyy)
Time (hh:mm:ss)
Sensor 1
Sensor 2
Sensor 3
Sensor 4
17(a). ChillDel Limited distributes chilled food from food manufacturers to supermarket
Sensor 5
distribution depots, using refrigerated vehicles. During transit, the temperature of chilled
food must be maintained in the temperature range 0.0 °C to +4.5 °C. Error flag
There are five temperature sensors located within the body of the vehicle, which are
[4]
sampled every second, and their values are recorded during the transportation of the
ii. If the samples are taken every second, and the length of the journey is three hours,
foods.
calculate an estimate of the file size in kilobytes (KB). Show your working.
In the vehicle is a display that shows information gathered from the five temperature
sensors during transportation. This display is 16 characters wide by 8 characters high.
● the lowest and highest values recorded during transportation from any of the
sensors
● the current sampled lowest and highest values from the sensors
● the current average value.
(c). The software code written to sample and record the sensor data carries out the following
actions:
[5]
Module number Action
1 Get the system DateTime
2 Read each sensor value
3 Check sensor reading is within range
4 Initialise values
(b). i. All the sampled data from the sensors is stored on a memory card for analysis at
5 Get sensor value
the receiving distribution depot. Complete the data table below.
6 Write sample record to serial file
7 Set error flag
8 Do nothing
[6]
The modules are not in any particular order.
[4]
19(a). A real binary number may be represented in normalised floating point binary notation,
using 4 bitsb for the mantissa followed by 3 bits for the exponent, both in two's
complement binary.
i. Convert the denary value 1.75 to normalised two's complement binary in the format
[6]
described.
ii. Module 6 is called ‘Write sample record to serial file’.
You must show your working.
Write the subroutine in pseudocode to perform this action.
[2]
[4]
(b). Represent the number 55 in normalised floating point binary notation, using 8 bits for the
ii. Convert the following number to denary. mantissa followed by 8 bits for the exponent, both in two's complement binary.
[2]
0 1 1 0 1 1 1
(c). Represent the number 55 in normalised floating point binary notation, with the mantissa
and exponent both in two's complement binary, using as few bits as possible.
[3]
[2]
[1]
[4]
21. A DIY store has an offer: ‘Spend £20 or more on decorating products and get 10% off all
gardening products.’
When items are scanned in at the checkout they are stored in a 2-dimensional array called
purchases, which stores the item name, category and price.
20(a). Give the number 55 in binary as an 8-bit unsigned integer.
A receipt with the appropriate discounts deducted is then produced.
Examples of the array and corresponding receipt are shown in Fig. 2 and Fig. 3.
22. Asim is the head of a chess club. One of his jobs is to send out a monthly newsletter.
For the newsletter, club members send in descriptions of games they play using chess
notation, which consist of a sequence of symbols, letters and numbers. It is important
that these descriptions are accurate.
One member sends in the description as a plain text file. The text file is saved using
Unicode, an extract of which is shown below.
[6]
[3]
When Asim opens this file on the text editor on his computer it looks as below.
[2]
23. Express the denary number −43 in binary using 8-bit two's complement representation.
[1]
[1]
24. The following JavaScript has been found to crash certain web browsers.
[1]
j.toString() converts j to a string. It is the JavaScript equivalent to str(j).
Line 5 pushes total onto a stack. Define the term stack, stating why it is suited to
holding a web browser’s history.
(c). The two values below are stored using unsigned binary. Calculate the subtraction of
01110010 from 11000011. Show your working.
[2]
(b). Explain the difference in the function of OR and XOR gates.
[2] [2]
(d). Convert the denary number 15/8 (i.e. 1.625) to a normalised floating point binary number
using 5 bits for the mantissa and 3 bits for the exponent. Show your working.
[3]
26(a).
[1]
(c). A circuit contains the logic gates shown below.
A linked list stores the names of cities on a coach tour in the order they are visited.
1 1 1 1
1 1 1 0
1 1 0 1
1 1 0 0
1 0 1 1
1 0 1 0
1 0 0 1
1 0 0 0
0 1 1 1
0 1 1 0
0 1 0 1
0 1 0 0 [3]
0 0 1 1
ii. The tour is amended. The new itinerary is: London, Oxford, Manchester then York.
0 0 1 0
Explain how Birmingham is removed from the linked list and how York is added.
0 0 0 1 You may use the diagram below to illustrate your answer.
0 0 0 0
ii.
iii. [4]
iv. Complete the Boolean expression below to represent the circuit.
≡ Output
[2]
[4]
28(a). i. Convert the denary number 188 to an unsigned 8-bit binary number.
[4]
[1]
[2]
(b). i. Convert the denary number −44 to an 8-bit binary number with sign and magnitude
representation.
(d). Demonstrate subtraction on the two numbers below, both stored in normalised floating
point format, using 6 bits for their mantissa and 4 for their exponent. Show the result in
the same format. Show your working.
[1]
ii. Convert the denary number −44 to an 8-bit binary number with two’s complement
representation.
[6]
[1]
Players are given 10 random letters and asked to find the largest word they can make
from those letters. Each letter can only be used once. The length of the word determines
the number of points awarded. e.g. a word with 6 letters would mean 6 points are
awarded.
Example
The word POST returns 0 (there is no S in the random letters). Give one advantage of storing the words in a binary search tree over an array.
And [1]
The word RETURN returns 0 (there is only one R in the random letters).
ii. The program is compiled. Explain the process of compilation including how
code from the library becomes part of the finished program, justifying why each
stage is necessary.
30. A company releases an Internet connected fridge. Users can email messages to the fridge
and it puts them on its display.
The fridge uses the ASCII character set. Give one disadvantage of the fridge using ASCII
rather than Unicode.
[1]
31(a). A cinema offers discounted tickets, but only under one of the following conditions:
• Customer is under 18 and has a student card.
• Customer is over 60 and has ID which proves this.
Let:
A be Customer is under 18
C be Customer is over 60
D be Customer has ID
[9]
(b). The cinema has a voucher which promises free popcorn when the voucher is produced
whilst buying a soft drink or bottle of water.
Let: its latest film 5 days before the release date via a private download. It wants to ensure that
no cinema shows it before the release date.
E be Voucher is shown
ii.
(E⋀F) ⋁ (E⋀G)
[3]
[2]
Most films are now distributed to cinemas digitally. A studio allows cinemas to download
(b). Draw the logic gates represented by the Karnaugh Map below. Show your working.
[1]
[1]
[1]
[4]
(d). The following floating point binary number is represented using 7 bits for the mantissa and
4 bits for the exponent, both using two’s complement.
Mantissa Exponent
0100101 0100
33(a).
Convert the denary number 72 to an unsigned 8-bit integer. Convert the number to denary, showing your working.
(b).
Draw a logic gate diagram to represent the expression below.
[3] [4]
(¬A ∧ B) ∨ (¬C ∧ D)
(e). Given that computers store everything in binary, explain how they are able to represent
text.
[2]
Give a simplified version of the expression using the Karnaugh Map. You must show your
working.
35. A meteorologist sets up a weather station to monitor temperatures throughout the year.
Simplified
[3]
Expression:
The weather station records the temperature every day as an integer. At the end of the
year the temperatures are stored in an array called temperatures. 36. A software company is producing software that allows users with severe mobility issues
to input data into a computer.
Write a program in pseudocode that reads through this array and produces an output
which shows the total number of days within each band. An example of such an output is The software flashes up letters on the screen one at a time. The user sends a signal to the
shown below. computer when the letter they want appears on the screen.
Band A: 93 Rather than displaying the whole alphabet, once the first letter has been entered, the
Band B: 143 program only shows letters that could be possible according to words in its dictionary. All
Band C: 98 possible words are stored in a tree data structure.
Band D: 31
The program is tested on a sample dictionary of four words, represented as a tree in Fig.
Ensure your code is efficient.
3:
BARON
BATHS
BELOW
BELTS
i. Annotate Fig. 3 to show how the word BELTS would be removed from the tree.
ii.
iii. Annotate Fig. 3 to show how the words BEACH and BONE would be added to the
tree.
[6]
The key is a sequence of ten numbers.
In this example we will use 1 2 3 4 5 1 2 3 4 5. The first 5 numbers state how
many spaces the rows 0 to 4 must be rotated right.
E I L O V
P U C O M
R S C T E
E N C E I
T O W R M
Fig. 3
The next 5 digits state how many spaces down the columns 0 to 4 should be rotated.
T N C O V
E O C T M
37(a). A student writes a program to apply a symmetric encryption algorithm to work on
P I W E E
messages of up to 25 ASCII characters.
R U L R I
Describe what is meant by the term ‘ASCII’. E S C O M
I L O V E for i = 0 to 4
C O M P U x = getNextDigitInKey()
T E R S U shiftColumn(i,x)
I E N C E next i
T O W R M
/Now reassemble array back into string.
(b). Demonstrate how the bottom byte below is subtracted from the top byte. Show your
working.
(b). Write the procedure shiftRow.
[2]
0011011100001111
[2]
[4]
(d). The number below is represented in floating point format with a 5-bit mantissa in two’s
complement followed by a 3-bit exponent in two’s complement. Calculate the denary
38(a).
value of the number, showing your working.
Demonstrate how the bytes below are added together. Show your working. 01001 010
[2]
[3]
[1]
(e). The numbers below are represented in floating point format with a 5-bit mantissa in two’s
complement followed by a 4-bit exponent in two’s complement. Normalise the numbers
shown below, showing your working.
00011 0010
39(a).
Q≡¬A⋁B
[2]
11100 0110
[2]
[2]
(b). Find the Boolean expression represented in the Karnaugh Map below. Show your
working.
(f). Show the byte below after having an AND applied with the masking byte.
Byte 1 0 1 1 1 0 0 1
AND 1 1 1 1 1 1 1 1
Result
[1]
(g). Show the byte below after having an AND applied with the masking byte.
Byte 1 0 1 1 1 0 0 1
OR 1 1 1 1 1 1 1 1
Result
[5]
(d). Show the denary number −2⅝ as a floating-point binary number with a 6-bit mantissa and
4-bit exponent, both stored using two’s complement representation.
‘H’ Character
“Hello”
41(a). Stacks and queues are both data structures.
35
State which of a stack or queue would be considered as a ‘First In First Out’ data
−2.625 Real structure.
True [1]
[3]
(b). A stack is shown in Fig. 4.1 before a set of operations are carried out on it.
Draw what the stack shown in Fig. 4.1 would look like after the following operations:
(b). Show the denary number 35 as an 8-bit (unsigned) binary number.
push("A"), push("B"), pop(), push("C"), pop(), push("D")
[1]
(c). The character ‘A’ in the ASCII character set is represented by the denary value 65. Write
Fig. 4.1
the binary representation for the ASCII character ‘H’. Show your working.
[2]
[2]
(c). Fig. 4.2 shows a stack in two states: State One and State Two.
name8 = input("Enter a name: ")
name9 = input("Enter a name: ")
name10 = input("Enter a name: ")
It has been suggested that this code could be made more efficient and easier to maintain
using an array or a list.
Draw what the queue shown in Fig 4.3 would look like after the following operations:
[2]
enqueue("A"), enqueue("B"), dequeue(), enqueue("C"), dequeue(),
enqueue("D")
43. Complete the truth table to represent the following Boolean expression.
Q ≡ ¬ (A Λ B) V C
Fig. 4.3
[2]
A B C Q
0 0 0
0 0 1
0 1 0
42. A programmer has written the following code designed to take in ten names then print 0 1 1
them in a numbered list.
1 0 0
name1 = input("Enter a name: ") 1 0 1
name2 = input("Enter a name: ")
name3 = input("Enter a name: ") 1 1 0
name4 = input("Enter a name: ")
name5 = input("Enter a name: ") 1 1 1
name6 = input("Enter a name: ")
name7 = input("Enter a name: ")
Mark scheme
[2] Question Answer/Indicative content Marks Part marks and guidance
Examiner's Comments
Total 7
For 2 marks.
Total 9
For 3 marks.
For 2 marks.
ii 2
Accept forms.
● When it is, it takes the airport name from the name column (1). in the question should receive full marks.
● And prints it to the screen (1).
Array could be 0 or 1 based.
Accept && and || operators.
Examples include:
Allow follow through mark from 5a)i).
Total 5
For 4 marks.
OR
1 mark for simplified expression: B ∨ (¬C∧¬D)
1 mark for filling in table correctly.
4 4 1 mark for identifying each grouping (maximum
2). Allow follow through if tabled filled
incorrectly giving one mark for each valid
grouping if it is the most efficient possible to a
maximum of two marks.
Total 14
Up to 6 marks – 1 mark for each correct step in 00101010 For 2 marks – award 1 mark for correct answer
b 2
process. Any program with the specified 111 and 1 mark for carrying bits.
functionality should receive full marks.
● Team scores are initialised (prior to loop) (1). c 11001100 2 For 2 marks (award 1 mark per nibble).
Example:
● Iterates through array correct number of times (1).
● Checks the team the player is on (1).
● It is not easily possible to carry out calculations using sign and
5 6 d magnitude (1) whereas they will work with two’s complement 2 Up to 2 marks for a valid description.
● If the player is green adds score to the greenTeam (1). (1).
● If the player is red adds score to the redTeam (1).
● Outputs result in a sensible manner (1). Matching exponent to 211 (23) we get 0110+1000
For 3 marks (award 1 for matching exponents) 1
e 3
mark for mantissa and 1 for exponent.
Mantissa is 111 exponent 0011 normalised answer is 0111 0011
1
2
a ● 100011 1 Examiner's Comments
Examiner's Comments
iii 131 1 Almost all candidates achieved this mark
Most candidates correctly converted from
denary/binary to octal.
Examiner's Comments
● Initialise the value of d (to the empty string)
b ● Before it gets used in line 04 / as it may already contain a 2
Many good answers given, with most
−Split the binary number in groups of 4 Examiner's Comments value/ to give it a starting value candidates gaining at least 1 mark, although
−Change each into a single value/(Hexadecimal) digit
some candidates only stated “it sets d to a null
b −Digits which are between 10 and 15 are given letters A to F 3 Candidates who answered this question by
value”.
−In this example: 0101 = 5 and 1001 = 9/Therefore 89 = 59(hex) demonstration, scored well. Those who tried to
(1 per −, max 3) describe the process using prose invariably
Allow append
lacked clarity and therefore did not achieve full
Do not accept ‘add’
credit.
Examiner's Comments
c
● Joins the strings d and x into one string
2
● Concatenation operator This was poorly understood by many
Examiner's Comments
c i 10100111 1 candidates. Most thinking it was a mathematical
addition, and unfortunately not realising that the
Most candidates correctly converted from
variables were strings.
denary to two's complement.
Example (in pseudocode):
Examiner's Comments
ii 10111000 1
Most candidates correctly converted from
denary to two's complement.
If ft answer generates no carries − max. 1 mark Cannot access bullet points 2, 3 & 5 without a
loop
Examiner's Comments
d i 2 Allow for python's use of “str.replace”
For the most part, those candidates with correct
answers for the previous question parts Examiner's Comments
(1 for 8 bit correct answer, 1 for showing appropriate correct carries) produced correct answers for this but some did
not gain credit for an 8 bit answer because they Those that did poorly on this question showed a
d 7
did not evidently discard the 9th carry bit. Award up to 5 marks for the algorithm: lack of understanding about the difference
between the variable A and the string literal “A”.
NOT simply "overflow" It was a shame that some candidates also
● INPUT message missed out on marks for not inputting/passing
Examiner's Comments
● Uses a loop the “message” in and the indentation of their
−Answer needs 9 bits / Carry / overflow out of 8 bit byte ● … to correctly visit each character code. Python seems to be the most common
−Two negative numbers have been added and the result is a positive language used but the syntax was not always
ii number 2
Most candidates gained some credit for ● Replaces “A”, “B”, “C” and “D” with correct code
identifying the need for 9 bits or the discarded used correctly.
−Answer is 95 ● Outputs the result
bit producing a positive answer. Few candidates
(1 per −, max 2)
gained maximum credit with some candidates
stating that sign and magnitude should be used
for binary subtraction.
Award up to 2 marks for style
Total 12
● Meaningful identifiers
Allow suitable name ● Commenting
Allow 2D
Do not except alphanumeric
● Indenting
● Identifier: Board / board
1 Not dry running / trace tables
1
a ● Number of dimensions: 2 3 Examiner's Comments
eg
● Most appropriate data type: Character / String
Generally well answered, the most common ● Steping
error was with the dimensions where candidates
● Translator Diagnostics ● Executes each line in turn
gave (3, 15) or 45 as the answer.
e ● reports when syntax errors are made and suggests solutions / 6
High level
Award one mark for each correctly named facility, and up to two marks for
response
the description.
(6-8 marks)
Examiner's Comments
Candidate
offers a
Translator Diagnostics, Breakpoints and watches
complete,
were generally well known but not always
working
expressed clearly. With breakpoints, for
algorithm
example, most got the point of stopping
which both
execution at a statement but then just said “to
shows
find the error” rather than checking variable
clearly how
values to see if they matched expected values.
insertion
In the case stepping it was not always clear if
point is
they were describing dry running or stepping.
determined
and how the
Total 18
new file is
produced.
Card identification number: The
algorithm is
in correctly
● Data type: String / text / alphanumeric
structured
● Size: 6 pseudocode
with
indentation,
Amount of credit: Example: suitable
identifiers or
1
a 6 comments
3 ● Data type: Real / decimal / float / double as
● Size: 4 / 8
Currency size 4/8 bytes
appropriate.
Technical
Content terms and
Examiner's Comments
spelling will
Free meals: Examiner's Comments be used
Mostly well answered, though a large minority of
appropriatel
candidates do not know how many bytes each Candidates who believed a sequential file was
● Data type: Boolean y and
data type uses. one where records are added to the end correctly.
● Size: 1 e 8
inevitably failed to score more than 2 marks in
this question. It was generally not well Medium
Allow follow through from b and between steps
answered; candidates who did try to find an level
insertion point often did it poorly. This is one of response
the standard algorithms that candidates should (3-5 marks)
● Adds up sizes eg 6 + 4+ 1 = 11 If 8 bytes used for Amount the corresponding
ensure they are familiar with. Candidate
answers are 15, 1500, 1650
b ● Multiplies by 100 eg 11 * 100 = 1100 3 has an
● Adds 10% for overhead eg 1100 * 1.1 = 1210 bytes algorithm
Examiner's Comments
which is not
fully
Most candidates gained all 3 marks here though
explained or
some lost the “overhead” mark.
contains
some errors
Do not accept conditional operator for line 06
for example
● In line 06 = is a relational / comparison operator in
Examiner's Comments
determining
c
● To check whether two items are the same
4 the insertion
● In line 07 = is an assignment operator The comparison operator was generally well
point. There
known as was the assignment operator but
● To change the value of a variable / NewAmount is an
often candidates missed out the term
attempt to
“assignment”.
structure the
code
Accept a reasonable test for free meals.
correctly but
For this question case is irrelevant for variable
may contain
names
In order: some errors,
Allow correct cast i.e float(3.50, real(3.50)
however the
Do not accept £3.50
overall
d ● FreeMeals ( = TRUE) 3
structure of
● Amount + 3.50 Examiner's Comments
the code
● FreeMeals Most candidates gained the 3 marks. The most
can still be
understood.
common error was to put the £ sign before the
Technical
3.50 (i.e. £3.50)
terms and
spelling are
mostly
correct.
Low level
response
(0-2 marks) iii Size can change during processing 1
Candidate's
algorithm
neither
shows fully Examiner's Comments
how the
insertion i
Storage required is unknown initially / more difficult to program 1 These four questions were marked as a group.
point is v
These questions were good differentiators and
determined allowed for a clear distinction between
nor explains candidates. The more able got four marks the
how a majority managed two marks.
record is
inserted.
Total 4
The code is
poorly
structured or Accept alternative methods
not
● Exponent 011 = 3
1
structured at 6
a i ● Mantissa 0.1100, move point 3 places right becomes 0110. 3 Examiner's Comments
all, and ● Denary value is 6
errors with Most candidates got full marks.
spelling and
technical Accept alternative methods
terms make Accept either fraction or decimal value
the
algorithm ● Exponent 111 = -1 Examiner's Comments
difficult to ii ● Mantissa 1.0100, move point 1 place left becomes 1.101 3
understand. Most, but not all, candidates were foxed by the
● Denary value is -3/8 = -0.375 negative mantissa and exponent and worked
out the numbers correctly but didn't realise that
Total 24
it was a negative. This was a challenging
question, aimed at the higher grade candidates.
Accept alternative methods
Exponent 0110 = 6
Examiner's Comments ● Pure binary 11.1 so mantissa 0.1110
1 Mantissa 0.101, move point 6 places right becomes
a i 3
4 0101000.
As expected most candidates (using the usual
b ● Point moved 2 places so exponent 010 3 Examiner's Comments
Denary value is 40 ● 01110 010
different methods of completing the task) Most candidates answered this correctly.
correctly answered the question.
Examiner's Comments
P normalised… Examiner's Comments
b i
… as mantissa starts 10
2 ii ● 2 1
It was pleasing to see that a high proportion of
Most of the candidates were able to correctly candidates were able to correctly identify where
identify the proper answer and the reason for it. the mantissa and exponent were.
Total 11
● Logical flow of layout (i.e. flow left to right, top to bottom)
● °c or deg C shown for all values displayed Space for data must be shown.
● Label and space for data output of Maximum Highest and
Examiner's Comments 1 lowest values…
a 5 Examiner's Comments
7
1 Size is fixed when structure created / size cannot change during ● …Current Highest, lowest and average values…
i 1 These four questions were marked as a group. In general this was well answered with most
5 processing
These questions were good differentiators and ● …in the correct format for data (sign,digit, dot, digit)
candidates gaining 4 marks. Some candidates
allowed for a clear distinction between gave the highs and lows of each sensor, which
candidates. The more able got four marks the made the screen very cramped and did not
majority managed two marks. allow them to leave space for the data. A small
ii array 1
minority of candidates didn't use the grid and ● CISC may have more registers
just wrote across it. Do not accept "task" in place of "instruction".
● RISC takes one machine cycle / CISC takes many cycles to
complete one instruction
Examiner's Comments
● RISC fixed number of bytes / CISC variable number
A fair number of responses were still mentioning
cost as a difference: the Principal Examiner felt
this response was not contextualised to
computing and as such no credit was allowed
for this.
Total 4
Examiner's Comments
● If file does not exist … Examiner's Comments 0110111 0110
● … create file c 2
Few candidates achieved full marks on this
On the whole this question was answered (1 mark for mantissa, 1 for exponent)
ii
● Open file …
6 poorly. Most candidates gained the marks for
question. Many reduced the number of bits by
● …as append … deleting the leading zero's, rendering the result
opening and closing the file but few understood
negative.
● … write record to file … the concept of file access modes and their effect
● Close file on data already in the file. Also a few candidates
Max. 1 mark
did not appreciate the difference between how
to write to a file as opposed to the screen.
d
● The variable may need to store decimal numbers.
1
Examiner's Comments
Total 25
● To store very large / small values.
This question was reasonably well answered,
with many candidates achieving the mark.
● CISC is more complex / RISC is simpler / CISC longer
1 instruction set Total 7
4
8 ● RISC requires more RAM
● CISC many address modes
Example ● □ Flip the remaining bits [1]
OR
● Prints receipt with item name and price on each line. (AO3.2)
Answer [1 mark]
● Applies a 10% discount to gardening purchases. (AO3.2)
2 ● If decorating spend is £20 or more. (AO3.2)
6 11010101 [1]
1 ● Displays each discount on the receipt. (AO3.2)
● Displays the correct total. (AO3.2) Total 4
Examiner's Comments
● Correct addressing of a 2D array (A02.1)
Accept ‘LIFO’ or ‘FILO’
This question required candidates to write an
algorithm in pseudocode. Candidates are not
required to write pseudocode in the form -A (data structure) that operates on a first in last out basis (1)
outlined in the specification Appendix 5e, any 2
reasonable form of pseudocode was given 2
-When going back a page you want to go back to the last page
credit, where appropriate. However, some 4
visited/when displaying the history we want to start with the most recent Examiner’s Comment
candidate responses were written in structured AO1.2
first (1) Most candidates could correctly describe
English which is not an acceptable alternative to a stack. Only some candidates could
pseudocode at this level of study. Few appropriately apply the use of the structure to
candidates scored full marks on this question. the scenario.
Many candidates did not demonstrate the ability
to correctly address a 2D array.
Total 2
Total 6
4
A linked list requires every node to be Some candidates may talk about time
c i complexity: linked lists being linear / O(n) and
checked (until the desired record is hash table being constant / O(1) Accept these
AO2.2 as points 1& 2 and 3 & 4 conjoined i.e. full
found). (1) marks.
A linked list will take longer to search 4
2 takes no longer as more records are Those who did not gain credit described in
some detail how hash tables were structured,
ii
A ∨ B (1 Mark) added. (1) but did not apply their response to the scenario.
AO2.2
Examiner’s Comment
∨ (C ∨ D) (1 Mark) Boolean expressions were in the main correct.
All standard notations was credited provided it Total 11
was used consistently.
Total 9
1
2
a i 10111100
Accept ‘element’ instead of ‘node / item’ 8 Examiner’s Comments
(AO1.2)
Again, these questions were very well received
A dynamic / data structure (1) by candidates with most scoring full marks.
– Function traverses every knowledge and understanding directly The first stage is lexical analysis in which..
ii
randomLetters (1) and consistently to the context AO2.1 Comments and whitespace
provided. Evidence / examples will be (2) are removed
– Correctly checks each letter of 6 explicitly relevant to the explanation. AO3.3
2
a answer against each of randomLetters Variables, and subroutines
9 (3)
(1) (AO3.2) The candidate provides a thorough stored in symbol table
discussion which is well balanced.
9
– Returns 0 if answer contains a letter Evaluative comments are consistently Which also holds data such
that doesn’t occur in randomLetters (1) relevant and well-considered. as scope and data type
Examiner’s Comments
– Returns 0 if letter occurs more times Many candidates achieved some of the available There is a well-developed line of Code is converted to a series
marks on this question for attempting to traverse
in answer than each letter in the word and each letter in the reasoning which is clear and logically of tokens
random word - a loop with a nested loop. Some
randomLetters (1) achieved more marks for comparing the current
structured. The information presented
very well. Some went on to describe how code
is relevant and substantiated. unstructured way. The information is from the library becomes part of the finished
The series of tokens and symbol table is passed supported by limited evidence and the program equally well. Few justified why each
onto the next stage, syntax analysis: stage was necessary. Many candidates scored
relationship to the evidence may not well on this question.
Here the code is checked to
be clear.
ensure it follows the rules of
the language.
0 marks
Mark Band 2–Mid Level (4–6 marks) No attempt to answer the question or
This is often accomplished by placing the tokens
The candidate demonstrates into a (abstract syntax) tree. response is not worthy of credit.
reasonable knowledge and Where it breaks the rules of the language errors
understanding of how source code is are generated. Total 18
compiled and library code If no rules are broken then it’s passed on to the
Accept: Special symbols, such as emoticons,
incorporated; the material is generally next stage…
can’t be represented.
accurate but at times underdeveloped. ..Which is code generation. 3
- Fewer characters can be represented (1) 1
0
- Characters from different languages can’t be represented. (1) AO1.2 Examiner’s Comment
Here the object code (accept machine code) is
Most candidates correctly stated that
The candidate is able to apply their created.
‘fewer characters can be represented’
knowledge and understanding directly (i.e. the binary that is executed by the processor)
Total 1
to the context provided although one
This code may be inefficient..
or two opportunities are missed. Accept (C∧D) ∨ (A∧B)
Evidence / examples are for the most .. it may contain unnecessary instructions or
groups of instructions that can be replaced by Accept (B∧A) instead of (A∧B)
part implicitly relevant to the simpler ones. Q = (A∧B) ∨ (C∧D)
Accept (D∧C) instead of (C∧D)
explanation. Code from the library is likely already compiled.
Accept alternative notations (e.g. +/. OR / AND)
3
And may well have been written in a different 3 1 mark for (A∧B)
a
The candidate provides a sound language to the main program. 1
(AO1.2)
Accept AB as (A.B) and CD as (C.D)
1 mark for (C∧D)
discussion, the majority of which is The main program source code will have Accept answers without brackets
focused. Evaluative comments are for contained lines importing the library code.
1 mark for the ∨ joining the two parts.
the most part appropriate, although A program called a linker can incorporate the Examiner’s Comments
In general, most candidates achieved all of the
one or two opportunities for code from the library with the main program…
available marks in these questions.
…into a single executable file.
development are missed. An alternative approach is for the main
executable to link to the compiled library code
(i.e. dynamic linking). (E⋀F)V
There is a line of reasoning presented E F G (E⋀F) (E⋀G)
(E⋀G)
with some structure. The information 1 1 1 1 1 1
presented is in the most part relevant 1 1 0 1 0 1
and supported by some evidence. AO3.3 Evaluation 1 0 1 0 1 1
Lexical analysis is necessary to put the code
4
into a format which can be read and processed 1 0 0 0 0 0
Mark Band 1–Low Level (1–3 marks) (i.e. parsed) by the syntax analyser.
b i
(AO1.2)
0 1 1 0 0 0
The candidate demonstrates a basic Syntax Analysis is necessary to ensure the code
0 1 0 0 0 0
knowledge of how source code is is valid in as much as it meets all the structural
rules of the language. This guarantees it will run 0 0 1 0 0 0
compiled and / or library code (though it might not do as expected and may still
incorporated; the material is basic and have occurrences of runtime errors). 0 0 0 0 0 0
contains some inaccuracies. The Code generation is necessary to turn the code
into a format that the processor can understand
candidate makes a limited attempt to (i.e. binary machine code).
1 mark for each of the pairs of rows.
(1 per -, max 3)
Also accept: ¬C vB
Accept alternative symbols.
AO2.1
Correctly identified groups on 3
a Gives: Bv¬C (1, 1st
4 Mark) Examiner’s Comments
– Karnaugh map / Correct boolean (¬A ⋀ ¬C) ⋁ (A⋀C)
statement.(1) - Correct two groups identified. AO2.2 The question required candidates to find the
(2, Last Boolean expression represented in the
Or equivalent.
4 - Bv 2 Karnaugh Map. Most candidates achieved a
1
b 133 - Initialise all 4 totals variables
AO1.2 Example:
(1) Checks through all items in the array via bandA = 0
-
suitable loop. 6 bandB = 0
3
1 Examiner’s Comments 5
- Add temperatures <=10 to Band A AO3.2
bandC = 0
c 68 AO1.2
- Adds temperatures >=31 to Band D (6) bandD = 0
(1) A significant number of candidates achieved all for i=0 to
three available marks across the first three parts
of this question.
Correctly assigns temperatures between temperatures[].length
- 11 and 20 inclusive to Band B and those - 1
3 Accept any other method if working is shown
d between 21-30 inclusive to Band C
Uses else if (or equivalent) for efficiency if
rather than multiple ifs OR uses temperatures[i]<=10
- select/case OR any other solution that then
stops trying to categorise a temperature bandA = bandA + 1
once its band is found. elseif - BEACH added
Displays results in similar format to temperatures[i]<=20 2
- then ii - BONE added (AO2.1)
shown in question. Whether branches point left or right or order of
bandB = bandB + 1 branches is irrelevant. As long as branches form
(1 per -, max 6) (1 Mark per -, Max 2) the words without unnecessary repetition of
elseif nodes, award the marks.
temperatures[i]<=30
Examiner’s Comments
then
Invariably, all candidates fared well on both
bandC = bandC + 1 parts of this question.
else
Total 4
bandD = bandD + 1
endif
American Standard Code for Information
-
next i Interchange
print(“Band A: ” + bandA)
print(“Band B: ” + bandB) 3
a
- A character set 2
print(“Band C: ” + bandC) 7 (AO1.1)
print(“Band D: ” + bandD) - Maps values to characters
Some solutions may use Select/Case. - Uses 7-bits/ 8-bits per character
E.g.
(1 Mark per -, Max 2)
Select Case temperatures[i]
When checking to see if out of bounds
Case Is<=10
exception keep in mind that in some languages
bandA=bandA+1
the loop boundaries are exclusive. When unsure
give the benefit of the doubt. The final mark is
Look out for alternative methods of iteration
meant to offer stretch and challenge. Be
such as using iterators
cautious of wrong answers on face value seems
to work. For example, the following will not
Examiner’s Comments
work:
Candidates were required to write an algorithm
procedure shiftRow(rowNumber,
and it was pleasing to see that most candidates places)
responded reasonably well to this question. for i = 0 to places
Common mistakes were: failing to initialise the grid[rowNumber,i+1]=
counter variables; incorrect concatenation in the grid[rowNumber,i]
output; using separate IF statements when
Procedure correctly defined with next i
efficiency was required i.e. (nested IF’s or
- endprocedure
SELECT CASE). parameters.
Possible solutions include…
Total 6 Procedure manipulates the correct row
- procedure shiftRow(rowNumber,
of grid. places)
4
b array temp[5]
Sensible use of for loop to iterate (AO3.1)
for i=0 to 4
T and S removed /T removed/Link - through the array without generating out temp[i]=grid[rowNumber,i]
- of bounds exception.
next i
3
between L and T removed… 2
for i=0 to 4
i newPos=(i+places)MOD 5 /% is
6
- …No further nodes removed (AO2.1) - Correctly shifts each row. the same as MOD
grid[rowNumber,newPos]=temp[i]
(1 Mark per -, Max 4) next i
endprocedure
(1 Mark per -, Max 2)
And..
procedure shiftRow(rowNumber,
places)
for i=1 to places
temp1=grid[rowNumber, 4]
temp2=0
for j =0 to 4
temp2=grid[rowNumber,j]
grid[rowNumber,j]=temp1
temp1=temp2
next j Invariably, all candidates achieved the available
next i mark on each of these question parts.
end procedure
cao
Note: within solutions, allow for columns to be
referenced first 1 Examiner’s Comments
eg grid[i,rowNumber] g 11111111
(AO1.2)
Invariably, all candidates achieved the available
Examiner’s Comments mark on each of these question parts.
Total 6
3
a - A going into NOT gate. 2
9 (AO1.2) Examiner’s Comments
B and NOT A going into OR gate (and Q
- Most candidates achieved both the available
coming out of it) marks on this question.
3
10101001 ← Answer, 1 Mark 2
a (1 Mark per -, Max 2)
8 (AO1.2) Examiner’s Comments
111111 ← Carry bits, 1 Mark
Most candidates achieved both marks on this
question. Groups correctly identified (with no
-
Allow 2 marks for any other valid method with further groups).
working shown.
- Answer includes ¬ C∧¬D
If converted to denary and calculated, no
← Borrowed bits, 1 Mark marks.
- Answer includes ¬ C∧¬D
2
b
(AO1.2)
Examiner’s Comments b
- Answer includes ¬ C∧¬D 5 Examiner’s Comments
← Answer, 1 Mark (AO1.2)
All three sections joined with ∧s in any The question required candidates to find the
Responses which used binary subtraction or - Boolean expression represented in the Karnaugh
two’s compliment were accepted for this order but with Map. Most candidates achieved a mark for
question. Most candidates scored two marks. showing the correct groupings on the map.
no further sections. Many went on to achieve some marks for the
E.g. resultant expression. Some candidates specified
(A∧¬B )∨(A∧¬C )∨(¬ C∧¬D) NOT(C AND D) instead of NOT C AND NOT D
370F The brackets aren’t necessary evidently assuming the expressions are the
2 (1 Mark per -, Max 5) same.
c 1 Mark for the first two digits (i.e. 37)
(AO1.2) Examiner’s Comments
1 Mark for the last two digit (i.e. 0F)
Total 7
Most candidates achieved both marks on this
question.
Hello – String
4
a 35 – Integer 3(AO2.1)
0
True - Boolean
- Exponent is 2
Examiner’s Comments Examiner’s Comments
d - Mantissa becomes 010.01 3
(AO1.2) In general, most candidates achieved this mark.
Most candidates achieved full marks on this
- Value is 2.25 question. Those who did not, invariably scored b 00100011 1(AO1.2) Some candidates calculated the correct binary
zero marks. value but then did not show their result as an
(1 Mark per -, Max 3) 8-bit binary number. Candidates should be
reminded to read the question thoroughly.
– Z the front element AND correct front Allow X and Y to still be visible if front pointer
has been shifted
pointer
– Followed directly by ABCD AND correct
rear pointer 2
d
(AO2.2)
Examiner’s Comments
(1 per - , max 2)
Too many candidates did not show the position
of the front and rear pointers in their response
and therefore did not gain credit on this
question.
Total 8