System Software
System Software
The output of the lexical analysis stage forms the input to the next stage.
...................................................................................................................................... [1]
1 .........................................................................................................................................
...........................................................................................................................................
2 .........................................................................................................................................
...........................................................................................................................................
[2]
There are a number of reasons for performing optimisation. One reason is to produce code
that minimises the amount of memory used.
.............................................................................................................................................. [1]
A B + 2 * 6
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [1]
X A + B
Y A + B + C
Following the syntax analysis stage, object code is generated. The equivalent code, in
assembly language, is shown below:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
8 The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC).
Instruction
Explanation
Opcode Operand
LDM #n Load the denary number n to ACC
LDD <address> Load the contents of the location at the given address to ACC
STO <address> Store the contents of ACC at the given address
ADD <address> Add the contents of the given address to the ACC
INC <register> Add 1 to the contents of the register
CMP <address> Compare the contents of ACC with the contents of <address>
JPN <address> Following a compare instruction, jump to <address> if the
compare was False
END Return control to the operating system
LDM ...........................................................................................................................................
...................................................................................................................................................
LDD ............................................................................................................................................
...................................................................................................................................................
[2]
(b) Using opcodes from the table, write instructions to set the value at address 509 to the contents
of address 500 added to the value 12.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
4 The following syntax diagrams for a particular programming language show the syntax of:
• a digit
• a capital letter
• a character.
1 E
2 I
3 O
4 U
5 character
$
6
%
7
&
8
*
9
#
(a) Write the Backus-Naur Form (BNF) notation of the syntax diagram for character.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A password must begin with a character and be followed by one or more digits or capital
letters.
..................................................................................................................................... [1]
password
character digit
capital letter
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.
OS term Description
Interrupt handling
Scheduling
Transferring control to another routine when
a service is required
Virtual memory
Reading/writing same-size blocks of data
from/to secondary storage when required
[5]
(b) Explain how an interpreter executes a program without producing a complete translated
version of it.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
4 (a) (i) Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of
expressions.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify, with reasons, a data structure that could be used to evaluate an expression
in RPN.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(a – b) * (a + c) / 7
...................................................................................................................................................
............................................................................................................................................. [1]
a b / 4 * a b + -
...................................................................................................................................................
............................................................................................................................................. [1]
a b + c d / /
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(d) The zoo decides that the computer system needs to be updated. The computer system will
now make use of actuators. These actuators will operate devices which adjust the
microclimate.
The actuators to control the climate in Tank 4 use memory location 0804. Bit 5 of this
memory location controls the heater.
7 6 5 4 3 2 1 0 bit number
0 0 1 1 0 1 0 1 value
Use some of the assembly language instructions to write the instructions that will ensure bit 5
of location 0804 is set to 1.
Instruction
Explanation
Op Code Operand
AND <address> Bitwise AND operation of the contents of ACC with the
contents of <address>
Describe two different strategies which could be used to manage the available main
memory.
[6]
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
...................................................................................................................................................
...................................................................................................................................................
[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]
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]
6 The syntax diagrams for a programming language show the syntax of:
• an assignment statement
• a variable
• an unsigned integer
• a letter
• an operator
• a digit
assignment statement
variable
letter digit
unsigned integer
digit digit
X + 1
Y – 2
Z * 3
X1 = Y - 21
...................................................................................................................................................
Y3 := Y3 + 1
...................................................................................................................................................
X1 = X2 * 7
...................................................................................................................................................
[3]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.
<letter> has been completed for you.
<assignment_statement> ::=
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
<unsigned_integer> ::=
...................................................................................................................................................
<operator> ::=
...................................................................................................................................................
<digit> ::=
...................................................................................................................................................
[5]
(c) The syntax of an assignment statement is changed to allow for a variable or an unsigned
integer before and after the operator.
[2]
(ii) Give the BNF for the revised assignment statement syntax.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
8 Four greenhouses are used to grow tomatoes. The temperature inside each greenhouse should
be kept between 10 and 20 degrees Celsius inclusive.
Each greenhouse 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 701 to 704.
701 0 0 0 0 1 0 1 0 Greenhouse 1
702 0 0 0 1 0 1 1 1 Greenhouse 2
703 0 0 0 0 1 1 1 0 Greenhouse 3
704 1 1 1 1 1 1 1 1 Greenhouse 4
State the greenhouse 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 ventilation is shown at location 700.
The status of the heaters is shown in the most significant four bits; the status of the ventilation
is shown in the least significant four bits.
The pattern of bits at location 700 shows that the heater for greenhouse 3 is on and the
ventilation for greenhouse 1 is open.
Greenhouse number
1 2 3 4 1 2 3 4
700 0 0 1 0 1 0 0 0
Heater Ventilation
Show the pattern of bits when the heater is on for greenhouses 1 and 2 only and no ventilation
is open.
700
[1]
(d) The table shows assembly language instructions for the greenhouse 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
If the bit for a greenhouse’s heater and the bit for the same greenhouse’s ventilation 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 greenhouse 1 system.
LDD 700
AND &88
CMP &88
JPE ERROR
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(ii) Write the assembly language instructions to check for an error in the greenhouse 2
system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(d) Identify the common logic circuit given by the truth table in part (a). Give the use of each
output.
Use of X ....................................................................................................................................
Use of Y ....................................................................................................................................
[3]
6 Anita is studying computer science and she is confused about some of the computer security
terminology as some of the words are similar.
Anita wants to know the similarities (features that are the same) and differences (features that are
different) between some of the terms.
(a) Give the similarities and differences between a public key and a private key.
Similarities ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Differences ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
7 A company has a number of lorries that deliver items around the country. The items in each lorry
are its load. Each lorry has a monitoring system that provides information to the driver about the
state of the load and other data from each trip.
801 0 1 1 0 1 1 0 0
802 0 0 1 0 1 0 0 1
803 0 0 1 0 0 0 0 0
State the information that the current contents of addresses 801 to 803 will provide to the
driver.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) A lorry has a load that is too heavy and is not secured. It has travelled 120 kilometres and
used 35.25 litres of fuel.
801
802
803
[3]
(c) The following table shows the instructions for the lorry load monitoring system in assembly
language. There is one general purpose register, the Accumulator (ACC).
Table 7.1
Instruction
Explanation
Label Op code Operand
LDM #n Load the number n to ACC
Load the contents of the location at the
LDD <address>
given address to ACC
Store the contents of ACC at the given
STO <address>
address
Bitwise AND operation of the contents of
AND #n
ACC with the operand
CMP #n Compare the contents of ACC with number n
Following a compare instruction, jump to
JPE <address> <address> or <label> if the compare was
True
JMP <address> Jump to the given address or label
(i) Write assembly language instructions to set the contents of addresses 801 and 802 to
zero, and set all four most significant bits of the contents of address 803 to one.
Use the instruction set from Table 7.1.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) A program written in assembly language, continuously checks the flags. If a flag is set,
the program jumps to the error-handling routine at the specified label. For example, if
the load is too heavy, the program jumps to the error-handling routine with the label
TOOHEAVY. The error-handling routine instructions have not been provided.
A programmer has written most of the instructions for the program in the following table.
There are four missing operands.
Complete the assembly language program by writing the four missing operands.
AND &F0
STO TEMP
AND &80
CMP &80
JPE TOOHEAVY
LDD TEMP
AND &40
CMP
JPE TOOHIGH
LDD TEMP
AND
CMP &20
JPE UNSTABLE
LDD
AND &10
CMP &10
JPE NOTSECURED
JMP
TEMP:
[4]
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.
6 Mahmoud is developing a new application, MyApp, that needs to work with three different
operating systems (OS1, OS2 and OS3).
He has decided to use virtual machine software to test MyApp with these three different operating
systems.
OS4
Hardware
(a) Describe the roles of the four operating systems (OS1, OS2, OS3 and OS4) shown in the
diagram.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) Describe the role of the virtual machine software in the testing of MyApp.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© UCLES 2020 9608/32/O/N/20
9
(c) Explain one benefit and one drawback of this approach to testing MyApp.
Benefit ......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Drawback ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
8 A car monitoring system provides information to the driver about the car’s performance and alerts
the driver to possible problems.
• Data about the car’s performance is stored in three memory locations with addresses 601 to
603.
• Location 601 contains the distance travelled in kilometres for the current trip as a binary
integer.
• Location 602 contains the quantity of fuel used in litres for the current trip, as a fixed-point
binary number with 5 places before the binary point and three places after the binary point.
• The four least significant bits of location 603 are flags used to identify problems with the car,
for example, the fuel is low. A flag is set to 1 if there is a problem, or 0 if not. These problems
are:
601 0 0 1 0 1 1 0 0
602 0 0 1 0 1 0 0 1
603 0 0 0 0 0 1 0 0
State the information that the current contents of addresses 601 to 603 will provide to the
driver.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) A car has low oil pressure and low fuel. It has travelled 80 kilometres and used 7.25 litres of
fuel.
601
602
603
[3]
(c) The following table shows the assembly language instructions for the car performance
monitoring system. There is one general purpose register, the Accumulator (ACC).
Table 8.1
Instruction
Explanation
Label Op code Operand
Note:
(i) Write assembly language instructions to set the contents of addresses 601 and 602 to
zero, and set all four least significant bits of the contents of address 603 to one.
Use the instruction set from Table 8.1.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) A program continuously checks the flags. If a flag is set, the program moves to the
error-handling routine at the specified label. For example, if the engine temperature
is high, the program jumps to the label for the error-handling routine HIGHTEMP. The
error-handling routine instructions have not been provided.
A programmer has written most of the instructions for the program in the following table.
There are four missing operands.
Complete the assembly language program by writing the four missing operands.
AND &0F
STO TEMP
AND &01
CMP &01
JPE HIGHTEMP
LDD TEMP
AND &02
CMP
JPE LOWOIL
LDD TEMP
AND
CMP &04
JPE LOWBATT
LDD
AND &08
CMP &08
JPE LOWFUEL
JMP
TEMP:
[4]
6 Duraid writes a short program in a high-level programming language. An interpreter executes the
program.
DECLARE P, Q, R, X, Y : INTEGER
CONSTANT M = 10
P = 4
Q = 2
R = 1
X = (P + Q) * (P – Q)
Y = (M / Q) * (P + Q - R)
(a) Write the Reverse Polish Notation (RPN) for the following expression from Duraid’s program.
(P + Q) * (P – Q)
............................................................................................................................................. [2]
(b) The interpreter is executing Duraid’s program. The expressions are in infix form.
(i) Show the changing contents of the stack, as the interpreter evaluates the expression
for Y.
Use the values of the variables and constant given in the program. The first entry has
been done for you.
10
[4]
(ii) Convert the following RPN expression back to its infix form.
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Identify the process state for each task. Give a reason why each task is in that process state.
Reason .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
Explain how this operating system uses interrupts to schedule the measuring and recording
tasks.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
9 A train cannot move if any of the eight automatic train doors are open. The train door monitoring
system, set out below, checks that all the doors are closed before the train can move.
• If a monitoring system detects that a door is open, it sets a specific bit in address 500 to 1.
• If the bit for door one is equal to 1, the binary value for hexadecimal FF is sent to address
501. The contents of address 501 are changed to make door 1’s light flash when the door is
open.
• If the bit for door two is equal to 1, the binary value for hexadecimal FF is sent to address
502. The contents of address 502 are changed to make door 2’s light flash when the door is
open.
This is repeated for each door from 3 to 8.
• Each door sets its bit in address 500 to zero when the door closes, and the contents of the
corresponding door address are set to zero.
• The train manager can identify which door is open from the flashing light.
Door number
1 2 3 4 5 6 7 8
Address 500 1 0 0 1 0 0 1 0
(a) Complete the following table by writing the values stored in addresses 503 to 508. Use the
contents of address 500 shown above. Note that addresses 501 and 502 are complete.
501 1 1 1 1 1 1 1 1 Door 1
502 0 0 0 0 0 0 0 0 Door 2
503 Door 3
504 Door 4
505 Door 5
506 Door 6
507 Door 7
508 Door 8
[2]
(b) The following table shows assembly language instructions for the processor controlling the
train door monitoring 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 address
LDD <address>
to ACC
STO <address> Store the contents of ACC at the given address
Bitwise AND the contents of ACC with the hexadecimal
AND &n
number n
Compare the contents of ACC with the hexadecimal
CMP &n
number n
Following a compare instruction, jump to <address> or
JPE <address>
<label> if the compare was True
<label>: <op code> <operand> Labels an instruction
Macro to wait one second before the next instruction is
WAIT
executed
(i) Complete the table by writing the values of the Accumulator (ACC) and the contents of
address 501 as these instructions are executed once to check door 1.
Instruction
ACC 501
Label Op code Operand
CHECK1: LDD 500
AND &80
CMP &00
JPE DOOR1
LDM &FF
WAIT
LDM &00
STO 501
WAIT
JMP CHECK1
[4]
Instruction
[4]
(c) Explain how the check door routines show a flashing light or no light.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
2 The following syntax diagrams for a programming language show the syntax of:
• a condition
• a variable
• a number
• a letter
• a digit
• an operator
condition
variable operator number
variable
variable
letter
number
digit digit
letter
a
digit operator
1 ==
2 >
3 <
(i) 35 > 24
Reason ..............................................................................................................................
..................................................................................................................................... [1]
Reason ..............................................................................................................................
..................................................................................................................................... [1]
(iii) bc < 49
Reason ..............................................................................................................................
..................................................................................................................................... [1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagram.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
6 (a) An operating system (OS) uses a memory management technique called paging.
Page .........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...................................................................................................................................................
............................................................................................................................................. [1]
(d) For a computer system using multi-programming, the low-level scheduler decides which
process will get next use of the processor.
One algorithm could be a round-robin, which means every process gets use of the processor
in sequence for a fixed amount of time (time-slice).
For a round-robin algorithm, five processes are currently loaded and get the use of the
processor in the sequence:
The following paragraph describes what happens next. Complete the paragraph by inserting
the missing processes.
Interrupt received from the low-level scheduler. Save all register contents for
................................................ .
9 (a) The following incomplete table shows descriptions relating to computer architectures.
Description Term
• There are several processors.
A • Each processor executes different sets of instructions .........................................
on one set of data at the same time.
• The processor has several ALUs.
B • Each ALU executes the same set of instructions on .........................................
different sets of data at the same time.
• There is only one processor.
C • The processor executes one set of instructions on one .........................................
set of data.
• There are several processors.
D • Each processor executes a different set of instructions. .........................................
• Each processor operates on different sets of data.
[4]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(a) Describe the difference between a monitoring system and a control system.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) (i) The weather station records how the outside temperature changes over a period of time.
The system will read the temperature once every hour, over a period of 100 days.
The temperature readings are automatically stored in a file. No other data are stored.
Explain why the weather station has decided to use serial organisation for the file.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
Explain how sequential access could be used for the temperature readings file.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(iii) Name and describe a method of file organisation other than serial or sequential.
Method ..............................................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[4]
© UCLES 2019 9608/32/O/N/19
10
(c) The following table shows assembly language instructions for a processor which has one
general purpose register, the Accumulator (ACC).
Instruction
Explanation
Op code Operand
Direct addressing. Load the contents of the location at the given
LDD <address>
address to ACC
ADD <address> Add the contents of the given address to the ACC
STO <address> Store the contents of ACC at the given address
After the syntax analysis is completed successfully, the compiler generates object code.
X = X + Y
Z = Z + X
LDD 236
ADD 237
STO 236
LDD 238
ADD 236
STO 238
(i) The final stage in the compilation process that follows this code generation stage is code
optimisation.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(c) Give one example of a monitoring system. Explain why this is a monitoring system.
...................................................................................................................................................
Explanation ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
4 (a) Describe the main steps in the evaluation of a Reverse Polish Notation (RPN) expression
using a stack.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
8 5 2 – * 30 2 3 * / –
Show the changing contents of the stack as this RPN expression is evaluated.
[4]
6 A company sells plant watering systems that automatically turn on water sprinklers when the soil
becomes too dry.
Identify two other hardware devices that are required in this system. State the purpose of each
device.
Device 1 ...........................................................................................................................................
Purpose ............................................................................................................................................
..........................................................................................................................................................
Device 2 ...........................................................................................................................................
Purpose ............................................................................................................................................
..........................................................................................................................................................
[4]
State 1 ......................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
State 2 ......................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Disk ...........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
(a) Explain how the processes are affected when the following events take place.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(b) (i) State the conditions that are necessary for a process to move from the ready to the
running state.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(ii) State the conditions that are necessary for a process to move from the blocked to the
ready state.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
After the syntax analysis stage is complete, the compiler generates object code.
X A + B
Y A + B + C
Z A + B + C + D
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
4 A compiler uses a keyword table and a symbol table. Part of the keyword table is shown.
Keyword Token
01
+ 02
= 03
IF 4A
THEN 4B
ENDIF 4C
ELSE 4D
FOR 4E
STEP 4F
TO 50
INPUT 51
OUTPUT 52
ENDFOR 53
Entries in the symbol table are allocated tokens. These values start from 60 (hexadecimal).
INPUT Number1
INPUT Number2
INPUT Answer
IF Answer = Number1 + Number2
THEN
OUTPUT 10
ELSE
OUTPUT 0
ENDIF
(a) Complete the symbol table to show its contents after the lexical analysis stage.
Token
Symbol
Value Type
Number1 60 Variable
Number2 61 Variable
[3]
© UCLES 2018 9608/32/O/N/18
9
(b) The output from the lexical analysis stage is stored in the following table. Each cell stores one
byte of the output.
Complete the output from the lexical analysis. Use the keyword table and your answer to
part (a).
51 60
[2]
After the syntax analysis is complete, the compiler generates object code.
(i) Identify the final stage in the compilation process that follows this code generation stage.
.......................................................................................................................................[1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Put a tick ( ) in each row to identify the computer architecture associated with each statement.
Architecture
Statement
SIMD MIMD SISD
6 (a) The following table shows descriptions and terms relating to data transmission security.
Description Term
The result of encryption that is transmitted to the
A
recipient. .................................
The type of cryptography used where different keys are
B
used; one for encryption and one for decryption. .................................
.........................................................................................
.........................................................................................
C Digital certificate
.........................................................................................
.........................................................................................
.........................................................................................
.........................................................................................
D Private key
.........................................................................................
.........................................................................................
[4]
(iii) State two benefits of the process that is carried out in the final stage.
Benefit 1 ............................................................................................................................
...........................................................................................................................................
Benefit 2 ............................................................................................................................
...........................................................................................................................................
[2]
(d) An interpreter is executing a program. The program uses the variables a, b, c and d.
The program contains an expression that is written in infix form. The interpreter converts the
infix expression to RPN.
Show the changing contents of the stack as the interpreter evaluates the expression.
The first entry on the stack has been done for you.
2
[4]
5 (a) Most desktop or laptop computers use CISC (Complex Instruction Set Computing)
architecture. Most smartphones and tablets use RISC (Reduced Instruction Set Computing).
State four features that are different for the CISC and RISC architectures.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
4 ................................................................................................................................................
...................................................................................................................................................
[4]
• an assignment statement
• a variable
• a signed integer
• a letter
• a digit
• an operator
assignment statement
variable = variable operator signed integer
variable
letter letter
signed integer
+ digit
letter x
digit operator
1
2 \
(i) xy = xy ^ c4
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(ii) zy = zy \ 10
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(iii)
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams on the opposite page.
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
...................................................................................................................................................
<operator> ::=
...................................................................................................................................................
[4]
(c) Rewrite the BNF rule for a variable so that it can be any number of letters.
<variable> ::=
...............................................................................................................................................[2]
The museum is not sure about the actual temperatures. The museum installs some equipment.
This records the temperatures every hour and ensures the temperature stays within a set range.
...............................................................................................................................................[1]
Identify two other items of hardware that the museum can use for the type of system identified.
Item 1 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
[4]
(c) The equipment records the temperature in all seven rooms in the museum.
Each recording is stored as two successive bytes in memory. The format is as shown.
Temperature Room
7 6 5 4 3 2 1 0
Byte 1 Byte 2
The room is indicated by the setting of one of the bits in Byte 2 to 1. For example, room 7 is
indicated by setting bit 7 to 1.
•
•
Temperature Room
7 6 5 4 3 2 1 0
1 0 1 1 0 0 1 1 0 0 1 0 0 0 0 1
Byte 1 Byte 2
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(ii) The system receives a temperature reading of 238 from room number 4.
Complete the bytes to show the two bytes for this recording. The reading has not yet
been processed.
7 6 5 4 3 2 1 0
Byte 1 Byte 2
[2]
• an assignment statement
• a variable
• an unsigned integer
• a letter
• a digit
• an operator
assignment statement
variable = variable operator variable ;
variable
letter unsigned integer
unsigned integer
digit
letter A
digit operator
1 +
2 -
3 *
4 /
(i) A = B + 5;
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(ii)
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(iii)
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown on the opposite page.
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
...................................................................................................................................................
<operator> ::=
...................................................................................................................................................
[6]
6 (a) There are five scenarios on the left and two types of system on the right.
Scenario System
Aeroplane autopilot
Control
Rollercoaster
Monitoring
[2]
(b) Mary has six fish tanks. The temperature of the water in each tank needs to be within a
specific range.
Identify three items of hardware that Mary can add to her tanks to help maintain the
temperature. Describe the purpose of each item.
Item 1 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
Item 3 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
[6]
© UCLES 2018 9608/32/M/J/18
11
(c) A temperature reading is taken from each tank once per minute. The temperature reading is
stored as two successive bytes. The format is shown:
7 6 5 4 3 2 1 0
Byte 1 Byte 2
The fish tank number is indicated by setting one of the bits in Byte 1 to 1. For example, fish
tank number 5 is indicated by setting bit 5 to 1.
•
•
Byte 2
(i) After a temperature reading has been taken, the bytes contain the following data.
7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1
Byte 1 Byte 2
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(ii)
Complete the bytes to show the values for this reading after it has been processed.
7 6 5 4 3 2 1 0
Byte 1 Byte 2
[2]
(d) A hardware device to affect the temperature of each tank is on or off depending on the value
of a bit in memory location 6753.
Write assembly language instructions to set bit 4 of memory location 6753 to 1 without
changing any other bits. Use the instruction set provided.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
Instruction set
Instruction Explanation
Op code Operand
LDD <address> Direct addressing. Load the contents of the location at the given
address to ACC.
STO <address> Store the contents of ACC at the given address.
AND #n Bitwise AND operation of the contents of ACC with the operand.
AND <address> Bitwise AND operation of the contents of ACC with the contents
of <address>.
XOR #n Bitwise XOR operation of the contents of ACC with the operand.
OR #n Bitwise OR operation of the contents of ACC with the operand.
OR <address> Bitwise OR operation of the contents of ACC with the contents
of <address>.
<address> can be an absolute address or a symbolic address.
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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
3 The following syntax diagrams for a particular programming language show the syntax of:
an assignment statement
a variable
an unsigned integer
a letter
an operator
a digit.
Assignment statement
Unsigned
Variable := Variable Operator
integer
Variable
Digit
Letter Digit
1
Unsigned integer
2
Digit
4
Letter Operator
5
A +
B – 6
C * 7
^ 8
(i) C2 = C3 + 123
Reason: .............................................................................................................................
...................................................................................................................................... [1]
(ii) A3 := B1 – B2
Reason: .............................................................................................................................
...................................................................................................................................... [1]
(iii) A32 := A2 * 7
Reason: .............................................................................................................................
...................................................................................................................................... [1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.
<assignment_statement> ::=
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
<unsigned_integer> ::=
...................................................................................................................................................
<digit> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
<letter> ::=
...................................................................................................................................................
<operator> ::=
...................................................................................................................................................
[6]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [2]
6 A large warehouse stores goods that must be kept above a temperature of 15 degrees Celsius.
The warehouse has six temperature sensors which are each placed at a different location in the
warehouse.
A computer system is programmed to turn on appropriate heaters when one of the sensors is
below the minimum temperature.
(a) (i) State the name given to the type of system described.
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [1]
(b) Sensors and heaters are two types of device used in this system.
State two other devices that are used. Justify your choice.
Device 1 ....................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
Device 2 ....................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
[4]
(c) The computer system stores the temperature readings for the six sensors in six 8-bit memory
locations.
Six of the bits in an 8-bit register, LOWREG, are used to indicate whether a particular reading
is below the minimum temperature. A value of 1 means the reading is below the minimum
temperature.
For example:
This pattern of bits in LOWREG shows that sensor 5, sensor 4 and sensor 1 have readings
below the minimum temperature.
6 5 4 3 2 1
Not used Not used 0 1 1 0 0 1
The following table shows part of the instruction set for a processor which has one general
purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Op code Operand
Direct addressing. Load the contents of the given address to
LDD <address>
ACC.
LDR #n Immediate addressing. Load the number n to IX.
Indexed addressing. Form the address from <address> +
LDX <address> the contents of the index register. Copy the contents of this
calculated address to ACC.
STO <address> Store the contents of ACC at the given address.
INC <register> Add 1 to the contents of the register (ACC or IX).
ADD <address> Add the contents of the given address to the ACC.
Bitwise OR operation of the contents of ACC with the contents
OR <address>
of address.
CMP #n Compare the contents of ACC with number n.
CMP <address> Compare the contents of ACC with the contents of <address>.
JMP <address> Jump to the given address.
Following a compare instruction, jump to <address> if the
JPE <address>
compare was True.
Following a compare instruction, jump to <address> if the
JGE <address> content of ACC is greater than or equal to the number used in
the compare instruction.
LOWTEMP: 15
LOWREG: B00000000
COUNTER: 1
START: LDR #0
CMP LOWTEMP
JGE TEMPOK
LDD LOWREG
OR COUNTER
STO LOWREG
JPE HEATON
ADD COUNTER
STO COUNTER
INC IX
JMP LOOP
(i) The code uses six memory locations to store the temperature readings. It stores readings
for sensors 1 to 6 at addresses 8000 to 8005.
Dry run the assembly language code starting at START and finishing when the loop has been
processed twice.
15 B00000000 1
[4]
(ii) Explain why the operand of the instruction labelled Q1 has the value 32.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
(iii) The code beginning at the instruction labelled HEATON must make the system turn on
the heaters in those areas that are below the minimum temperature.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [3]
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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
3 (a) This diagram shows how applications P, Q and a software development environment can be
run on a virtual machine system.
Software
Application P Application Q development
environment
.......A......operating
.......A......operating system 1
system 2
.......B......operating system
Hardware
A ........................................................................................................................................
B ........................................................................................................................................
[2]
Describe what happens after .......A......operating system 1 has received the data request
from the application.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
...........................................................................................................................................
.......................................................................................................................................[1]
Limitation 1 ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Limitation 2 ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[4]
4 The following syntax diagrams for a particular programming language show the syntax of:
• an unsigned number
• an unsigned integer
• a digit.
Unsigned number
Digit
Unsigned Unsigned
. 1
integer integer
3
Unsigned integer
4
Digit
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[5]
The format of an unsigned number is amended to include numbers with possible exponents.
•
•
• and be completed by an unsigned integer.
32, 3.45E 2
(c) (i) Redraw the syntax diagram for unsigned number to include numbers that might have
exponents.
[4]
(ii) Use your syntax diagram from part (c)(i) to write the BNF for an unsigned number to
include numbers with exponents.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[4]
6 The environment in a very large greenhouse is managed by a computer system. The system uses
a number of different sensors that include temperature sensors. In addition, the system controls a
number of heaters, windows and sprinklers.
(a) State one other type of sensor that could be used with this system.
Sensor ......................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(c) (i) The system makes use of a number of parameters. These parameters are used in the
code that runs the system.
State one of the parameters used in controlling the temperature in the greenhouse.
.......................................................................................................................................[1]
(ii) Explain how the parameter identified in part (c)(i) is used in the feedback process.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(d) There are eight temperature sensors numbered 1 to 8. Readings from these sensors are
stored in four 16-bit memory locations. The memory locations have addresses from 4000 to
4003. Each memory location stores two sensor readings as two unsigned binary integers.
Sensor 1 reading is stored in bits 8 to 15 of address 4000; Sensor 2 reading is stored in bits
0 to 7 of address 4000 and so on. The diagram shows that the current sensor 1 reading has
a value of 97.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
4000 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 1
4001 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0
4002 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1
4003 1 0 0 0 0 0 1 0 1 1 0 0 0 1 0 1
(i) Give the denary value of the current reading for Sensor 5.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) The following table shows part of the instruction set for a processor. The processor has
one general purpose register, the Accumulator (ACC).
Instruction
Explanation
Op code Operand
LDD <address> Direct addressing. Load the contents of the location at the given
address to ACC.
AND #n Bitwise AND operation of the contents of ACC with the operand.
AND <address> Bitwise AND operation of the contents of ACC with the contents of
<address>.
XOR #n Bitwise XOR operation of the contents of ACC with the operand.
XOR <address> Bitwise XOR operation of the contents of ACC with the contents of
<address>.
OR #n Bitwise OR operation of the contents of ACC with the operand.
OR <address> Bitwise OR operation of the contents of ACC with the contents of
<address>.
The reading for Sensor 5 is used in a calculation. The calculation is carried out by two
assembly language instructions.
The first instruction loads the contents of the 16-bit location that contains the value for
Sensor 5.
The second instruction moves the bits in Sensor 5 so that the 16-bit value is the value of
Sensor 5.
Complete the two instructions in the following code. Use the instruction set provided.
2 There are four stages in the compilation of a program written in a high-level language.
(a) Four statements and four compilation stages are shown below.
[4]
(b) Write the Reverse Polish Notation (RPN) for the following expressions.
(i) (A + B) * (C D)
...................................................................................................................................... [2]
(ii) A / B * 4 / (C D)
...................................................................................................................................... [3]
(c) An interpreter is executing a program. The program uses the variables w, x, y and z.
The program contains an expression written in infix form. The interpreter converts the infix
expression to RPN. The RPN expression is:
x w z + y *
w = 1 x = 2 y = 3 z = 4
(i) Show the changing contents of the stack as the interpreter evaluates the expression.
The first entry on the stack has been done for you.
[4]
(ii) Convert back to its original infix form, the RPN expression:
x w z + y *
...........................................................................................................................................
...................................................................................................................................... [2]
(iii) Explain one advantage of using RPN for the evaluation of an expression.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
In paging:
135 0 0
When a particular page of the process is currently in main memory, the Presence flag entry in the
page table is set to 1.
If the page is not currently present in memory, the Presence flag is set to 0.
.............................................................................................................................................. [1]
(b) Process X executes until the next instruction is the first instruction in Page 4. Page 4 is not
currently in main memory.
.............................................................................................................................................. [1]
2 There are four stages in the compilation of a program written in a high-level language.
(a) Four statements and four compilation stages are shown below.
[4]
(b) Write the Reverse Polish Notation (RPN) for the following expression.
P + Q – R / S
.............................................................................................................................................. [2]
(c) When an instruction to be accessed is not present in main memory, its page must be loaded
into a page frame. If all page frames are currently in use, the contents of a page frame will be
overwritten with this new page.
One possible algorithm is to replace the page that has been resident in main memory for the
longest time.
(i) Give the additional data that would need to be stored in the page table.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Complete the table entries below to show what happens when Page 4 is swapped into
main memory. Assume that Page 5 is the one to be replaced.
In the final column, give an example of the data you have identified in part (c)(i).
4
............... .................... .....................................
[3]
An alternative algorithm is to replace the page that has been used least.
(iii) Give the different additional data that the page table would now need to store.
...........................................................................................................................................
...................................................................................................................................... [1]
(iv) In the following table, complete the missing data to show what happens when Page 3 is
swapped into main memory. Assume that Page 1 is the one to be replaced.
In the final column, give an example of the data you have identified in part (c)(iii).
3
............... .................... .....................................
[3]
© UCLES 2016 9608/33/O/N/16 [Turn over
8
(d) Explain why the algorithms given in part (c) may not be the best choice for efficient memory
management.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [4]
4 (a) (i) Complete the truth table for this logic circuit.
X Input Output
A X Y A B
Y 0 0
0 1
1 0
B 1 1
[2]
...................................................................................................................................... [1]
Label A ..............................................................................................................................
Label B ..............................................................................................................................
Explain why your answers are more appropriate for the A and B labels.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [4]
In paging:
249 0 0
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
.............................................................................................................................................. [2]
(b) Process Y executes the last instruction in Page 5. This instruction is not a branch instruction.
(i) Explain the problem that now arises in the continued execution of process Y.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
© UCLES 2016 9608/32/O/N/16
7
(ii) Explain how interrupts help to solve the problem that you explained in part (b)(i).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [3]
(c) When the next instruction is not present in main memory, the OS must load its page into a
page frame. If all page frames are currently in use, the OS overwrites the contents of a page
frame with the required page.
One possible algorithm is to replace the page which has been in memory the shortest amount
of time.
(i) Give the additional data that would need to be stored in the page table.
...........................................................................................................................................
...................................................................................................................................... [1]
(ii) Complete the table entry below to show what happens when Page 6 is swapped into
main memory. Include the data you have identified in part (c)(i) in the final column.
Assume that Page 1 is the one to be replaced.
In the final column, give an example of the data you have identified in part (c)(i).
[3]
(c) An interpreter is executing a program. The program uses the variables a, b, c and d.
The program contains an expression written in infix form. The interpreter converts the infix
expression to RPN. The RPN expression is:
b a * c d a + + -
a = 2 b = 2 c = 1 d = 3
(i) Show the changing contents of the stack as the interpreter evaluates the expression.
The first entry on the stack has been done for you.
2
[4]
(ii) Convert back to its original infix form, the RPN expression:
b a * c d a + + -
...........................................................................................................................................
...................................................................................................................................... [2]
(iii) One advantage of using RPN is that the evaluation of an expression does not require
rules of precedence.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
3 (a) The following diagram shows how applications X, Y and Z can run on a virtual machine
system.
Guest operating
Guest operating system 1
system 2
Hardware
Task 1 ................................................................................................................................
...........................................................................................................................................
Task 2 ................................................................................................................................
.......................................................................................................................................[2]
(ii) Explain the difference between a guest operating system and a host operating
system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(b) A company uses a computer as a web server. The manufacturer will no longer support the
computer’s operating system (OS) in six months’ time. The company will then need to decide
on a replacement OS.
The company is also considering changing the web server software when the OS is changed.
Whenever any changes are made, it is important that the web server service is not disrupted.
Use 1 .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Use 2 .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[4]
(ii) The company uses a virtual machine to test possible solutions to the changes that they
will need to make.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
6 An intruder detection system for a large house has four sensors. An 8-bit memory location stores
the output from each sensor in its own bit position.
(a) (i) State the name of the type of system to which intruder detection systems belong.
.......................................................................................................................................[1]
...........................................................................................................................................
.......................................................................................................................................[1]
(b) Name two sensors that could be used in this intruder detection system. Give a reason for
your choice.
Sensor 1 ...................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
Sensor 2 ...................................................................................................................................
Reason .....................................................................................................................................
...............................................................................................................................................[4]
The intruder system is set up so that the alarm will only sound if two or more sensors have been
triggered.
An assembly language program has been written to process the contents of the memory location.
The table shows part of the instruction set for the processor used.
Instruction
Explanation
Op code Operand
Direct addressing. Load the contents of the given address to
LDD <address>
ACC
STO <address> Store the contents of ACC at the given address
INC <register> Add 1 to the contents of the register (ACC or IX)
ADD <address> Add the contents of the given address to the contents of ACC
Bitwise AND operation of the contents of ACC with the
AND <address>
contents of <address>
CMP #n Compare the contents of ACC with the number n
JMP <address> Jump to the given address
Following a compare instruction, jump to <address> if the
JPE <address>
compare was True
Following a compare instruction, jump to <address> if the
JGT <address> content of ACC is greater than the number used in the
compare instruction
END End the program and return to the operating system
Op code Operand
SENSORS: B00001010
COUNT: 0
VALUE: 1
LOOP: LDD SENSORS
AND VALUE
CMP #0
JPE ZERO
LDD COUNT
INC ACC
STO COUNT
ZERO: LDD VALUE
CMP #8
JPE EXIT
ADD VALUE
STO VALUE
JMP LOOP
EXIT: LDD COUNT
TEST: CMP …
JGT ALARM
(i) Dry run the assembly language code. Start at LOOP and finish when EXIT is reached.
[4]
.......................................................................................................................................[1]
(iii) The intruder detection system is improved and now has eight sensors.
3 (a) The following diagram shows how applications X, Y and Z can run on a virtual machine
system.
Guest operating
Guest operating system 1
system 2
Hardware
Task 1 ................................................................................................................................
...........................................................................................................................................
Task 2 ................................................................................................................................
.......................................................................................................................................[2]
(ii) Explain the difference between a guest operating system and a host operating
system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(b) A company uses a computer as a web server. The manufacturer will no longer support the
computer’s operating system (OS) in six months’ time. The company will then need to decide
on a replacement OS.
The company is also considering changing the web server software when the OS is changed.
Whenever any changes are made, it is important that the web server service is not disrupted.
Use 1 .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Use 2 .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[4]
(ii) The company uses a virtual machine to test possible solutions to the changes that they
will need to make.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
6 An intruder detection system for a large house has four sensors. An 8-bit memory location stores
the output from each sensor in its own bit position.
(a) (i) State the name of the type of system to which intruder detection systems belong.
.......................................................................................................................................[1]
...........................................................................................................................................
.......................................................................................................................................[1]
(b) Name two sensors that could be used in this intruder detection system. Give a reason for
your choice.
Sensor 1 ...................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
Sensor 2 ...................................................................................................................................
Reason .....................................................................................................................................
...............................................................................................................................................[4]
Op code Operand
SENSORS: B00001010
COUNT: 0
VALUE: 1
LOOP: LDD SENSORS
AND VALUE
CMP #0
JPE ZERO
LDD COUNT
INC ACC
STO COUNT
ZERO: LDD VALUE
CMP #8
JPE EXIT
ADD VALUE
STO VALUE
JMP LOOP
EXIT: LDD COUNT
TEST: CMP …
JGT ALARM
(i) Dry run the assembly language code. Start at LOOP and finish when EXIT is reached.
[4]
.......................................................................................................................................[1]
(iii) The intruder detection system is improved and now has eight sensors.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(b) For each of the following, the process is moved from the first state to the second state.
Describe the conditions that cause each of the following changes of the state of a process:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[6]
(c) Explain why a process cannot be moved from the blocked state to the running state.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(d) Explain the role of the high-level scheduler in a multiprogramming operating system.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
2 In this question, you are shown pseudocode in place of a real high-level language. A compiler
uses a keyword table and a symbol table. Part of the keyword table is shown below.
Keyword Token
01
+ 02
= 03
IF 4A
THEN 4B
ENDIF 4C
ELSE 4D
FOR 4E
STEP 4F
TO 50
INPUT 51
OUTPUT 52
ENDFOR 53
Entries in the symbol table are allocated tokens. These values start from 60 (hexadecimal).
Start 0.1
// Output values in loop
FOR Counter Start TO 10
OUTPUT Counter + Start
ENDFOR
(a) Complete the symbol table below to show its contents after the lexical analysis stage.
Token
Symbol
Value Type
Start 60 Variable
0.1 61 Constant
[3]
© UCLES 2015 9608/32/O/N/15
5
(b) Each cell below represents one byte of the output from the lexical analysis stage.
Using the keyword table and your answer to part (a) complete the output from the lexical
analysis.
60 01
[2]
(c) The compilation process has a number of stages. The output of the lexical analysis stage
forms the input to the next stage.
.......................................................................................................................................[1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(d) The final stage of compilation is optimisation. There are a number of reasons for performing
optimisation. One reason is to produce code that minimises the amount of memory used.
.......................................................................................................................................[1]
A B + 2 * 6
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[1]
X A + B
Y A + B + C
Following the syntax analysis stage, object code is generated. The equivalent code, in
assembly language, is shown below:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
4 (a) Four descriptions and four types of computer architecture are shown below.
Draw a line to connect each description to the appropriate type of computer architecture.
[4]
(b) In a massively parallel computer explain what is meant by:
...........................................................................................................................................
.......................................................................................................................................[1]
...........................................................................................................................................
.......................................................................................................................................[1]
(c) There are both hardware and software issues that have to be considered for parallel
processing to succeed.
Hardware ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Software ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[4]
© UCLES 2015 9608/32/O/N/15
11
(a) For each of the following, the process is moved from the first state to the second state.
Describe the conditions that cause each of the following changes of state of a process:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[4]
(b) Explain why a process cannot move directly from the ready state to the blocked state.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(c) A process in the running state can change its state to something which is neither the ready
state nor the blocked state.
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(d) Explain the role of the low-level scheduler in a multiprogramming operating system.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
© UCLES 2015 9608/32/O/N/15
2
1 The following syntax diagrams, for a particular programming language, show the syntax of:
• an assignment statement
• a variable
• a number
• a letter
• a digit
• an operator
Assignment statement
Variable := Variable Operator Number
Variable
Letter Number
Number
Digit
Letter
A
Digit
1
Operator
+
2 A compiler uses a keyword table and a symbol table. Part of the keyword table is shown below.
Keyword Token
01
+ 02
= 03
IF 4A
THEN 4B
ENDIF 4C
ELSE 4D
FOR 4E
STEP 4F
TO 50
INPUT 51
OUTPUT 52
ENDFOR 53
Entries in the symbol table are allocated tokens. These values start from 60 (hexadecimal).
Counter 1.5
INPUT Num1
// Check values
IF Counter = Num1
THEN
Num1 Num1 + 5.0
ENDIF
(a) Complete the symbol table below to show its contents after the lexical analysis stage.
Token
Symbol
Value Type
Counter 60 Variable
1.5 61 Constant
[3]
© UCLES 2015 9608/33/O/N/15
5
(b) Each cell below represents one byte of the output from the lexical analysis stage.
Using the keyword table and your answer to part (a) complete the output from the lexical
analysis.
60 01
[2]
A B + C + D
After the syntax analysis stage, the compiler generates object code. The equivalent code, in
assembly language, is shown below:
(i) Name the final stage in the compilation process that follows this code generation stage.
.......................................................................................................................................[1]
(ii) Rewrite the equivalent code given above to show the effect of it being processed through
this final stage.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(iii) State two benefits of the compilation process performing this final stage.
Benefit 1 ............................................................................................................................
...........................................................................................................................................
Benefit 2 ............................................................................................................................
.......................................................................................................................................[2]
(i) A2 = B3 + 123
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(ii) B3 := B3 – 203
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(iii) A2414 := A3 * B
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown on the opposite page.
<assignmentstatement> ::=
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
<number> ::=
...................................................................................................................................................
<letter> ::= A | B | C
<digit> ::=
...................................................................................................................................................
<operator> ::=
...................................................................................................................................................
[6]
(c) A company develops software. It provides virtual machines for its software developers. The
company has a large number of clients who use a wide range of hardware and software.
(i) Explain the term virtual machine. Ensure that your answer includes the terms hardware
and software.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
...........................................................................................................................................
.......................................................................................................................................[1]
...........................................................................................................................................
.......................................................................................................................................[1]
6 A company grows vegetables in a number of large greenhouses. For the vegetables to grow well,
the temperature, light level and soil moisture need to always be within certain ranges.
The company installs a computerised system to keep these three growing conditions within the
best ranges. Sensors are used for collecting data about the temperature, light level, and moisture
content of the soil.
...............................................................................................................................................[1]
(b) Give three items of hardware that would be needed for this system. Justify your choice.
Do not include sensors in your answer.
Item 1 ........................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
Item 3 ........................................................................................................................................
Justification ...............................................................................................................................
...............................................................................................................................................[6]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(ii) When the system was designed, various parameters for temperature were set.
...........................................................................................................................................
.......................................................................................................................................[1]
(iii) Explain how this parameter value is used by the feedback system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
• A flag is set to indicate whether its associated sensor reading is waiting to be processed.
• More than one sensor reading may be waiting to be processed at any particular moment.
• Data received from the sensors is stored in a block of eight consecutive bytes (addresses
201–208).
• The data from sensor 1 is at address 201, the data from sensor 2 is at address 202, and
so on.
Sensor number
1 2 3 4 5 6 7 8
150 0 1 0 0 0 1 0 1
201 0 0 0 0 0 0 0 0
202 0 0 0 0 0 1 0 0
203 0 0 0 0 0 0 0 0
204 0 0 0 1 0 0 0 0
205 0 0 0 0 0 0 1 0
206 0 0 0 1 0 1 0 0
207 0 0 0 1 0 0 1 0
208 0 0 0 1 0 0 1 0
...........................................................................................................................................
.......................................................................................................................................[2]
(ii) The accumulator is loaded with the data from location 150.
Write the assembly language instruction to check whether there is a value waiting to be
processed for sensor 6.
.......................................................................................................................................[3]
1 The following syntax diagrams, for a particular programming language, show the syntax of:
• an assignment statement
• a variable
• a letter
• an operator
Assignment statement
Variable = Variable Operator Variable ;
Variable
Letter Letter Letter
Letter Operator
a +
b –
d ÷
(i) a = b + c
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(ii) a = b – 2;
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(iii) a = dd * cce;
Reason ..............................................................................................................................
.......................................................................................................................................[1]
(b) Write the Backus-Naur Form (BNF) for the syntax diagrams shown on the opposite page.
<assignmentstatement> ::=
...................................................................................................................................................
<variable> ::=
...................................................................................................................................................
<letter> ::=
...................................................................................................................................................
<operator> ::=
...............................................................................................................................................[6]
(c) Rewrite the BNF rule for a variable so that it can be any number of letters.
<variable> ::=
...............................................................................................................................................[2]
(d) Programmers working for a software development company use both interpreters and
compilers.
...........................................................................................................................................
.......................................................................................................................................[1]
Give a reason why this helps to protect the security of the source code.
...........................................................................................................................................
.......................................................................................................................................[1]
5 A gardener grows vegetables in a greenhouse. For the vegetables to grow well, the temperature
needs to always be within a particular range.
The gardener is not sure about the actual temperatures in the greenhouse during the growing
season. The gardener installs some equipment. This records the temperature every hour during
the growing season.
...............................................................................................................................................[1]
(b) Identify three items of hardware that would be needed to acquire and record the temperature
data. Justify your choice for each.
Item 1 ........................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
Item 3 ........................................................................................................................................
Justification ................................................................................................................................
...............................................................................................................................................[6]
(c) The equipment records temperatures in the greenhouse. It does this for seven locations.
Each recording is stored as two successive bytes. The format is shown below:
7 6 5 4 3 2 1 0
Byte 1 Byte 2
The location is indicated by the setting of one of the seven bits in byte 1. For example,
location 4 is indicated by setting bit 4.
7 6 5 4 3 2 1 0
0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0
Byte 1 Byte 2
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
Complete the boxes below to show the two bytes for this recording. The reading has not
yet been processed.
7 6 5 4 3 2 1 0
Byte 1 Byte 2
[2]
(d) (i) The accumulator is loaded with the value of byte 1 from location 106.
Write the assembly language instruction to check whether the reading in byte 2 came
from location 4.
.......................................................................................................................................[4]
(ii) Write the assembly language instruction to set the flag (bit 0) of the byte contained in the
accumulator to 1.
.......................................................................................................................................[2]