Each register in the simplified model has one job, and a good answer names the register by what it holds. That is an address, a piece of data, the current instruction, the next address or a working result.
This lesson builds on tracing the instruction cycle and belongs to hardware and processing. Next you will see where programs and files are kept.
What does each register hold?
| Register | Holds | Changes when |
|---|---|---|
| PC (program counter) | Address of the next instruction | Increased during every fetch; overwritten by a jump |
| MAR (memory address register) | Address of the location being read or written | A fetch starts, or a load or store runs |
| MDR (memory data register) | The data or instruction just read, or about to be written | Memory is read or written |
| CIR (current instruction register) | The instruction being decoded and executed | The fetch finishes |
| ACC (accumulator) | Working value and result of arithmetic or logic | Load, arithmetic or logic instruction executes |
Two parts work with the registers.
The ALU (arithmetic logic unit) does calculations and comparisons. The control unit decodes the instruction and sends control signals. The registers sit alongside them inside the processor.
Three buses carry the signals between the processor and memory: the address bus (addresses), the data bus (data and instructions) and the control bus (control signals such as read or write).
Worked example
The ACC holds 20 and address 500 holds 9. The instruction in the CIR is ADD 500, and the next instruction is at address 41. A question asks: name the register for each statement.
- “It holds 500 while memory is accessed.” This is an address, so MAR.
- “It holds 9 after memory is read.” This is data, so MDR.
- “It holds
ADD 500during decode.” This is the instruction, so CIR. - “It holds 41.” The address of the next instruction is the PC. (It was already increased during the fetch.)
- “It holds 29 after the instruction finishes.” The result is the ACC, because 20 + 9 = 29.
Notice that the answer for each is chosen by asking “what kind of thing is this: an address, data, an instruction or a result?”
The mistake to watch for
Students often say the MAR holds data because the MAR is “connected to memory”.
Mistaken answer: “The MAR holds the value 9 read from address 500.”
The value is data, and data passes through the MDR. The MAR holds the address 500.
Correct it by pairing the registers: MAR with the address bus, MDR with the data bus. The MAR is also not the same as the PC. The PC holds the address of the next instruction; the MAR holds whatever address is being accessed right now, which may be an instruction or a data location.
Check yourself
1. A store instruction writes 44 into address 310. Which register holds 310 and which holds 44 just before the write?
Show answer
The MAR holds 310 (the address). The MDR holds 44 (the data to be written).
2. After a fetch, the PC holds 77. What address was fetched, assuming the PC increases by 1 each fetch?
Show answer
The PC was 76 before the fetch, so the instruction came from address 76. The MAR held 76 during the fetch.
3. True or false: the accumulator holds the instruction being executed. Give a reason.
Show answer
False. The CIR holds the instruction. The accumulator holds values being calculated and the result.
Where this leads next
Use the table above as a checklist while you complete the hardware and processing practice set. The restricted pseudocode trace trainer is a good place to watch registers change in sequence.
Naming the right register is a small skill, but it is where many hardware marks are won or lost. Our teachers in online one-to-one Computer Science tuition can drill it with new scenarios until you answer without hesitating.