GCSE · Computer Science · OCR · Spec J277
Fetch-execute cycle
A CPU can't just know what to do next. Every instruction is fetched, decoded, executed, then the whole thing starts again. Let's follow one.
Computer Science · The CPU
Follow one instruction all the way round
One instruction, LOAD 2, travelling from main memory to the accumulator. Each box is a register or a bus.
Before you start: what do you think tells the CPU which instruction to fetch next? Press Next and see.
Phase: Fetch
PC
3
MAR
—
MDR
—
CIR
—
Accumulator
—
Address bus
—
Data bus
—
Output
Step 1: The PC (program counter) holds the memory address of the next instruction the CPU needs to fetch. Here, that's address 3. (The PC is automatically increased by one, so it points to the next instruction in sequence. This walk-through keeps showing 3 and does not show the increase.) (The addresses and values in this walk-through are made up, so you can follow one instruction.)
Press Next, or Play. A lit box is holding or carrying something at that step; a dash means there is nothing to show yet.
Computer Science · Registers
Which register does the job?
Pick a job, then pick the register that does it.
Still to sort
PC (program counter) (0)
MAR (memory address register) (0)
MDR (memory data register) (0)
CIR (current instruction register) (0)
Accumulator (0)
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
How the CPU gets an instruction from memory, works out what it means, and carries it out.
What you need to know
- Every instruction is fetched from main memory in order, decoded, then executed, and then the cycle starts again.
- The program counter (PC) holds the memory address of the next instruction the CPU needs to fetch.
Have a goSuppose the PC holds the number 7. What does that 7 stand for?
The memory address of the next instruction to fetch.
The PC holds an address, not the instruction itself, and it points to the next instruction rather than the one being run.
- In fetch, the PC's address is copied to the memory address register (MAR).
- Next, the MAR sends the address along the address bus to main memory, which sends the instruction back along the data bus.
Have a goPretend the address bus is a delivery van and main memory is the house. Which register hands the address to the van?
The MAR.
It's tempting to say the PC, but the PC's address is first copied to the MAR, and the MAR is the one that sends it along the address bus.
- It waits briefly in the memory data register (MDR), then is copied to the current instruction register (CIR).
Have a goTrue or false: the instruction goes straight from the data bus into the CIR.
False. It waits in the MDR first.
The MDR holds the instruction temporarily, and only then is it copied to the CIR.
- The PC is automatically increased by one, so it points to the next instruction in sequence.
Have a goA fetch starts with the PC holding 12. What will the PC hold once it has been increased?
13.
It is automatically increased by one so it points to the next instruction in sequence, not back at the one just fetched.
- Decode: the control unit decodes the CIR's instruction from binary; it can only run instructions that have been fetched and decoded.
- Execute: the MAR takes the address from the decoded instruction, and the data comes back along the data bus.
- For LOAD 2, the data updates the MDR, then goes to the accumulator, which stores results and holds data produced.
- A bus carries data, addresses and instructions from one component to another, here between the CPU and main memory.
The big picture
The fetch-execute cycle is how the CPU runs instructions: it fetches an instruction from main memory, decodes it, executes it, then starts again. The program counter holds the address of the next instruction, and registers and buses carry each instruction and its data between the CPU and main memory.
Key points
Worked example
Problem
Try a new one. LOAD 5 is stored at address 8, and the number 20 is stored at address 5. The PC holds 8 as the fetch stage starts. What do the PC, MAR, MDR and accumulator hold when LOAD 5 has finished executing?
⚠ Watch out
Mixing up the MAR and the MDR. The MAR holds an address and sends it along the address bus. The MDR temporarily holds what comes back from memory along the data bus.
Memory hook
The PC points ahead, the MAR asks, the MDR waits, the CIR gets decoded, and the accumulator keeps the answer.
Check yourself
In your own words: why can't the control unit run an instruction the moment it has been fetched, and which register is it decoded from?
Flashcards
(14)What are the stages of the fetch-execute cycle?
What does the program counter (PC) hold?
What happens automatically to the PC?
What does the memory address register (MAR) hold in the fetch stage?
What travels along the address bus in fetch?
Which bus brings the instruction back from main memory?
What is the memory data register (MDR) for?
Which register does the control unit decode an instruction from?
What form is an instruction in before it is decoded?
What rule does the control unit follow about running instructions?
What is the MAR updated with in the execute stage?
In the LOAD 2 example, where does the data go after the data bus?
What is a bus?
What is the accumulator?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore OCR GCSE Computer Science topics
How this lesson was checked. This OCR GCSE Computer Science (specification J277)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 14 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.