0% found this document useful (0 votes)
10 views47 pages

Instructions To Candidates: Duration: Not Set

Uploaded by

abuferrari2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views47 pages

Instructions To Candidates: Duration: Not Set

Uploaded by

abuferrari2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Computer Science (A Level)

1(a). A supermarket uses a stock control system.


Data types, data structures and algorithms
All OCR Past Questions Details of products are stored on a stock database.

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.

OCR supplied materials:


Additional resources may be supplied with this paper. [2]

Other materials required:


• Pencil
• Ruler (cm/mm)

(b). The name of a product is stored using characters from the computer's character set.

i. Explain what is meant by the character set of a computer.


INSTRUCTIONS TO CANDIDATES
• Write your name, centre number and candidate number in the boxes above. Please write clearly and in capital letters.
• Use black ink. HB pencil may be used for graphs and diagrams only.
• Answer all the questions, unless your teacher tells you otherwise.
• Read each question carefully. Make sure you know what you have to do before starting your answer.
• Where space is provided below the question, please write your answer there.
• You may use additional paper, or a specific Answer sheet if one is provided, but you must clearly show your candidate number, centre number
and question number(s).

INFORMATION FOR CANDIDATES


• The quality of written communication is assessed in questions marked with either a pencil or an asterisk. In History and Geography [2]
a Quality of extended response question is marked with an asterisk, while a pencil is used for questions in which Spelling, punctuation and
grammar and the use of specialist terminology is assessed.
ii. Explain how codes are used to represent a character set.
• The number of marks is given in brackets [ ] at the end of each question or part question.
• The total number of marks for this paper is 373.
• The total number of marks may take into account some 'either/or' question choices.

