KS3 · Computer Science
The fetch–decode–execute cycle
Every game, video and message on your computer comes down to one tiny loop: get an instruction, work out what it means, do it. Then again. Let's slow it down.
Computer Science · Inside the CPU
Follow the program counter
A tiny program is stored in main memory. Address 0 holds LOAD from 7, address 1 holds ADD 5 and address 2 holds STORE to 7. Address 7 holds a piece of data: the number 20. Step through and watch the CPU run it, one cycle at a time.
Before you press Next: the program counter holds 0. What will it hold straight after the first instruction has been fetched?
Phase: Fetch — instruction 1
Program counter
0
Instruction fetched
LOAD from 7
Decoded as
—
ALU
—
Register
—
Address 7
20
Output
Step 1: The program counter holds 0. That's not an instruction and it's not a count — it's an ADDRESS. So the CPU goes to address 0 in main memory and fetches the instruction stored there: LOAD from 7.
Use Next to move one step at a time. Keep your eye on the program counter box — when does it change?
Who does what?
Match each job to the part of the CPU that does it
Pick a job, then choose the part of the CPU that does it.
Still to sort
Control unit (0)
Decides what happens and directs the cycle.
Where the line is: The control unit works out what needs doing; the ALU does the actual sums and comparisons.
ALU (0)
Arithmetic logic unit: does the arithmetic and logic.
Where the line is: The ALU only acts once the control unit has decoded the instruction.
Registers (0)
Very small, very fast storage inside the CPU.
Where the line is: Registers are inside the CPU. The program itself is stored outside the CPU, in main memory.
Clock (0)
Sets the pace of the cycle.
Where the line is: The clock sets HOW FAST the cycle runs; the control unit directs WHAT happens in it.
Predict, then check
Two CPUs are identical in every way except their clock speed. CPU A runs at 1.5 GHz. CPU B runs at 3 GHz.
Which one can carry out more fetch–decode–execute cycles each second, and by how much?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
One tiny loop, repeated over and over — it's how every program on your computer actually runs.
What you need to know
- A program's instructions, and the data it uses, are stored in main memory (RAM). Every memory location has an address — a number that says where it is.
- The CPU runs a program by repeating the fetch–decode–execute cycle, one instruction after another, many times every second.
- Fetch: the CPU gets the next instruction from main memory, using the address held in the program counter. The program counter is then increased so it points to the next instruction.
- Decode: the control unit works out what the instruction means and what the CPU needs to do. Execute: the CPU carries it out — for example the ALU does a calculation or comparison, or data moves between memory and the CPU.
- Clock speed is measured in hertz (for example gigahertz, GHz). It is the number of cycles the CPU can carry out each second.
The big picture
A program is a list of instructions stored at addresses in main memory. The CPU runs it by repeating the fetch–decode–execute cycle: fetch the instruction at the address in the program counter (which then increases), decode it in the control unit, execute it — for example in the ALU — and go round again. The clock sets the pace, and clock speed is the number of cycles each second.
Key points
Worked example
Problem
The program counter holds 12. The instruction stored at address 12 tells the CPU to compare two numbers to find out which is bigger. Each instruction in this program takes up one address. Describe what happens at each stage of one fetch–decode–execute cycle, and say what the program counter holds at the end.
⚠ Watch out
Saying the program counter holds the next instruction, or that it counts how many instructions have been run. It holds the ADDRESS of the next instruction to fetch — and it increases straight after each fetch, not at the end of the cycle.
Memory hook
Fetch it, decode it, do it — then go again. And think of the program counter as a bookmark: it marks WHERE to read next, not what's written there.
Check yourself
The program counter holds 8. Without looking back: which address does the next instruction come from, what does the program counter hold straight after that fetch, and which part decodes it?
Flashcards
(14)What is stored in main memory while a program runs?
What is a memory address?
What does the program counter hold?
When does the program counter increase?
What happens at the fetch stage?
What happens at the decode stage, and which part does it?
What happens at the execute stage?
What happens straight after execute?
What does ALU stand for, and what does it do?
What two jobs does the control unit do in the cycle?
What are registers?
What does the clock do?
What is clock speed, and what is it measured in?
Why can a CPU with a higher clock speed process more instructions each second?
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 KS3 Computer Science topics
- Abstraction in computational thinking
- Adding binary numbers
- Binary to denary conversion
- Boolean logic: AND, OR, NOT
- Bubble sort
- Building truth tables
- Client-server vs peer-to-peer
- Collecting and recording data
- Comparing sorting algorithms
- Compressing data
- Creating a 3D animation
- Decomposition: splitting problems up
How this lesson was checked. This KS3 Computer Sciencelesson 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 30 September 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.