Syllabus & Goals 3 min
Cambridge 3.1 · Computer architecture Paper 1 · Computer Systems
By the end of this lesson you can:
- Describe the three stages of the fetch–decode–execute cycle.
- State which registers are used at each stage.
- Explain how the program counter moves through a program.
Recap / Warm-Up 5 min
Last lesson you met the registers (PC, MAR, MDR, CIR, ACC). Now you'll see them work together to run an instruction.
Quick starter
Which register holds the address of the next instruction to be fetched?
Reveal the answer
The Program Counter (PC). After each fetch it increases by 1 to point to the following instruction.
Key Concept 14 min
The CPU runs a program by repeating one cycle for every instruction: fetch it from memory, decode it, then execute it.
Step by step, with the registers
- The PC holds the address of the next instruction; this address is copied to the MAR (using the address bus).
- The instruction at that address is copied into the MDR (using the data bus).
- The contents of the MDR are copied into the CIR.
- The PC is incremented by 1 so it points to the next instruction.
- The instruction in the CIR is decoded, then executed by sending control signals (using the control bus).
Worked Example 12 min
Suppose the PC holds address 20. Trace one full cycle:
| Stage | What happens |
|---|---|
| Fetch | PC (20) → MAR. Instruction at 20 → MDR → CIR. PC becomes 21. |
| Decode | The CU decodes the instruction in the CIR. |
| Execute | The CU sends control signals; any calculation uses the ALU and ACC. |
The cycle as a loop
Cambridge pseudocode
// The fetch-decode-execute cycle, one pass per instruction
DECLARE PC, MAR : INTEGER
DECLARE CIR : STRING
PC ← 0
WHILE MoreInstructions = TRUE
MAR ← PC
CIR ← Memory[MAR]
PC ← PC + 1
CALL Decode(CIR)
CALL Execute(CIR)
ENDWHILEA simplified version in Python (IDLE)
# A simplified fetch-decode-execute cycle pc = 0 memory = ["LOAD", "ADD", "STORE", "STOP"] while pc < len(memory): cir = memory[pc] pc = pc + 1 print("Decode and execute:", cir) if cir == "STOP": break
Output
Decode and execute: LOAD Decode and execute: ADD Decode and execute: STORE Decode and execute: STOP
Try It Yourself 12 min
Goal: List the three stages of the cycle, in order.
Goal: Put these in the correct order: PC incremented · instruction copied to CIR · PC copied to MAR · instruction executed.
Goal: Explain why the PC is incremented during the fetch stage rather than after the instruction has executed.
📝 Exam Practice 10 min
Identify the register that stores the instruction currently being decoded.
Mark scheme
- The Current Instruction Register (CIR) (1).
Describe what happens during the fetch stage of the cycle.
Mark scheme
- The address in the PC is copied to the MAR (1).
- The instruction at that address is copied (via the data bus) to the MDR, then the CIR (1).
- The PC is incremented by 1 (1).
State which bus carries the control signals during the execute stage.
Mark scheme
- The control bus (1).
Recap & Key Terms 3 min
The CPU loops: fetch (PC → MAR, instruction → MDR → CIR, PC + 1), decode(the CU works out the instruction) and execute (control signals sent; the ALU/ACC do any sums). This repeats for every instruction.
- Fetch–decode–execute cycle
- The repeating process by which the CPU runs each instruction.
- Program Counter (PC)
- Holds the address of the next instruction; incremented each fetch.
- Current Instruction Register (CIR)
- Holds the instruction being decoded and executed.
- Accumulator (ACC)
- Holds intermediate results during ALU calculations.
Homework 1 min
Task (≤ 15 min): Write the five steps of one fetch–decode–execute cycle in order, naming the register used at each step.
Model answer
- PC → MAR (address of next instruction).
- Instruction at that address → MDR.
- MDR → CIR.
- PC incremented by 1.
- CIR decoded, then executed (control signals sent; ALU/ACC used for any calculation).