1.4. Processor fundamentals
A subsection of Computer Science, 9608, through 1. Theory Fundamentals
Listing 10 of 63 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
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 The current contents of addresses 601 to 603 are: Most significant Least significant State the information that the current contents of addresses 601 to 603 will provide to the driver. 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. 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 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 numeric operand CMP #n Compare the contents of ACC with the number n JPE Following a compare instruction, jump to or if the compare was True JMP Jump to or : Labels an instruction Note: # denotes immediate addressing B denotes a binary number, for example B01001010 & denotes a hexadecimal number, for example &4A 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. 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 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:
9608_w20_qp_32
THEORY
2020
Paper 3, Variant 2
Questions Discovered
63