Computer Architecture
Hardware
A register is a tiny, extremely fast storage location built directly into the CPU. Each register holds a small amount of data needed during one step of the fetch-decode-execute cycle.
Registers are much faster than RAM but only hold a handful of bytes. Each register has a specific job. The five you must know:
| Name | Acronym | Purpose |
|---|---|---|
| Program Counter | PC | Holds the memory address of the next instruction to be fetched. Increments by 1 each time an instruction is fetched, so the CPU naturally walks through the program in order |
| Memory Address Register | MAR | Holds the memory address that the CPU is about to read from or write to. The CPU puts the MAR's contents onto the address bus |
| Memory Data Register | MDR | Holds the data or instruction that has just been read from (or is about to be written to) the address in the MAR. The MDR is the staging area for the data bus |
| Current Instruction Register | CIR | Holds the instruction currently being decoded or executed. The CPU copies the instruction from the MDR into the CIR so the rest of the CPU can act on it |
| Accumulator | ACC | Holds the result of the most recent ALU operation (or an operand being fed to the ALU). Almost every arithmetic result ends up in the ACC |
Common exam question
Naming the registers used in each stage of the cycle
Question: Give the name of two registers used in the fetch stage, one register used in the execute stage, or three other registers in the CPU besides the one already named (1 mark per register).
Asked in 3 of the 17 papers, marked one mark per correct register from a list, with the full name or the acronym accepted. For the fetch stage the credited registers are the program counter (PC), the memory address register (MAR), the memory data register (MDR) and the current instruction register (CIR); when the stem has already placed the instruction in the MDR, "two other registers" means two of the remaining three. For the execute stage the credited registers are the accumulator (ACC), the MAR and the MDR. Asked for three registers other than the MDR with no stage given, any three of the PC, MAR, CIR and ACC score.
How to memorise their roles
A useful one-line answer template for register questions:
"The [] stores [what value]. The then uses it to [purpose during the cycle]."
For example: "The MAR holds the memory address of the next instruction, which is sent to memory along the address bus so the instruction can be fetched."
Common exam question
Describing the role of a register
Question: Describe the role of the MDR, the MAR or a register in the fetch-decode-execute cycle, or correct wrong statements about what each register stores (2–4 marks).
Asked in 5 of the 17 papers. Two-mark descriptions are a point plus a development: what the register stores, then the detail. The MAR stores an address: of the next instruction or data to fetch, or where data will be written. The MDR stores data or an instruction fetched from memory or about to be written to it. A register holds data, an address or an instruction temporarily. Table descriptions are one mark each: the PC holds the address of the next instruction to fetch; the accumulator holds the interim result of a calculation.
The correction question gives a mark per wrong statement spotted and one per correction: the MAR stores addresses, not instructions, and the MDR's data arrives along the data bus from the address in the MAR, not from the PC.
Quick check
4 short questions on this note. See what has stuck, and where to look if something hasn't.