[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.

Write an expression using Boolean algebra to determine whether a child


receives a toy when they select a meal.

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.
.

A journey is represented by an array called cities. An example of a trip from Dublin to


Rome is shown below:
(c). Each airport has a three letter code. The airline’s system stores the airports and
corresponding airport codes:
Dublin
London
Paris Code Name

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

In a programming language or pseudocode of your choice write a program that takes in an


airport code and finds and displays the airport name. You can assume a 2D array called
airports has already been declared and populated with the data above. There is no need
to validate the input and you can assume that the user will only enter a code that exists in
the array.

[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.

0110 0010 and 0100 0011

[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]

i. Write a logic expression for S in terms of A and B.

(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]

iii. An octal number.

[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.

10(a). Change the denary number 89 into the following representations.


[1]
i. An 8 bit binary number.
ii. Change the denary number -72 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.

You must show your working.

(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.

Complete this algorithm by filling in the blanks.


[2]

ii. Explain why your answer to the addition sum is wrong.

[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:

Most appropriate data type ................................................................... A=0 B = 11 C = 100 D = 101


For example the word BAD would be represented by 110101.

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

(b). Explain the purpose of line 01.

[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]

13(a). Each record in CardFile contains data as in the table below.

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]

(b). The school has 100 pupils.


(d). At the start of each day, a routine is executed which tops up the cards of all pupils who
Calculate an estimate of the size of the file in bytes.
are entitled to free school meals with £3.50.
You must show your working.

[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.

Write an algorithm in pseudocode which:


14(a). A real binary number may be represented in normalised floating point binary notation
● Allows the user to input the six-digit identification number, the initial amount of using 4 bits for the mantissa followed by 4 bits for the exponent, both in two's
credit and whether the pupil has free school meals complement binary.
● Produces a new sequential file with the record for the new card inserted.
The following binary numbers are in the format described.

The quality of written communication will be assessed in your answer to this question. Calculate their denary values.

You must show your working.


ii. The binary number R is not normalised. Write the normalised form of R.
i. 01010110
You must show your working.

R = 000110100101

[3]

ii. 01001110
[3]

15. Data structures may be described as static or dynamic.

[3] i. State the meaning of the term static.

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

iv. Give one disadvantage of using a dynamic data structure.

[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.

Calculate their denary values.

Show all working.


(c). Using only 6 bits, the normalised binary numbers X and Y are in different formats.
i. 01100011
X = 010111
Y = 011101

X and Y are the maximum possible values for each of their formats.

i. State the number of bits in the mantissa for X.

[1]

ii. State the number of bits in the exponent for Y.

[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 information displayed is:

● 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.

The temperature range of the sensors is −4.9 °C to +9.9 °C.

Design an output screen to display the required information.


[4]

(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.

i. Below is a particular type of structure diagram showing stepwise refinement.


It uses:
o The order (left to right) of the boxes on each level to represent sequence
o ☆ to show iteration
o ○ to show selection.

18. A computer uses a Von Neumann processor.


Using the module numbers fill in the diagram below.
RISC and CISC are types of processor architecture.

Describe the differences between the two architectures.

[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.

You must show your working.

[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]

(b). A programmer has 16 bits to use to store a real binary number.


Describe the trade-off between accuracy and range when deciding how many bits to use (d). State why a programmer might choose to declare a variable as a floating point number.
for the mantissa and exponent.

[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.

i. Explain what is meant by the term ‘Unicode’.

Write an algorithm in pseudocode, using the array purchases, to:

● determine which items are given a discount


● calculate the total price to pay
● present this information on a receipt in the format shown in Fig. 3.

[6]

[3]

When Asim opens this file on the text editor on his computer it looks as below.

ii. Explain why the text may not be displaying correctly.

[2]
23. Express the denary number −43 in binary using 8-bit two's complement representation.

Show your working. 25(a).

Convert the binary number 01101111 to a hexadecimal number.

[1]

(b). Convert the denary number −19 to an 8-bit number using:


[4]
i. Two’s complement representation.

[1]
24. The following JavaScript has been found to crash certain web browsers.

ii. Sign and Magnitude representation.

[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).

Draw an XOR gate.

[1]
(c). A circuit contains the logic gates shown below.

27(a). A coach company offers tours of the UK.

A linked list stores the names of cities on a coach tour in the order they are visited.

i. Complete the logic table below.

A B C D Output i. Describe what is meant by the term ‘linked list’.

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]

ii. Convert the denary number 188 to hexadecimal.

(b). The program stores records about its customers.

Often an individual customer’s record needs to be accessed. This is done by searching


using the Customer ID. Explain why a hash table is better suited than a linked list to store
the customer records, particularly as the company acquires more customers.
[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.

010010 0100 - 010010 0010

[1]

ii. Convert the denary number −44 to an 8-bit binary number with two’s complement
representation.

[6]
[1]

29(a). A software development team is writing a word game.


(c). Explain how, using bit shift, the unsigned binary number 00101100 can be divided by 4.
The team is using Rapid Application Development.

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.

The function validateAnswer takes in the randomLetters as an array of letters and


the player’s answer as a string. It then checks if the word the player has entered only
contains letters from the 10 random letters with each letter being used only once. (At this endFunction
stage the program doesn’t check if the answer provided is an actual word.) It then returns [6]
a score, out of 10, for a valid word or 0 for an invalid word.

Example

If the random letters are


OPXCMURETN
The word COMPUTER returns 8
(b). Code is to be added to check if the word is an actual English word. All English words are
Whereas stored in a binary search tree.

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).

Complete the function validateAnswer


function validateAnswer(answer, randomLetters[])
(c). The software team use a prebuilt library to create the Graphical User Interface.

i. Give two advantages to the software team of using a library.

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

B be Customer has a student card

C be Customer is over 60

D be Customer has ID

Q be Discount ticket issued

Complete the Boolean expression below:


Q≡ [3]

[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

F be Soft drink is bought

G be Bottle of water is bought

R be Free popcorn given.


32(a). A half adder has the truth table shown below:
This could be written as:
A B Sum Carry
R ≡ (E⋀F) ⋁ (E⋀G)
1 1 0 1
i. Complete the truth table below. 1 0 1 0
0 1 1 0
0 0 0 0
E F G (E⋀F) (E⋀G) (E⋀F)⋁(E⋀G)
1 1 1
Draw a half adder using logic gates.
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0

ii.

iii. Simplify the expression

(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]

(b). Convert the unsigned binary number 10000101 to denary.

[1]

(c). Convert the denary number 104 to hexadecimal.

[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]

34(a). A Boolean expression is entered into a Karnaugh Map.

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.

She classifies temperatures in one of four bands:

Temperature Range (degrees


Band
Celsius)
Band A 10 or below
Band B 11–20
Band C 21–30
Band D 31 or above

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.

A key with the first 5 digits 1 2 3 4 5 would result in

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.

Applying the last 5 digits 1 2 3 4 5 to the grid above would give

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

Part of the pseudocode for the algorithm is written below.

global array grid[5,5]


[2] addMessage()
/ letters and random letters have been entered
/ into the 2D array, grid
The encryption algorithm works in the following way.
A message of up to 25 characters (spaces and punctuation are not included) is placed in a
for i = 0 to 4
5×5 array. Any leftover spaces are filled with random letters. The message I LOVE
x = getNextDigitInKey()
COMPUTER SCIENCE becomes:
shiftRow(i,x)
next i

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]

(c). Convert the binary number shown below to hexadecimal.

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).

Draw a logic gate diagram to represent the Boolean expression

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.

40(a). Variables in programs contain specific types of data.


[3]
Complete the table below to suggest a suitable data type for each piece of data.

Data Data Type

‘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: ")

print("1. " + name1)


Fig. 4.2 print("2. " + name2)
print("3. " + name3)
print("4. " + name4)
print("5. " + name5)
List the operations needed to get the stack from State One to State Two. print("6. " + name6)
print("7. " + name7)
print("8. " + name8)
[3] print("9. " + name9)
print("10. " + name10)

It has been suggested that this code could be made more efficient and easier to maintain
using an array or a list.

Define the term ‘array’.


(d). A queue is shown in Fig. 4.3.

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

1 for correct binary, 1 for 16 digits.

Examiner's Comments

The question did state that a binary number was


1 a ● 0000000100111000 2 required, this means that the relatively common
answer of using two 8-bit binary numbers that
END OF QUESTION PAPER add up to 312 was not an answer to the
question as set. It was odd to see so many
responses that gave the 16 bit, 2's complement
version of −312

● Normally equates to the symbols on a keyboard / digits /


letters…
b i ● …that can be represented / interpreted / understood by a 2 Not: Stored on a computer
computer
● May include control characters

● Each symbol has a (binary) code / number… Examiner's Comments


● …which is unique.
Many candidates adopted a scatter gun
ii
● Number of bits used for one character = 1 byte
3 approach to this pair of questions, inserting the
● Example code: ASCII / Unicode… facts that they knew about character sets
● …uses 8 bits /16 bits per character seemingly at random between the two parts.
● Use of more bits for extended character set Despite this most scored well here and some
candidates gave clear and well-presented
responses to both parts.

Total 7

2 a 00101011 1 For 1 mark.

For 2 marks.

1 mark for correct answer plus an additional


method mark for showing borrowed bits.

b 00011010 2 No method mark for converting numbers to


denary performing subtraction and converting
back to binary.

Allow full marks for converting second number


to two’s complement and performing addition.

c 11010101 2 For 2 marks – showing valid method 1 mark.

For 2 marks – 1 mark for mantissa 1 mark for


d i 0111 0001 2
exponent.

For 2 marks – 1 mark for mantissa 1 mark for


ii 1001 0001 2
exponent.

Total 9

For 3 marks.

1 mark for ∧ used to conjoin g and f to rest of


expression.
1 mark for s ∨ c.
3 i t≡g∧s∨c∧f 3 1 mark for brackets around s ∨ c.

Give full marks to any equivalent expression.

Accept different notations.


t ≡ g. s + c .f

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

Simplified expression: B v (¬C∧¬D)

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

Total 4 8 a ● Shift left (1). 1 For 1 mark.

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

● 23 in binary 00010111 (1)


Total 6 ● −23 2’s complement 11101001 (may be two steps to get
For 4 marks – 1 mark per bullet or equivalent
f this, negate bits plus 1) 4
stages.
● Accounts.doc, budget.xls (1). For 3 marks.
● 47 in binary 00101111
6 ● Followed by beach.jpg, sunset.jpg, hotel.jpg (in any order) (1). 3 If answer includes directory names ignore the ● add them together 00011000
● Followed by tournament.xls (1). directories and just mark order of files.
Total 14
Total 3
9 a i ● S=A XOR B 1 For 1 mark.
For 1 mark.
7 a ● Graph (1). 1 ii ● C=A AND B 1 For 1 mark.
Accept 2D array.

For 5 marks – 1 mark for each correct step in


process.
iii 2 For 2 marks – two gates with correct inputs.
● Creates a variable to represent total cost and initialises it to 0 Any program that has the functionality specified
(1). in the question should receive full marks.
● Iterates up to the penultimate item of array (1).
b i 5
● Adds to the total cost … (1). Example:
● … Uses the correct arguments in the tripCost function (1).
● Outputs the total cost formatted with a £ prefix (1).
For 4 marks - 1 mark for each bullet completed
b 4
correctly.

● A linked list is a dynamic data structure (1) whereas an array is


static (1).
● An array can have any element accessed directly (i.e. random
ii access) (1) whereas a linked list needs to be traversed until the 2 Up to 2 marks for a valid description. Total 8
desired element is found (1).
● Contents of an array are stored contiguously in memory (1)
whereas the contents of a linked list may not be (1).
1 Examiner's Comments
a i 01011001 1
0
● Takes in code of airport (1). For 6 marks – 1 mark for each correct step in Most candidates correctly converted from
c
● Iterates through the array (1).
6
process. denary to binary.
● Checks the value of the code column at each iteration (1).
Any program that has the functionality specified
● To see if it is equal to code given (1).
● Column This question was well answered with most
candidates gaining full marks
● Row
Examiner's Comments
ii 10001001 1
Total 6
Most candidates correctly converted from
denary to binary coded decimal.

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.

Note: follow through from candidate answers


to previous part

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

cao example from code ● To allow checking of path(s)/values


In order
● Breakpoints ● (Variable) watch
b 3
Examiner's Comments ● Allows the code to stop at chosen point ● To monitor the status of variables
● 15
(and objects)…
● To check variables / example from code ● … as you step through code / as they Levels of
change response

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.

Accept alternative methods


Accept either fraction or decimal value Examiner's Comments
Exponent 1110 = -2
ii Mantissa 0.100, move point 2 places left becomes 0.001 3 Examiner's Comments
c i ● 2 1
It was pleasing to see that a high proportion of
Denary value is 1/8 = 0.125 candidates were able to correctly identify where
Candidates on the whole correctly answered the the mantissa and exponent were.
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.

Correct mantissa & exponent with no Allow opposites.


explanation max 2
● Larger mantissa increases accuracy
Examiner's Comments
cao iii
● Smaller exponent decreases range
4
Mantissa 0001101 move point 2 places right & fill with 0s on right ● X = 64 It was really pleasing to see the high proportion
ii Decrease exponent by 2 3 Examiner's Comments ● Y = 1.75 of candidates who got full marks on this
011010000011 question.
For some reason this question was not as well
answered as anticipated, perhaps it was
Total 15
because of the slight change in direction from
the previous questions.

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

● 1.75 Converted to binary 1.11


1
a i
● Move decimal point 0.111
4
Examiner's Comments
9 ● Exponent is 001
Candidates are getting expert at these and there
● Correct answer 0111001
were very few wrong answers.
Date type Size in bytes
Date (dd/mm/yyyy) STRING/CHAR 10 Allow 2 or 4 bytes per character (unicode) for
Date & Time (i.e. 20 or 40 bytes)
Time (hh:mm:ss) STRING/CHAR 8 Accept other methods
Sensor 1 REAL 4 or 8 Allow date (8 bytes), time (8 bytes), long int (4 ● Exponent 111 = 000 + 1 = −1
bytes) instead ofSTRING/CHAR Examiner's Comments
Sensor 2 REAL 4 or 8 ii ● 0110 move decimal point = 0.011 3

Sensor 3 REAL 4 or 8 Allow decimal/float/double instead of REAL


● Convert to decimal/ fraction 0.375/ 3/8 The most common errors were either moving the
b i 4 exponent the wrong way or treating the whole
Sensor 4 REAL 4 or 8
Allow byte or short int for Error Flag number as a single entity. Very few candidates
Sensor 5 REAL 4 or 8 are doing this though.
Error Flag BOOLEAN 1 Examiner's Comments

It was disappointing to see that a lot of


● Date ‐ type and size candidates are not aware of the correct data ● The larger the mantissa…
Allow opposites
● Time–type and size type to use and the byte sizes. ● … the more accurate the number
b 4
● Sensor 1 … Sensor 5–type and size ● The larger the exponent… Examiner's Comments
● Error Flag–type and size ● ....the greater the range
Very few candidates got this wrong, most
Record size allow FT managed to achieve the full four marks.
Accept divide by 1000
● record size Total 11
Examiner's Comments
ii
● 60*60*3 * record size (10800* record size)
4
● System overheads 10–20% This was mostly answered very well, with the
● converted to KB divide by 10244 main weakness being not allowing for
2 00110111 Examiner's Comments
overheads or showing how they converted to a 2
0 (1 mark per nibble)
KB.
This question was well answered, with most
candidates achieving full marks.
One mark for each correct box on row 1 & 2.

One mark for correct row 3


Examiner's Comments
Examiner's Comments 01101110 00000110
c i 6
b 2
Few candidates achieved full marks on this
Most candidates were unsure of where the (1 mark for mantissa, 1 for exponent)
question. Many represented a normalised
initialisation of values should take place within
floating point mantissa with two of the same bit
the design, although most candidates in
at the start.
thealgorithm questions placed it correctly.

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

● □ Work out the positive equivalent in binary [1]


● □ Take the one's complement (e.g. flip the bits) [1]
● □ Add one [1]

● 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

Three of: Accept each character is represented by 1byte / 1


2
2 bytes / 4bytes (or equivalent value in bits) for a 6F
5 Examiner’s Comment
BP 3 AO2.1
● □ Unicode is a character set [1] Very well answered by the majority of
candidates.
2
i ● □ Mapping different binary values to characters (on the 3 Examiner's Comments
2 screen).[1]
1
● □ Each character is represented by 1-4 bytes. [1] Many candidates' explanations lacked clarity. b i 11101101
● □ It supports a very large number of characters [1] Although most did state that Unicode was a AO2.1
● □ It is backward compatible with ASCII [1] character set.

● □ Asim's text editor may only support ASCII which doesn't 1


include characters for the chess piece [1] ii 10010011
Question states plain text file so no credit for Examiner’s Comment
● □ Cannot recognize / understand the binary values of the two
mention of missing graphics files.
AO2.1
Very well answered by the majority of
pieces [1]
candidates.
Examiner's Comments
ii 2 NB some candidates represent carries with 10
OR Few candidates referred to the codes that as binary 2 rather than 2
represent the symbols in their explanations, Accept answer with missing leading zero.
more so referring to the symbols themselves
● □ Asim may be using a font which doesn't include a which did not gain credit.
representation for the chess pieces… [1]
● □ …and so those characters can't be represented. [1]
2
Total 5 c
AO2.1
Method [3 marks] 1 Mark for answer

1 Mark for showing working using appropriate binary method.


● □ Treat left most bit as negative value (e.g. −128) [1] Examiner’s Comment
● □ Treat remaining bits as positive values [1] Well answered although candidates were
Examiner's Comments
● □ Total them the relevant placeholder values. [1] required to show their binary working.
2
4 These questions were well answered, with many
3 15/8 is 1.101 in fixed point (1 Mark)
candidates achieving full marks. However, some
OR candidates lost marks for simple arithmetic
errors. Candidates should be reminded to binary point needs moving one place giving
thoroughly check their responses. 3
● □ Work out the positive equivalent in binary [1] d 01101 001
● □ From the right, working left copy down all the bits up to and AO2.1
including the first 1 [1] One mark for Mantissa 01101
Examiner’s Comment
One mark for exponent 001
Again, this question was generally well answered
with most candidates showing clear and logical
workings. Oxford pointer changed to
– bypass Birmingham and point
Total 8
to Manchester. (1) On diagram don’t penalise if the pointer from
Accept diagram of gate only without input / Birmingham is left intact. It should be clear in
output both diagram and text that Oxford no longer
2
1 A node is created holding the points to Birmingham.
a
6
AO1.1
Examiner’s Comment data York / York is placed is
There were very few candidates who could not
correctly draw an XOR gate. – next free space / node /
Accept appropriate, correctly labelled, truth
item (1)
tables. One mark for each truth table. In diagram solution, London, Oxford and
Manchester must remain in the same positions.
Manchester remains in original
OR gate outputs true if at least one of its inputs is true (1)
2
– position and pointer changed to
Examiner’s Comment
b
A lack of clarity of expression led to candidates point to the York node. (1)
XOR gate output true if and only if one of its inputs is true. (1)
AO1.2 not gaining credit in this question. Some
candidates who achieved full marks supported Examiner’s Comments
their descriptions with correct two-input truth The York node points to null (or Those candidates who scored well in 2ai) went
– on to achieve at least some of the marks here.
tables which clearly demonstrated the
difference.
terminator). (1) Many candidates found it challenging to clearly
explain how the linked list was manipulated. If
the question states that ‘you may use the
OR via diagram eg.: diagram to illustrate your answer’, centres
should encourage candidates to do so.

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

(as more nodes are


added). (1) (AO1.2 –
Examiner’s Comment b 2 marks
This question was well received by candidates A hash table enables direct access to
AO2.2 –
with most achieving full marks. the location of the record. (1) Examiner’s Comments
Accept answer without brackets. A hash table will take the same time to 2 marks) Most candidates gained some credit on this
question by explaining why hash tables are
(A ∨ B) ∨ (C ∨ D) ≡ Output Accept alternative notation i.e. OR, +
search (as more nodes are added)/It better suited than linked lists for searching.

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.

Each node / item consists of data and 3 Examiner’s Comments 1


2 Surprisingly few candidates achieved full marks ii BC
7
a i pointer (1) on this question. Many received some marks (AO1.2)
Pointer gives location of next (AO1.2) but in general responses lacked detail. Centres
should advise candidates that the number of
node. (1) marks awarded for questions gives an indication
of the number of different points required in the 1
response. b i 10101100
(AO1.2) Examiner’s Comments
Again, these questions were very well received
4 by candidates with most scoring full marks.
ii
Description can be written: (AO2.1)
1 letters and outputting the length of the valid
ii 11010100 word. Fewer candidates achieved the final marks
(AO1.2) – Returns answer length for a valid for checking if the letter was in the word or
duplicated.
Allow one mark for correct number of places but
word.(1)
wrong direction.

Accept O(log n) search time rather than O(n)


Shift Right (1) 2
c
Two Places (1) (AO1.2)
Examiner’s Comments BS Tree can be searched quicker than 1
Generally most candidates stated that two bit b
shifts were required but some went on to state an array. (AO1.2) Examiner’s Comments
the incorrect direction i.e. left. Very few candidates did not achieve this mark,
most correctly stating the advantage ‘faster to
Correct answer with clear binary subtraction/2’s search’.
complement addition calculation gives full
marks.
Binary point: shifted four places gives: Saves time / money as prewritten (1)
01001.0 (1)
Binary point shifted two places gives: Draws on expertise of other
010.010 (1) programmers (1)

Pre-tested (so likely to work) (1) 2


c i
Subtraction carried out … (AO1.2)
01001.000 – Can have been written in a different
6
d 010.010 language (1) Examiner’s Comments
Those candidates who cited generic advantages
(1) (AO1.2)
of using subroutines as opposed to library
routines did not gain credit. The question asked
for advantages to the team of using a library.
…’Borrowing’ shown… (1)
…Answer: 0110.110 (1) Examiner’s Comments
(Max 2)
Candidates whose solution was presented in a
Normalised to: Mantissa 011011 (1) logical manner tended to score at least 4 marks
Points may include but are not limited to:
on this question. Candidates used different
Exponent 0011 (1) methods to find the solution, all of which were Mark Band 3–High Level AO1 Knowledge and Understanding
accepted (provided the logic of the calculation (7–9 marks) The compiler is effectively a group of programs.
could be followed).
Centres should advise candidates to present the The candidate demonstrates a
The stages of compilation are: lexical analysis,
layout of their responses to this type of question
in a logical manner.
thorough knowledge and syntax analysis, code generation and
understanding of how source code is optimisation.
Total 12 AO1.1
compiled and library code A linker is then used to combine the object code
with the library code to make the final
incorporated. The material is generally (2)
executable.
– Function traverses every letter of accurate and detailed. AO1.2
AO2.1 Application
answer (1)
The candidate is able to apply their (2) Source code is input into a compiler program.

– 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.

apply acquired knowledge and Accept:


The code optimisation whilst not necessary,
understanding to the context provided. does ensure the code runs quicker or using less
(G∨F) ∧ E
memory. (F∨G) ∧ E
E ∧ (F∨G)
The candidate provides a limited Linking is necessary to ensure the library code is 2
incorporated into the final program. ii
discussion which is narrow in focus. One mark for the (F∨G) (AO2.2)
E ∧ (G∨F)

Judgments if made are weak and


Examiner’s Comments One mark for the ∧ E
unsubstantiated. The information is Candidates were assessed on the quality of their
Examiner’s Comments
In general, most candidates achieved all of the
basic and communicated in an extended response in this question. Many
candidates explained the stages of compilation
available marks in these questions.
AO1.2
Total 9
- Exponent is 4 (3) Examiner’s Comments
- Move binary point 4 places to the right This question was well attempted by most
- Answer is: 9.25 candidates. The methods used were invariably,
clearly shown.

(1 per -, max 3)

Computers use a character set/ASCII/


XOR Gate (1) 3 -
3
a UNICODE
2 2
(AO1,1)
AND Gate (1) e - To map binary values to characters
AO1.1
Each character is represented by a (2) Examiner’s Comments
-
Correct connections and no additional Examiner’s Comments unique value Most candidates achieved both available marks.
Most candidates scored well on these questions
With the majority describing ASCII.
gates (1) demonstrating their understanding of logic gate
(1 per -, max 2)
circuits. Some candidates simplified the circuit
in part b) which achieved full marks provided the
resultant circuit gave the same output. Total 8

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

– NOT A AND NOT C Gates (1)


Marks) mark for showing the correct groupings on the
b - ¬ map. Many went on to achieve the marks for the
(AO2.2) resultant expression. Alternative notations were

– A AND C gates (1) (1 per -, max 3) accepted and credited.

Both sets of gates joined by OR


– Or equivalent. - NOT gates after A and C
gate (with no other gates used). (1)
AND gates: one taking (NOT) A, B as
Examiner’s Comments - inputs the other taking (NOT) C, D as 4
Most candidates scored well on these questions
demonstrating their understanding of logic gate b
inputs.
AO2.2
Examiner’s Comments
circuits. Some candidates simplified the circuit An OR gate taking in the outputs of both (4)
in part b) which achieved full marks provided the -
resultant circuit gave the same output. AND gates. Most candidates achieved some credit on this
question. There were some unusual
Total 7 - …No further gates or connections representations for NOT gates. Candidates are
best advised to use the representations listed in
(1 per -, max 4) the appendix to the specification.
1
3
a 01001000
3 AO1.2 Total 7
(1)

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.

Few candidates scored more than two marks on Total 15


this question. In most cases, this was due to the
fact that the code overwrote the original array
value when shifting. Only the top scoring
candidates appreciated that an intermediate
temporary variable/array was required to hold
the original value(s).

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.

If step one is incorrect allow FT for second mark

01100 0000 Examiner’s Comments


Examiner’s Comments
e
1 Mark for mantissa, 1 mark for exponent.
4 – If A is 65, H is 72 Some responses lacked attention to detail in
(AO1.2) Surprisingly, this question was poorly c 2(AO2.1) that candidates initially calculated the denary
10000 0100
attempted. Few candidates gained full marks – 72 in binary is 01001000 ASCII value of H to be something other than 72.
with many not gaining any credit. Candidates This error was then followed through to the
1 Mark for mantissa, 1 mark for exponent. binary representation. Candidates should be
should be reminded that the first two bits of the
mantissa must be different in normalised floating well advised to check their workings to combat
point numbers. such errors.

cao Give full marks if correct answer.


1
f 10111001 3 Allow FT
(AO1.2) Examiner’s Comments d
– -2.625 in fixed point is 101.011 (AO1.2)
Examiner’s Comments
The presentation of the responses to ‘denary to
– Binary point moves two places left giving floating point’ conversion questions is (1 per - , max 2)
1.01011/Mantissa is 101011 improving. Although, some candidates are not
reading the question thoroughly and presenting Total 2
– Exponent of 2 is 0010 their final answer in a different format to that
specified in the question i.e. a 6-bit mantissa
and a 4-bit exponent.
Answer 101011 0010
(1 per - , max 3)
A B C Q
Total 9
0 0 0 1
4
a A queue 1(AO1.1)
1 0 0 1 1
Examiner’s Comments
0 1 0 1
– D at top of stack with A directly below it Most candidates achieved both marks on this
0 1 1 1 question. The presentation of some responses
– X,Y,Z directly below A (with no other 4
3
2
(AO2.2)
made it difficult to determine if the candidate
1 0 0 1 was offering a zero or a one. Centres should
entries) encourage candidates to rewrite their response if
Allow new drawing or amendment of original.
1 0 1 1 they have overwritten a zero with a one and vice
2 versa.
b Examiner’s Comments
(AO2.2) 1 1 0 0
This part question was generally well answered.
1 1 1 1

(1 per - , max 2) First 4 rows correct 1 mark


Last 4 rows correct 1 mark
Examiner’s Comments
Total 2
– pop() In most cases candidates used the operations
given in the stem of the question correctly.
c – pop() 3(AO3.1)
Some candidates did not achieve full marks for
incorrect use of the pop () operation. They
– push("A") incorrectly passed a parameter to specify the
item to pop. Candidates should be reminded
that a stack data structure can only pop items
(1 per - , max 3)
from the top therefore no parameter is required.

– 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

– A data structure/holds multiple pieces of


Examiner’s Comments
data…
4
– Has a single identifier 2
It was clear that some candidates were unsure
about the difference between an array and a list.
2 – Elements are accessed by an index (AO1.2) Centres must make sure that all aspects of the
specification are fully addressed regardless of
– Holds data of the same data type the programming language used as the vehicle
for delivery of algorithms.
– Elements are stored contiguously in
computer memory

You might also like