Question 6(d)(ii) 2017 · October-November · Paper 32 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (d)
(ii)
Question 3
Show text version of question
Question 6
Part (d)
(ii)
Question 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. 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.
(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
Question 16
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
87% assigned-topic match · Processor fundamentals › Assembly language
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_32.pdf
