1. Theory Fundamentals
A section of Computer Science, 9608
Listing 10 of 304 questions
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 Address 500 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. Door 1 Door 2 Door 3 Door 4 Door 5 Door 6 Door 7 Door 8 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 LDD Load the contents of the location at the given address to ACC STO Store the contents of ACC at the given address AND &n Bitwise AND the contents of ACC with the hexadecimal number n CMP &n Compare the contents of ACC with the hexadecimal number n JPE Following a compare instruction, jump to or if the compare was True : Labels an instruction WAIT Macro to wait one second before the next instruction is executed After rechecking the doors, address 500 now contains 10101010. 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 Label Op code Operand CHECK1: LDD AND &80 CMP &00 JPE DOOR1 LDM &FF DOOR1: STO WAIT LDM &00 STO WAIT JMP CHECK1 Write the assembly language instructions to check door 2. Instruction Label Op code Operand Explain how the check door routines show a flashing light or no light.
9608_s20_qp_31
THEORY
2020
Paper 3, Variant 1
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 Address 500 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. Door 1 Door 2 Door 3 Door 4 Door 5 Door 6 Door 7 Door 8 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 LDD Load the contents of the location at the given address to ACC STO Store the contents of ACC at the given address AND &n Bitwise AND the contents of ACC with the hexadecimal number n CMP &n Compare the contents of ACC with the hexadecimal number n JPE Following a compare instruction, jump to or if the compare was True : Labels an instruction WAIT Macro to wait one second before the next instruction is executed After rechecking the doors, address 500 now contains 10101010. 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 Label Op code Operand CHECK1: LDD AND &80 CMP &00 JPE DOOR1 LDM &FF DOOR1: STO WAIT LDM &00 STO WAIT JMP CHECK1 Write the assembly language instructions to check door 2. Instruction Label Op code Operand Explain how the check door routines show a flashing light or no light.
9608_s20_qp_33
THEORY
2020
Paper 3, Variant 3
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. State the name given to the type of system described. Justify your answer to part . 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. Greenhouse 1 Greenhouse 2 Greenhouse 3 Greenhouse 4 State the greenhouse numberwhere the temperature is out of range and give the valueof these temperaturein denary. 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 means that the heater is off. • A value of 1 means that the ventilation is open. • A value of 0 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 Heater Ventilation Show the pattern of bits when the heater is on for greenhouses 1 and 2 only and no ventilation is open. 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 LDD Load the contents of the location at the given address to ACC STO Store the contents of ACC at the given address AND &n Bitwise AND operation of the contents of ACC with the hexadecimal number n LSL #n Bits in ACC are shifted denary number n places to the left. Zeros are introduced at the right hand end CMP &n Compare the contents of ACC with the hexadecimal number n JPE Following a compare instruction, jump to or if the compare was True : Labels an instruction 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. These assembly language instructions check for an error in the greenhouse 1 system. LDD AND &88 CMP &88 JPE ERROR Explain the purpose of each instruction. Write the assembly language instructions to check for an error in the greenhouse 2 system.
9608_s21_qp_32
THEORY
2021
Paper 3, Variant 2
Questions Discovered
304