9608_w17_qp_32
A paper of Computer Science, 9608
Questions:
6
Year:
2017
Paper:
3
Variant:
2

Login to start this paper & get access to powerful tools

1
2
The following diagram shows four descriptions and two types of processor. Draw lines to connect each description to the appropriate type of processor. Description Type of processor It has a simplified set of instructions. Emphasis is on the hardware rather than the software. CISC It makes extensive use of general purpose registers. RISC Many instruction formats are available. In a RISC processor, instructions are processed using pipelining. Explain what is meant by pipelining. The following table shows the five stages that occur when instructions are fetched and executed. The table also shows a number of time intervals. Two instructions, D followed by E, are fetched and executed. The ‘E’ in the incomplete table shows that instruction E has been fetched in time interval 2. Complete each row of the table. Time interval Stage Fetch instruction E Read registers and decode instruction Execute instruction Access operand in memory Write result to register The instruction set for a RISC processor that allows pipelining includes the following instruction. Instruction Explanation Op code Operands ADD , , Add the integers in registers op1 and op2. Place the result in register dest. A program contains the following three instructions. ADD r3, r2, r1 ADD r5, r4, r3 ADD r10, r9, r8 Explain why pipelining fails for the first two instructions. The instructions were produced by a compiler after translation of a high-level language program. The compiler is not capable of code optimisation. State how the code from the compiler could have been optimised to overcome the problem in part .
3
4
5
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. State one other type of sensor that could be used with this system. Justify your choice. Sensor Justification Describe why feedback is important in this system. 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. Explain how the parameter identified in part is used in the feedback process. 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. Give the denary value of the current reading for Sensor 5. 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 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 Bitwise AND operation of the contents of ACC with the contents of . XOR #n Bitwise XOR operation of the contents of ACC with the operand. XOR Bitwise XOR operation of the contents of ACC with the contents of . OR #n Bitwise OR operation of the contents of ACC with the operand. OR Bitwise OR operation of the contents of ACC with the contents of . 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