Worked solution from the Processor Fundamentals Paper 1 Theory Fundamentals booklet, Part 2 of 3.
Work on the bits, one instruction at a time:
AND 101: 0000 1111 AND 1010 1110 = 0000 1110
LDM #100: 100 = 64 + 32 + 4 = 0110 0100
XOR &F1: &F1 = 1111 0001. 0000 0001 XOR 1111 0001 = 1111 0000
CMP 101 only compares, so the ACC does not change.
| Current contents of the ACC | Instruction | Contents of the ACC after |
|---|---|---|
| 0000 1111 | AND 101 | 0000 1110 |
| 0000 0000 | LDM #100 | 0110 0100 |
| 0000 0001 | XOR &F1 | 1111 0000 |
| 0001 0001 | CMP 101 | 0001 0001 |
Row 1 correct [1]
Row 2 correct [1]
Row 3 correct [1]
Row 4 correct [1]
The MAR stores the address of the next instruction or data to be read from, or written to, memory [1]
The address is received from the Program Counter (PC) [1]
The MDR stores the data/instruction that has been read from (or is to be written to) the address in the MAR [1]
The instruction then passes to the CIR to be decoded and executed [1]
Loading data into the accumulator: data movement [1]
Incrementing the index register: arithmetic operations [1]
Branching to another address: conditional and unconditional jump (branch) instructions [1]
▶ Topic lesson
A lesson on this topic · by Craig'n'Dave. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.