A CPU does one simple thing billions of times a second: it fetches an instruction from memory, works out what it means and carries it out. Follow one instruction through every register and bus on its way.
The CPU runs a program by repeating the fetch-decode-execute (FDE) cycle. Fetch: the address in the PC is copied to the MAR and sent along the address bus; the instruction at that address in RAM comes back along the data bus to the MDR and is copied to the CIR; the PC is incremented. Decode: the CU decodes the instruction in the CIR. Execute: the CU sends signals to carry it out, and the ALU does any calculation, with the result stored in the ACC.
Fig. 1: the three stages of the cycle, repeated for every instruction
Section 01
The fetch stage.
Step through the cycle in the lab and watch the values move between registers. Fetching gets the next instruction out of RAM and into the CPU.
The PC holds the address of the next instruction. This address is copied into the MAR.
The address is sent from the MAR to RAM along the address bus; the CU sends a read signal along the control bus.
The instruction stored at that address is sent along the data bus to the MDR.
The instruction is copied from the MDR into the CIR.
The PC is incremented (increased by 1) so it points to the next instruction.
Examiner trap
The PC is incremented during the fetch stage, ready for the next cycle. It is not incremented after the instruction is executed.
Section 02
Decode and execute.
Now the CPU knows what the instruction is, but not yet what it means. The control unit works that out, then makes it happen.
Decode: the CU decodes the instruction held in the CIR, splitting it into the operation (what to do) and the data or address it uses.
Execute: the CU sends control signals to the parts that need to act. If the instruction needs data from memory, its address goes to the MAR and the data comes back into the MDR.
Calculate: the ALU carries out any arithmetic or logic, and the result is stored in the ACC.
Repeat: the cycle starts again with the address now in the PC.
Worked example Trace one instruction
The PC holds 20. Address 20 holds the instruction ADD 26, and address 26 holds the value 5. The ACC holds 7. Describe what happens.
Fetch: 20 is copied from the PC to the MAR and sent along the address bus.
ADD 26 comes back along the data bus to the MDR, then is copied to the CIR. The PC becomes 21.
Decode: the CU decodes ADD 26: add the value at address 26 to the ACC.
Execute: 26 goes to the MAR; the value 5 comes back into the MDR; the ALU adds 7 + 5.
Answer: The ACC holds 12 and the PC holds 21
Your turn
After the fetch stage above, which register holds the instruction ADD 26, and what value is in the PC?
The CIR (and the MDR) holds ADD 26; the PC holds 21.
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
In the lab, where is the address in the PC copied to first?
Quick check+10 XP
Which bus carries the instruction from RAM to the CPU?
Quick check+10 XP
Which component decodes the instruction?
Quick check+10 XP
When is the program counter incremented?
Section 03
Order matters.
Exam questions often ask you to describe the cycle, or to put the steps in order. Each correct step, in the correct order and naming the correct register or bus, earns a mark.
Stage
Register or component
What happens
Fetch
PC → MAR
Address of the next instruction copied
Fetch
Address bus, control bus
Address sent to RAM with a read signal
Fetch
Data bus → MDR → CIR
Instruction brought into the CPU
Fetch
PC
Incremented
Decode
CU
Instruction in the CIR decoded
Execute
CU, ALU, ACC
Signals sent; calculation done; result in ACC
Examiner trap
Name the registers in full or by their correct initials. "It goes to the register" does not earn the mark: say "copied from the MDR to the CIR".
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
Which sequence is correct for the fetch stage?
Exam style+20 XP
An instruction adds two numbers. Where is the result stored?
Exam style+20 XP
Which register holds the instruction while the control unit decodes it?
Exam style+20 XP
The PC holds 45 before an instruction is fetched. What does it hold just after the fetch stage, for a normal instruction?
Skill unlocked
The fetch-decode-execute cycle, mastered.
This skill is now recorded on your profile. Keep the chain going.