Question 6(c)(iii) 2017 · October-November · Paper 31 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (c)
(iii)
Question 3
Show text version of question
Question 6
Part (c)
(iii)
Question 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.
below the minimum temperature. 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.
Question 13
Question 6(c) continues on the next page.
Question 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
Question 15
(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.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................................................................
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.
Why this question appears here
71% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_w17_qp_31.pdf
