KEMBAR78
System Software | PDF | Computer Program | Programming
0% found this document useful (0 votes)
16 views118 pages

System Software

The document discusses various aspects of programming and computer systems, including the compilation process, optimization of code, assembly language instructions, and syntax diagrams for programming languages. It includes questions related to these topics, requiring identification of stages in compilation, optimization reasons, and assembly instructions for specific tasks. The document also covers concepts such as memory management, operating systems, and error handling in container systems.

Uploaded by

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

System Software

The document discusses various aspects of programming and computer systems, including the compilation process, optimization of code, assembly language instructions, and syntax diagrams for programming languages. It includes questions related to these topics, requiring identification of stages in compilation, optimization reasons, and assembly instructions for specific tasks. The document also covers concepts such as memory management, operating systems, and error handling in container systems.

Uploaded by

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

7

4 A student writes a program in a high-level programming language. A compiler translates the


program into machine code.

(a) The compilation process has a number of stages.

The output of the lexical analysis stage forms the input to the next stage.

(i) Identify this stage.

...................................................................................................................................... [1]

(ii) State two tasks that occur at this stage.

1 .........................................................................................................................................

...........................................................................................................................................

2 .........................................................................................................................................

...........................................................................................................................................
[2]

(b) The program uses pseudocode in place of a high-level language.

There are a number of reasons for performing optimisation. One reason is to produce code
that minimises the amount of memory used.

State another reason for the optimisation of code.

.............................................................................................................................................. [1]

(c) The following statement assigns an expression to the variable A.

Suggest what a compiler could do to optimise the following expression.

A B + 2 * 6

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [1]

© UCLES 2018 9618/03/SP/21 [Turn over


8

(d) These lines of code are to be compiled:

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:

01 LDD 436 // loads value A


02 ADD 437 // adds value B
03 STO 612 // stores result in X
04 LDD 436 // loads value A
05 ADD 437 // adds value B
06 ADD 438 // adds value C
07 STO 613 // stores result in Y

Suggest what a compiler could do to optimise this code.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [3]

© UCLES 2018 9618/03/SP/21


15

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

(a) State the addressing mode used by:

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]

© UCLES 2018 9618/03/SP/21


4

4 The following syntax diagrams for a particular programming language show the syntax of:

• a digit
• a capital letter
• a character.

digit capital letter


0 A

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]

© UCLES 2021 9618/32/O/N/21


5

(b) A password must begin with a character and be followed by one or more digits or capital
letters.

(i) State an example of a valid password.

..................................................................................................................................... [1]

(ii) A valid password is represented by the syntax diagram:

password
character digit

capital letter

Write the BNF notation of the syntax diagram for password.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [4]

© UCLES 2021 9618/32/O/N/21 [Turn over


5

3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.

OS term Description

Using secondary storage to simulate


additional main memory
Multi-tasking

Managing the processes running on


the CPU
Paging

Managing the execution of many programs


that appear to run at the same time

Interrupt handling

Locating non-contiguous blocks of data and


relocating them

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]

© UCLES 2021 9618/33/M/J/21 [Turn over


6

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]

(b) Write the infix expression in RPN.

(a – b) * (a + c) / 7

...................................................................................................................................................

............................................................................................................................................. [1]

(c) Write the RPN expression as an infix expression.

a b / 4 * a b + -

...................................................................................................................................................

............................................................................................................................................. [1]

(d) Evaluate the RPN expression:

a b + c d / /

where a = 17, b = 3, c = 48 and d = 12.

Show your working.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2021 9618/33/M/J/21


8

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

Actuators can be in two states, on or off. Whether an actuator is on or off is determined by a


single bit value (0 means off, 1 means on) in a specific 8-bit memory location.

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

LDM #n Immediate addressing. Load the number n to ACC

LDD <address> Direct addressing. Load the contents of the given


address to ACC

STO <address> Store the contents of ACC at the given address

OUT Output to the screen the character whose ASCII value


is stored in 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

OR #n Bitwise OR operation of the contents of ACC with the


operand

© UCLES 2012 9608/03/SP/15


11

(c) Modern personal computer operating systems support multi-tasking.


One of the modules of such an operating system will be for memory management.

Describe two different strategies which could be used to manage the available main
memory.

[6]

