Cambridge International AS & A Level: Computer Science 9608/31
Cambridge International AS & A Level: Computer Science 9608/31
Cambridge International AS & A Level: Computer Science 9608/31
* 6 1 9 5 6 0 3 6 9 4 *
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LO) 214518
© UCLES 2021 [Turn over
2
1 In a particular computer system, two real numbers, A and B, are stored using floating-point
representation with:
1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
(a) (i) Identify whether each number is positive or negative. Justify your answer.
Number A .........................................................................................................................
...........................................................................................................................................
Number B .........................................................................................................................
...........................................................................................................................................
[2]
(ii) Convert the binary values of the mantissa and the exponent for each number to their
separate denary values.
A mantissa ........................................................................................................................
...........................................................................................................................................
A exponent ........................................................................................................................
...........................................................................................................................................
B mantissa ........................................................................................................................
...........................................................................................................................................
B exponent ........................................................................................................................
...........................................................................................................................................
[4]
(iii) Calculate the denary value of each floating-point number using your values from
part (a)(ii).
Number A .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Number B .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) State which number, A or B, is stored in normalised floating-point form. Justify your answer.
Number .....................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
2 The TCP/IP protocol suite can be viewed as a stack with four layers.
(a) Write the correct descriptions for the two layers and the correct layers for the two descriptions
given in the following table.
Layer Description
Application
Internet /
Network
[4]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify and describe one other communication protocol. State its purpose.
Protocol .............................................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
Purpose .............................................................................................................................
...........................................................................................................................................
[3]
3 Describe, with the aid of a diagram for each one, the bus and star network topologies.
Bus
Description .......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Star
Description .......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[6]
4 (a) The truth table for a logic circuit with four inputs is shown.
INPUT OUTPUT
P Q R S X
0 0 0 0 1
0 0 0 1 0
0 0 1 0 1
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 1
(i) Write the Boolean expression for the truth table as a sum-of-products.
X = .............................................................................................................................. [2]
(ii) Complete the Karnaugh Map (K-map) for the truth table.
PQ
00 01 11 10
00
01
RS
11
10
[2]
(iii) The K-map can be used to simplify the expression in part (a)(i).
Draw loops around appropriate groups of 1s in the table in part (a)(ii) to produce an
optimal sum-of-products. [2]
(iv) Write the simplified sum-of-products expression for your answer to part (a)(iii).
X = ............................................................................................................................... [2]
(b) Simplify your expression for X in part (a)(i) using Boolean algebra. Show your working.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
5 The following syntax diagrams for a programming language show the syntax of:
• an assignment statement
• a variable
• an unsigned integer
• a digit
• a letter
• an operator
assignment statement
unsigned
integer
variable
letter letter
unsigned integer
digit digit
Y – 2
Z * 3
X = XY + 21
...................................................................................................................................................
YZ := YZ * 3
...................................................................................................................................................
XY = XY − 5
...................................................................................................................................................
[3]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.
<assignment_statement> ::=
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
<digit> ::=
...................................................................................................................................................
<unsigned_integer> ::=
...................................................................................................................................................
<operator> ::=
...................................................................................................................................................
[5]
(c) The syntax of a variable is changed to allow one or two letters followed by zero, one or two
digits.
[3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
6 Encryption is used to provide security when messages are transferred over a communication link.
(a) (i) Explain the way in which asymmetric key cryptography is used to encrypt a message
being sent from one computer user to another over the Internet.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.................................................................................................................................... [4]
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
[2]
(b) (i) Explain the way in which Transport Layer Security (TLS) provides communication
security over a computer network.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(ii) State two situations where the use of TLS would be appropriate.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
[2]
7 Four shipping containers are used to store goods on the dockside at a port. The temperature
inside each container should be kept between 5 and 8 degrees Celsius inclusive.
Each container has a temperature sensor.
(a) (i) State the name given to the type of system described.
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(b) The computer system stores the temperature readings for the four sensors in two’s
complement form and in four eight-bit memory locations with addresses 301 to 304.
301 0 0 0 0 1 0 0 1 Container 1
302 0 0 0 0 0 1 1 1 Container 2
303 0 0 0 0 0 1 1 0 Container 3
304 1 1 1 1 1 1 1 0 Container 4
State the container number(s) where the temperature is out of range and give the value(s) of
these temperature(s) in denary.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) The status of the heaters and the air conditioning units is shown at location 300.
A value of 1 means that the device is on and a value of 0 (zero) means that the device is off.
The status of the heaters is shown in the most significant four bits; the status of the air
conditioning units is shown in the least significant four bits.
The pattern of bits at location 300 shows that the heater for container 4 is on and the air
conditioning unit for container 1 is on.
Container number
1 2 3 4 1 2 3 4
300 0 0 0 1 1 0 0 0
Heater Air conditioning
Show the pattern of bits when the heater is on for containers 1 and 2 and no air conditioning
units are on.
300
[1]
(d) The following table shows assembly language instructions for the container computer system
that has one general purpose register, the Accumulator (ACC).
Instruction
Explanation
Label Op code Operand
LDM &n Load the hexadecimal number n to ACC
Load the contents of the location at the given
LDD <address>
address to ACC
Store the contents of ACC at the given
STO <address>
address
Bitwise AND operation of the contents of ACC
AND &n
with the hexadecimal number n
Bits in ACC are shifted denary number n
LSL #n places to the left. Zeros are introduced at the
right hand end
Compare the contents of ACC with the
CMP &n
hexadecimal number n
Following a compare instruction, jump to
JPE <address>
<address> or <label> if the compare was True
<label>: <op code> <operand> Labels an instruction
If the bit for a container’s heater and the bit for the same container’s air conditioning unit are
both set to 1, a routine at label ERROR is executed. This routine has not been provided.
(i) These assembly language instructions check for an error in the container 1 system.
LDD 300
AND &88
CMP &88
JPE ERROR
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(ii) Write the assembly language instructions to check for an error in the container 4 system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.