© UCLES 2012 9608/03/SP/15 [Turn over


8

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

variable = variable operator variable

unsigned
integer

variable

letter letter

unsigned integer

digit digit

letter operator digit


X + 1

Y – 2

Z * 3

(a) Give reasons why each of these statements is invalid.

X = XY + 21

...................................................................................................................................................

YZ := YZ * 3

...................................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2021 9608/33/M/J/21


9

(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.

<letter> has been completed for you.

<letter> ::= X|Y|Z

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

(i) Draw an updated syntax diagram for the variable.

[3]

(ii) Give the BNF for the revised variable.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

© UCLES 2021 9608/33/M/J/21 [Turn over


12

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 computer system is programmed to control each container’s temperature by:


• turning on the heater and turning off the air conditioning unit when the temperature falls below
5 degrees
• turning off the heater and turning on the air conditioning unit when the temperature rises
above 8 degrees.

(a) (i) State the name given to the type of system described.

..................................................................................................................................... [1]

(ii) Justify your answer to part (i).

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

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

© UCLES 2021 9608/33/M/J/21


13

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

© UCLES 2021 9608/33/M/J/21 [Turn over


14

(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

Explain the purpose of each instruction.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [4]

© UCLES 2021 9608/33/M/J/21


15

(ii) Write the assembly language instructions to check for an error in the container 4 system.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

© UCLES 2021 9608/33/M/J/21


8

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 variable operator unsigned


= integer

variable

letter digit

unsigned integer

digit digit

letter operator digit

X + 1

Y – 2

Z * 3

(a) Give reasons why each of these statements is invalid.

X1 = Y - 21

...................................................................................................................................................

Y3 := Y3 + 1

...................................................................................................................................................

X1 = X2 * 7

...................................................................................................................................................
[3]

© UCLES 2021 9608/32/M/J/21


9

(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.
<letter> has been completed for you.

<letter> ::= X|Y|Z

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

(i) Draw an updated syntax diagram for the assignment statement.

[2]

(ii) Give the BNF for the revised assignment statement syntax.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

© UCLES 2021 9608/32/M/J/21 [Turn over


11

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 computer system is programmed to control each greenhouse’s temperature by:


• turning on the heater and closing the ventilation when the temperature falls below 10 degrees
• turning off the heater and opening the ventilation when the temperature rises above
20 degrees.

(a) (i) State the name given to the type of system described.

..................................................................................................................................... [1]

(ii) Justify your answer to part (i).

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

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

© UCLES 2021 9608/32/M/J/21 [Turn over


12

(c) The status of the heaters and the ventilation is shown at location 700.

• A value of 1 means that the heater is on.

• A value of 0 (zero) means that the heater is off.

• A value of 1 means that the ventilation is open.

• A value of 0 (zero) means that the ventilation is closed.

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

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 operation of the contents of ACC with the


AND &n
hexadecimal number n
Bits in ACC are shifted denary number n places to the
LSL #n
left. Zeros are introduced at the right hand end
Compare the contents of ACC with the hexadecimal
CMP &n
number n
Following a compare instruction, jump to <address>
JPE <address>
or <label> if the compare was True
<label>: <op code> <operand> Labels an instruction

© UCLES 2021 9608/32/M/J/21


13

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

Explain the purpose of each instruction.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [4]

(ii) Write the assembly language instructions to check for an error in the greenhouse 2
system.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

© UCLES 2021 9608/32/M/J/21


7

(d) Identify the common logic circuit given by the truth table in part (a). Give the use of each
output.

Logic circuit ...............................................................................................................................

Use of X ....................................................................................................................................

Use of Y ....................................................................................................................................
[3]

5 Complete these statements about a virtual machine.

A virtual machine is ................................................ that emulates a

................................................ computer system.

A virtual machine allows multiple ................................................ operating systems to run

on one computer using a ................................................ operating system.


[4]

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]

© UCLES 2020 9608/33/O/N/20 [Turn over


10

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.

• Data is stored in three memory locations with addresses 801 to 803.


• Location 801 contains the distance travelled in kilometres for the current trip, stored as a
binary integer.
• Location 802 contains the quantity of fuel used in litres for the current trip, stored as a
fixed-point binary number with six places before the binary point and two places after the
binary point.
• The four most significant bits of location 803 are flags used to identify problems with the load,
for example it is too heavy. A flag is set to 1 if there is a problem, or 0 if not.
The problems are:

• Bit 7 – load too heavy


• Bit 6 – load too high
• Bit 5 – load unstable
• Bit 4 – load not secured (risk of the load falling off)
• Bits 0 to 3 are not used

(a) The current contents of addresses 801 to 803 are:

Most significant bit Least significant bit

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.

Complete the contents of the addresses to record this information.

801

802

803
[3]

© UCLES 2020 9608/33/O/N/20


11

(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

<label>: <op code> <operand> Labels an instruction


Note:

# denotes immediate addressing


B denotes a binary number, for example B01001010
& denotes a hexadecimal number, for example &4A

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

© UCLES 2020 9608/33/O/N/20 [Turn over


12

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

Label Op code Operand


CHECKLOAD: LDD 803

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.

© UCLES 2020 9608/33/O/N/20


8

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.

The diagram shows MyApp running on three virtual machines.

MyApp MyApp MyApp

OS1 OS2 OS3

Virtual machine software

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]

© UCLES 2020 9608/32/O/N/20 [Turn over


12

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:

• Bit 0 - high engine temperature


• Bit 1 - low oil pressure
• Bit 2 - low battery
• Bit 3 - low fuel
• Bits 4 to 7 are not used

(a) The current contents of addresses 601 to 603 are:

Most significant Least significant

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.

Complete the contents of the addresses to record this information.

601

602

603
[3]

© UCLES 2020 9608/32/O/N/20


13

(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

LDM #n Load the number n to ACC

Load the contents of the location at the given


LDD <address>
address to ACC

STO <address> Store the contents of ACC at the given address

Bitwise AND operation of the contents of ACC


AND #n
with the numeric operand

CMP #n Compare the contents of ACC with the number n

Following a compare instruction, jump to


JPE <address>
<address> or <label> if the compare was True

JMP <address> Jump to <address> or <label>

<label>: <op code> <operand> Labels an instruction

Note:

# denotes immediate addressing


B denotes a binary number, for example B01001010
& denotes a hexadecimal number, for example &4A

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

© UCLES 2020 9608/32/O/N/20 [Turn over


14

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

Label Op code Operand

CHECKFLAGS: LDD 603

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]

© UCLES 2020 9608/32/O/N/20


6

6 Duraid writes a short program in a high-level programming language. An interpreter executes the
program.

The following is part of Duraid’s 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.

The interpreter converts the infix to RPN.

The RPN expression for Y is:

The interpreter evaluates this RPN expression using a stack.

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

© UCLES 2020 9608/33/M/J/20


7

(ii) Convert the following RPN expression back to its infix form.

...........................................................................................................................................

..................................................................................................................................... [2]

(c) Explain how RPN is used by an interpreter to evaluate expressions.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 9608/33/M/J/20 [Turn over


8

7 A computer at a remote weather station is performing three tasks:

• measuring and recording the temperature every 10 seconds


• measuring and recording the wind speed every 10 seconds
• sending the previous day’s temperature and wind speed readings to a scientist at another
location via the Internet.

The operating system is managing the multitasking of these tasks.

(a) At one point in time:

• the temperature measuring and recording task is idle


• the wind speed is being recorded
• the task to send the previous day’s temperature and wind speed readings is waiting for
an internet connection.

Identify the process state for each task. Give a reason why each task is in that process state.

Temperature measuring and recording process state ..............................................................

Reason .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Wind speed measuring and recording process state ...............................................................

Reason .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Sending process state ..............................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[6]

© UCLES 2020 9608/33/M/J/20


9

(b) The weather station computer uses an operating system.

Explain how this operating system uses interrupts to schedule the measuring and recording
tasks.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2020 9608/33/M/J/20 [Turn over


11

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.

The current contents of address 500 are:

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]

© UCLES 2020 9608/33/M/J/20 [Turn over


12

(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

After rechecking the doors, address 500 now contains 10101010.

(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

DOOR1: STO 501

WAIT

LDM &00

STO 501

WAIT

JMP CHECK1
[4]

© UCLES 2020 9608/33/M/J/20


13

(ii) Write the assembly language instructions to check door 2.

Instruction

Label Op code Operand

[4]

(c) Explain how the check door routines show a flashing light or no light.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 9608/33/M/J/20


4

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 <

© UCLES 2019 9608/33/O/N/19


5

(a) The following conditions are invalid.

Give the reason in each case.

(i) 35 > 24

Reason ..............................................................................................................................

..................................................................................................................................... [1]

(ii) abc := cba

Reason ..............................................................................................................................

..................................................................................................................................... [1]

(iii) bc < 49

Reason ..............................................................................................................................

..................................................................................................................................... [1]

(b) Complete the Backus-Naur Form (BNF) for the syntax diagram.

<operator> ::= ...................................................................................................................

...................................................................................................................................................

<number> ::= ........................................................................................................................

...................................................................................................................................................

<variable> ::= ...................................................................................................................

...................................................................................................................................................

<condition> ::= .................................................................................................................

...................................................................................................................................................
[6]

© UCLES 2019 9608/33/O/N/19 [Turn over


9

6 (a) An operating system (OS) uses a memory management technique called paging.

Explain what is meant by the following terms.

Page .........................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Page frame ...............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Page table ................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[3]

(b) Explain why an operating system needs to use scheduling algorithms.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) State what is meant by an interrupt.

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2019 9608/33/O/N/19 [Turn over


10

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

JOB21 – JOBSS – JOBPT – JOB32 – JOB42, then return to JOB21

Process JOB32 has just completed its time-slice.

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

................................................ .

Copy the saved registers for ................................................ to the CPU.

The processor will now process ................................................ .


[3]

© UCLES 2019 9608/33/O/N/19


13

9 (a) The following incomplete table shows descriptions relating to computer architectures.

Complete the table by inserting the appropriate terms.

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]

(b) State three characteristics of massively parallel computers.

1 ................................................................................................................................................

...................................................................................................................................................

2 ................................................................................................................................................

...................................................................................................................................................

3 ................................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2019 9608/33/O/N/19


7

4 Physical memory is managed using virtual memory and paging.

(a) Describe what is meant by virtual memory.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) (i) Explain how paging is used to manage virtual memory.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [4]

(ii) Give a suitable page replacement algorithm for this process.

..................................................................................................................................... [1]

(iii) One drawback of using virtual memory is disk thrashing.

Describe what is meant by the term disk thrashing.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

© UCLES 2019 9608/32/O/N/19 [Turn over


8

5 A weather station uses monitoring and control systems.

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

(ii) Serial files can be accessed using sequential access.

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.

The following lines of high level language code are compiled.

X = X + Y
Z = Z + X

The compilation produces the assembly language code as follows:

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.

Rewrite the equivalent code after optimisation.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

(ii) Explain why code optimisation is necessary.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

© UCLES 2019 9608/33/M/J/19


13

6 Monitoring and control systems have many different applications.

(a) Explain the importance of feedback in a control system.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(b) An indoor swimming pool is to be kept at a constant temperature of 28 degrees.

Describe the use of feedback in this control system.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(c) Give one example of a monitoring system. Explain why this is a monitoring system.

Monitoring system ....................................................................................................................

...................................................................................................................................................

Explanation ...............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2019 9608/33/M/J/19


7

4 (a) Describe the main steps in the evaluation of a Reverse Polish Notation (RPN) expression
using a stack.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(b) The infix expression 8 * (5 – 2) – 30 / (2 * 3) converts to:

8 5 2 – * 30 2 3 * / –

in Reverse Polish Notation (RPN).

Show the changing contents of the stack as this RPN expression is evaluated.

[4]

© UCLES 2019 9608/32/M/J/19 [Turn over


9

6 A company sells plant watering systems that automatically turn on water sprinklers when the soil
becomes too dry.

The plant watering system has a processor and connecting cables.

Identify two other hardware devices that are required in this system. State the purpose of each
device.

Device 1 ...........................................................................................................................................

Purpose ............................................................................................................................................

..........................................................................................................................................................

Device 2 ...........................................................................................................................................

Purpose ............................................................................................................................................

..........................................................................................................................................................
[4]

© UCLES 2019 9608/32/M/J/19 [Turn over


11

8 (a) A computer process can be in one of three states.

Identify and describe two of these states.

State 1 ......................................................................................................................................

Description ................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

State 2 ......................................................................................................................................

Description ................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[6]

(b) One of the main tasks of an operating system is resource management.

Describe how an operating system can maximise the use of resources.

Primary memory .......................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Disk ...........................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[6]

© UCLES 2019 9608/32/M/J/19


10

5 A computer process can be in one of three states: running, ready or blocked.

(a) Explain how the processes are affected when the following events take place.

(i) The running process needs to read a file from a disk.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

(ii) The running process uses up its time slice.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

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

© UCLES 2018 9608/33/O/N/18


11

(c) Give three reasons why process scheduling is needed.

1 ................................................................................................................................................

...................................................................................................................................................

2 ................................................................................................................................................

...................................................................................................................................................

3 ................................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2018 9608/33/O/N/18 [Turn over


14

(ii) A student uses the compiler to compile some different code.

After the syntax analysis stage is complete, the compiler generates object code.

The following lines of code are compiled.

X A + B
Y A + B + C
Z A + B + C + D

The compilation produces the following assembly language code.

LDD 236 // loads value A to accumulator


ADD 237 // adds value B to accumulator
STO 512 // stores accumulator in X
LDD 236 // loads value A to accumulator
ADD 237 // adds value B to accumulator
ADD 238 // adds value C to accumulator
STO 513 // stores accumulator in Y
LDD 236 // loads value A to accumulator
ADD 237 // adds value B to accumulator
ADD 238 // adds value C to accumulator
ADD 239 // adds value D to accumulator
STO 514 // stores accumulator in Z

Rewrite the assembly language code after it has been optimised.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[5]

© UCLES 2018 9608/33/O/N/18


8

4 A compiler uses a keyword table and a symbol table. Part of the keyword table is shown.

• Tokens for keywords are shown in hexadecimal.


• All of the keyword tokens are in the range 00 – 5F.

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

Study the following code.

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]

(c) A student uses the compiler to compile some different code.

After the syntax analysis is complete, the compiler generates object code.

The following line of code is compiled: X

The compilation produces the following assembly language code.

LDD 236 // loads value A into accumulator


ADD 237 // adds value B to accumulator
ADD 238 // adds value C to accumulator
STO 540 // stores accumulator in temporary location
LDD 540 // loads value from temporary location into accumulator
SUB 239 // subtracts value D from accumulator
STO 235 // stores accumulator in X

(i) Identify the final stage in the compilation process that follows this code generation stage.

.......................................................................................................................................[1]

(ii) Rewrite the equivalent code following the final stage.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[3]

© UCLES 2018 9608/32/O/N/18 [Turn over


12

(c) The table shows four statements about computer architecture.

Put a tick ( ) in each row to identify the computer architecture associated with each statement.

Architecture
Statement
SIMD MIMD SISD

Each processor executes a different instruction

There is only one processor

Each processor executes the same instruction input


using data available in the dedicated memory
Each processor typically has its own partition within a
shared memory
[4]

6 (a) The following table shows descriptions and terms relating to data transmission security.

Add appropriate descriptions and terms to complete the table.

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]

© UCLES 2018 9608/32/O/N/18


10

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

The RPN expression is:

The interpreter evaluates this RPN expression using a stack.

The current values are: a = 1 b = 2 c = 2 d = 3

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]

© UCLES 2018 9608/32/O/N/18


10

5 The following syntax diagrams show the syntax of:

• 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 \

© UCLES 2018 9608/33/M/J/18


11

(a) The following assignment statements are invalid.

Give the reason in each case.

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

<assignment statement> ::=

...................................................................................................................................................

<variable> ::=

...................................................................................................................................................

<signed integer> ::=

...................................................................................................................................................

<operator> ::=

...................................................................................................................................................
[4]

(c) Rewrite the BNF rule for a variable so that it can be any number of letters.

<variable> ::=

...............................................................................................................................................[2]

© UCLES 2018 9608/33/M/J/18 [Turn over


14

7 A museum stores antique items that need to be kept at constant temperature.

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.

(a) Identify the type of system described.

...............................................................................................................................................[1]

(b) The system has a temperature sensor.

Identify two other items of hardware that the museum can use for the type of system identified.

Describe the purpose of each item.

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.

Bit 0 of Byte 2 is a flag:


Byte 1 contains the temperature reading as an unsigned integer.

© UCLES 2018 9608/33/M/J/18


15

One reading returns the following binary data.

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

(i) Analyse the data contained in the two bytes.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

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

© UCLES 2018 9608/33/M/J/18


4

2 The following syntax diagrams show the syntax of:

• 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 /

© UCLES 2018 9608/32/M/J/18


5

(a) The following assignment statements are invalid.

Give the reason in each case.

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

<assignment statement> ::=

...................................................................................................................................................

<variable> ::=

...................................................................................................................................................

<unsigned integer> ::=

...................................................................................................................................................

<operator> ::=

...................................................................................................................................................
[6]

© UCLES 2018 9608/32/M/J/18 [Turn over


10

6 (a) There are five scenarios on the left and two types of system on the right.

Draw a line to link each scenario to its correct type of system.

Scenario System

Car speed display

Aeroplane autopilot

Control

Rollercoaster

Monitoring

Recording the rainfall at


a weather station

Robot loading a part onto


a conveyor belt

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

Fish tank Temperature reading

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.

Bit 7 of Byte 1 is a flag:


Bit 0 of Byte 1 is unused.

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

Analyse the data contained in the two bytes.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[3]

© UCLES 2018 9608/32/M/J/18 [Turn over


12

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

If bit 4 is 1, then the hardware device in fish tank 4 is on.

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.

© UCLES 2018 9608/32/M/J/18


5

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

© UCLES 2017 9608/33/O/N/17 [Turn over


6

(a) The following assignment statements are invalid.

Give the reason in each case.

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

<digit> has been done for you.

<assignment_statement> ::=

...................................................................................................................................................

<variable> ::=

...................................................................................................................................................

<unsigned_integer> ::=

...................................................................................................................................................

<digit> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

<letter> ::=

...................................................................................................................................................

<operator> ::=

...................................................................................................................................................
[6]

© UCLES 2017 9608/33/O/N/17


11

(ii) Explain why the JK flip-flop is an improvement on the SR flip-flop.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

(d) Explain the role of flip-flops in a computer.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

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

(ii) Justify your answer to part (i).

...........................................................................................................................................

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

© UCLES 2017 9608/33/O/N/17 [Turn over


12

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

© UCLES 2017 9608/33/O/N/17


14

Part of the assembly language code for updating LOWREG is:

Label Op code Operand

LOWTEMP: 15

LOWREG: B00000000

COUNTER: 1

START: LDR #0

LOOP: LDX 8000

CMP LOWTEMP

JGE TEMPOK

LDD LOWREG

OR COUNTER

STO LOWREG

TEMPOK: LDD COUNTER

Q1: CMP #32

JPE HEATON

ADD COUNTER

STO COUNTER

INC IX

JMP LOOP

HEATON: LDD LOWREG

© UCLES 2017 9608/33/O/N/17


15

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

At a particular time, the memory locations store the following data.

8000 8001 8002 8003 8004 8005


17 14 15 15 16 14

Dry run the assembly language code starting at START and finishing when the loop has been
processed twice.

LOWTEMP LOWREG COUNTER ACC IX

15 B00000000 1

[4]

© UCLES 2017 9608/33/O/N/17 [Turn over


16

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

Describe what this code will have to do.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

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

© UCLES 2017 9608/33/O/N/17


6

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

Virtual machine software / virtual machine monitor

.......B......operating system

Hardware

(i) State the operating systems labelled A and B in the diagram.

A ........................................................................................................................................

B ........................................................................................................................................
[2]

(ii) Application P is executing and requests data from a file.

Describe what happens after .......A......operating system 1 has received the data request
from the application.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[3]

© UCLES 2017 9608/32/O/N/17


7

(b) A software development company uses virtual machines to produce software.

(i) State one benefit to the company.

...........................................................................................................................................

.......................................................................................................................................[1]

(ii) Explain two limitations of this approach.

Limitation 1 ........................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

Limitation 2 ........................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[4]

© UCLES 2017 9608/32/O/N/17 [Turn over


8

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

(a) (i) Explain why 32 is a valid unsigned integer.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

© UCLES 2017 9608/32/O/N/17


9

(ii) Explain why 32.5 is a valid unsigned number.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.

<unsigned_number> ::= ...................................................................................................

...................................................................................................................................................

<unsigned_integer> ::= .................................................................................................

...................................................................................................................................................

<digit> ::= .........................................................................................................................

...................................................................................................................................................
[5]

The format of an unsigned number is amended to include numbers with possible exponents.

If an unsigned number has an exponent, then the exponent part:



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

© UCLES 2017 9608/32/O/N/17 [Turn over


10

(ii) Use your syntax diagram from part (c)(i) to write the BNF for an unsigned number to
include numbers with exponents.

<unsigned_number> ::= ............................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[4]

© UCLES 2017 9608/32/O/N/17


13

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.

Justify your choice.

Sensor ......................................................................................................................................

Justification ...............................................................................................................................

...................................................................................................................................................
[2]

(b) Describe why feedback is important in this system.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

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

© UCLES 2017 9608/32/O/N/17 [Turn over


14

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

© UCLES 2017 9608/32/O/N/17


15

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

<address> can be an absolute address or a symbolic address.


LSL #n Bits in ACC are shifted n places to the left. Zeros are introduced
on the right hand end.
LSR #n Bits in ACC are shifted n places to the right. Zeros are introduced
on the left hand end.

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.

LDD ............................ // load the contents of the 16-bit location


containing the value for Sensor 5 into the
Accumulator

.................................... // move the bits in the Accumulator so that the


Accumulator stores the value of Sensor 5 as an
unsigned 16-bit binary integer
[3]

© UCLES 2017 9608/32/O/N/17


4

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.

Draw a line to link each statement to the correct compilation stage.

Statement Compilation stage

This stage removes any


comments in the program Lexical analysis
source code.

This stage could be


Syntax analysis
ignored.

This stage checks the


grammar of the program Code generation
source code.

This stage produces a


tokenised version of the Optimisation
program source code.

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

© UCLES 2016 9608/33/O/N/16


5

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

The interpreter evaluates this RPN expression using a stack.

The current values of the variables are:

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]

© UCLES 2016 9608/33/O/N/16 [Turn over


6

3 A computer operating system (OS) uses paging for memory management.

In paging:

• main memory is divided into equal-size blocks, called page frames


• each process that is executed is divided into blocks of the same size, called pages
• each process has a page table that is used to manage the pages of this process

The following table is the incomplete page table for a process X.

Page Presence Page frame address Additional data


flag
1 1 132
2 1 245
3 1 232
4 0 0
5 1 542
6 0 0

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.

(a) The page frame address entry for Page 2 is 245.

State what the value 245 could represent.

.............................................................................................................................................. [1]

(b) Process X executes until the next instruction is the first instruction in Page 4. Page 4 is not
currently in main memory.

State a hardware device that could be storing this page.

.............................................................................................................................................. [1]

© UCLES 2016 9608/33/O/N/16


4

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.

Draw a line to link each statement to the correct compilation stage.

Statement Compilation stage

This stage can improve the time


taken to execute the statement: Lexical analysis
x = y + 0

This stage produces object


Syntax analysis
code.

This stage makes use of tree


Code generation
data structures.

This stage enters symbols in


Optimisation
the symbol table.

[4]

(b) Write the Reverse Polish Notation (RPN) for the following expression.

P + Q – R / S

.............................................................................................................................................. [2]

© UCLES 2016 9608/32/O/N/16


7

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

The page that is to be replaced is determined by a page replacement algorithm.

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

Page Presence Page frame address Additional data


flag

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

Page Presence Page frame address Additional data


flag

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.

Longest resident .......................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Least used ................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

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

(ii) State the name given to this logic circuit.

...................................................................................................................................... [1]

(iii) Name the labels usually given to A and B.

Label A ..............................................................................................................................

Label B ..............................................................................................................................

Explain why your answers are more appropriate for the A and B labels.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [4]

© UCLES 2016 9608/33/O/N/16


6

3 A computer operating system (OS) uses paging for memory management.

In paging:

• main memory is divided into equal-size blocks, called page frames


• each process that is executed is divided into blocks of the same size, called pages
• each process has a page table that is used to manage the pages of this process

The following table is the incomplete page table for a process, Y.

Page Presence Page frame address Additional data


flag
1 1 221
2 1 222
3 0 0
4 0 0
5 1 542
6 0 0

249 0 0

(a) State two facts about Page 5.

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.

The page that is to be replaced is determined by a page replacement algorithm.

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

Page Presence Page frame address Additional data


flag

6 …………. ………..…… …………………….……

[3]

© UCLES 2016 9608/32/O/N/16 [Turn over


5

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

The interpreter evaluates this RPN expression using a stack.

The current values of the variables are:

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.

Explain this statement.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

© UCLES 2016 9608/32/O/N/16 [Turn over


6

3 (a) The following diagram shows how applications X, Y and Z can run on a virtual machine
system.

Application X Application Y Application Z

Guest operating
Guest operating system 1
system 2

Virtual machine software / virtual machine monitor

Host operating system

Hardware

(i) The virtual machine software undertakes many tasks.

Describe two of these tasks.

Task 1 ................................................................................................................................

...........................................................................................................................................

Task 2 ................................................................................................................................

.......................................................................................................................................[2]

(ii) Explain the difference between a guest operating system and a host operating
system.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

© UCLES 2016 9608/33/M/J/16


7

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

In developing these changes, the company could use virtual machines.

(i) Describe two possible uses of virtual machines by the company.

Use 1 .................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

Use 2 .................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[4]

The web server often has to handle many simultaneous requests.

(ii) The company uses a virtual machine to test possible solutions to the changes that they
will need to make.

Explain one limitation of this approach.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

© UCLES 2016 9608/33/M/J/16 [Turn over


12

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.

The bit value for each sensor shows:

• 1 – the sensor has been triggered


• 0 – the sensor has not been triggered

The bit positions are used as follows:

Not used Sensor 4 Sensor 3 Sensor 2 Sensor 1

The output from the intruder detection system is a loud alarm.

(a) (i) State the name of the type of system to which intruder detection systems belong.

.......................................................................................................................................[1]

(ii) Justify your answer to part (i).

...........................................................................................................................................

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

© UCLES 2016 9608/33/M/J/16


13

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

© UCLES 2016 9608/33/M/J/16 [Turn over


14

(c) Part of the assembly code is:

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

© UCLES 2016 9608/33/M/J/16


15

(i) Dry run the assembly language code. Start at LOOP and finish when EXIT is reached.

BITREG COUNT VALUE ACC


B00001010 0 1

[4]

(ii) The operand for the instruction labelled TEST is missing.

State the missing operand.

.......................................................................................................................................[1]

(iii) The intruder detection system is improved and now has eight sensors.

One instruction in the assembly language code will need to be amended.

Identify this instruction .......................................................................................................

Write the amended instruction ......................................................................................[2]

© UCLES 2016 9608/33/M/J/16


6

3 (a) The following diagram shows how applications X, Y and Z can run on a virtual machine
system.

Application X Application Y Application Z

Guest operating
Guest operating system 1
system 2

Virtual machine software / virtual machine monitor

Host operating system

Hardware

(i) The virtual machine software undertakes many tasks.

Describe two of these tasks.

Task 1 ................................................................................................................................

...........................................................................................................................................

Task 2 ................................................................................................................................

.......................................................................................................................................[2]

(ii) Explain the difference between a guest operating system and a host operating
system.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

© UCLES 2016 9608/32/M/J/16


7

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

In developing these changes, the company could use virtual machines.

(i) Describe two possible uses of virtual machines by the company.

Use 1 .................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

Use 2 .................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[4]

The web server often has to handle many simultaneous requests.

(ii) The company uses a virtual machine to test possible solutions to the changes that they
will need to make.

Explain one limitation of this approach.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

© UCLES 2016 9608/32/M/J/16 [Turn over


12

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.

The bit value for each sensor shows:

• 1 – the sensor has been triggered


• 0 – the sensor has not been triggered

The bit positions are used as follows:

Not used Sensor 4 Sensor 3 Sensor 2 Sensor 1

The output from the intruder detection system is a loud alarm.

(a) (i) State the name of the type of system to which intruder detection systems belong.

.......................................................................................................................................[1]

(ii) Justify your answer to part (i).

...........................................................................................................................................

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

© UCLES 2016 9608/32/M/J/16


14

(c) Part of the assembly code is:

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

© UCLES 2016 9608/32/M/J/16


15

(i) Dry run the assembly language code. Start at LOOP and finish when EXIT is reached.

BITREG COUNT VALUE ACC


B00001010 0 1

[4]

(ii) The operand for the instruction labelled TEST is missing.

State the missing operand.

.......................................................................................................................................[1]

(iii) The intruder detection system is improved and now has eight sensors.

One instruction in the assembly language code will need to be amended.

Identify this instruction .......................................................................................................

Write the amended instruction ......................................................................................[2]

© UCLES 2016 9608/32/M/J/16


11

6 A number of processes are being executed in a computer.

(a) Explain the difference between a program and a process.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...............................................................................................................................................[2]

A process can be in one of three states: running, ready or blocked.

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

From running to ready ..............................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

From ready to running ..............................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

From running to blocked ...........................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...............................................................................................................................................[6]

© UCLES 2015 9608/33/O/N/15 [Turn over


12

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

© UCLES 2015 9608/33/O/N/15


4

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.

• Tokens for keywords are shown in hexadecimal.


• All the keyword tokens are in the range 00 to 5F.

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

Study the following piece of code:

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.

(i) Name this stage.

.......................................................................................................................................[1]

(ii) State two tasks that occur at this stage.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

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

(i) State another reason for the optimisation of code.

.......................................................................................................................................[1]

(ii) What could a compiler do to optimise the following expression?

A B + 2 * 6

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[1]

© UCLES 2015 9608/32/O/N/15 [Turn over


6

(iii) These lines of code are to be compiled:

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:

LDD 436 //loads value A


ADD 437 //adds value B
STO 612 //stores result in X
LDD 436 //loads value A
ADD 437 //adds value B
ADD 438 //adds value C
STO 613 //stores result in Y

(iv) Rewrite the equivalent code, given above, following optimisation.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[3]

© UCLES 2015 9608/32/O/N/15


8

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.

Description Computer architecture

A computer that does not have the ability for


SIMD
parallel processing.

The processor has several ALUs. Each ALU


executes the same instruction but on different MISD
data.

There are several processors. Each processor


executes different instructions drawn from a
SISD
common pool. Each processor operates on
different data drawn from a common pool.

There is only one processor executing one


MIMD
set of instructions on a single set of data.

[4]
(b) In a massively parallel computer explain what is meant by:

(i) Massive .............................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[1]

(ii) Parallel ..............................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[1]

(c) There are both hardware and software issues that have to be considered for parallel
processing to succeed.

Describe one hardware and one software issue.

Hardware ..................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Software ....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...............................................................................................................................................[4]
© UCLES 2015 9608/32/O/N/15
11

6 A number of processes are being executed in a computer.

A process can be in one of three states: running, ready or blocked.

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

From blocked to ready ..............................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

From running to ready ..............................................................................................................

...................................................................................................................................................

...................................................................................................................................................

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

(i) Name this state.

.......................................................................................................................................[1]

(ii) Identify when a process would enter this state.

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

© UCLES 2015 9608/33/M/J/15


4

2 A compiler uses a keyword table and a symbol table. Part of the keyword table is shown below.

• Tokens for keywords are shown in hexadecimal.

• All the keyword tokens are in the range 00 – 5F.

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

Study the following piece of code:

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]

(c) This line of code is to be compiled:

A B + C + D

After the syntax analysis stage, the compiler generates object code. The equivalent code, in
assembly language, is shown below:

LDD 234 //loads value B


ADD 235 //adds value C
STO 567 //stores result in temporary location
LDD 567 //loads value from temporary location
ADD 236 //adds value D
STO 233 //stores result in A

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

© UCLES 2015 9608/33/O/N/15 [Turn over


3

(a) The following assignment statements are invalid.

Give a reason in each case.

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

<letter> has been done for you.

<assignmentstatement> ::=

...................................................................................................................................................

<variable> ::=

...................................................................................................................................................

<number> ::=

...................................................................................................................................................

<letter> ::= A | B | C

<digit> ::=

...................................................................................................................................................

<operator> ::=

...................................................................................................................................................
[6]

© UCLES 2015 9608/33/M/J/15 [Turn over


4

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

(ii) Give one benefit to the company of using virtual machines.

...........................................................................................................................................

.......................................................................................................................................[1]

(iii) Give one drawback to the company of using virtual machines.

...........................................................................................................................................

.......................................................................................................................................[1]

© UCLES 2015 9608/33/M/J/15


12

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.

(a) Name the type of system described.

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

(c) (i) Describe what is meant by feedback in the above system.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[3]

(ii) When the system was designed, various parameters for temperature were set.

Name one of these parameters.

...........................................................................................................................................

.......................................................................................................................................[1]

© UCLES 2015 9608/33/M/J/15


13

(iii) Explain how this parameter value is used by the feedback system.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[2]

Question 6 continues on page 14.

© UCLES 2015 9608/33/M/J/15 [Turn over


14

Each greenhouse has eight sensors (numbered 1–8).

• The byte at address 150 is used to store eight 1-bit flags.

• 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

(d) (i) Interpret the current reading for sensor 2.

...........................................................................................................................................

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

LDD 150 // data loaded from address 150

.......................................................................................................................................[3]

© UCLES 2015 9608/33/M/J/15


2

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 ÷

(a) The following assignment statements are invalid.

Give the reason in each case.

(i) a = b + c

Reason ..............................................................................................................................

.......................................................................................................................................[1]

(ii) a = b – 2;

Reason ..............................................................................................................................

.......................................................................................................................................[1]

(iii) a = dd * cce;

Reason ..............................................................................................................................

.......................................................................................................................................[1]

© UCLES 2015 9608/32/M/J/15


3

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

(i) The programmers prefer to debug their programs using an interpreter.

Give one possible reason why.

...........................................................................................................................................

.......................................................................................................................................[1]

(ii) The company sells compiled versions of its programs.

Give a reason why this helps to protect the security of the source code.

...........................................................................................................................................

.......................................................................................................................................[1]

© UCLES 2015 9608/32/M/J/15 [Turn over


10

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.

(a) Name the type of system described.

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

Greenhouse location Temperature reading

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.

Bit 0 of byte 1 acts as a flag:

• the initial value is zero


• when the reading has been processed it is set to 1

Byte 2 contains the temperature reading (two’s complement integer).

© UCLES 2015 9608/32/M/J/15


11

(i) Interpret the data in byte 1 shown below:

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]

(ii) The system receives a temperature reading of –5 degrees from sensor 6.

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.

LDD 106 // data loaded from address 106

.......................................................................................................................................[4]

(ii) Write the assembly language instruction to set the flag (bit 0) of the byte contained in the
accumulator to 1.

.......................................................................................................................................[2]

© UCLES 2015 9608/32/M/J/15 [Turn over

You might also like