Year 8 · Autumn 1
Computer Systems · Lesson 2 of 5
The CPU and the fetch–decode–execute cycle
TheoryTopic 8 Inside the computer
Year 8 · Computer Systems · Lesson 2 of 5
You will learn to
- Identify the control unit, the ALU, the registers and the clock, and say what each one does.
- Explain the stored-program idea: instructions and data sit in the same memory.
- Describe the fetch–decode–execute cycle in order, using the PC, MAR and MDR.
- Explain what the address bus and the data bus carry.
Year 8 · Computer Systems · Lesson 2 of 5
Success criteria
You have got it when you can say:
- I can act out one cycle as the memory, the control unit or the ALU.
- I can step the tiny CPU toy through fetch, decode and execute, and say what happens at each step.
- I can say what the PC holds before and after a fetch.
- I can work out that a 2 GHz clock ticks 2 billion times a second.
Year 8 · Computer Systems · Lesson 2 of 5
Retrieval starter
Questions from before. Write your answers, then show them.
- Last lesson
Two transistors in a line (series) light a lamp only when…
A Both gates are onB Either gate is onC Neither gate is on
A. Both gates are on
- Last year
What is the most checks binary search can need on 1,000 sorted items?
A 500B 10C 1,000
B. 10
- Last lesson
Why does an LED need a resistor?
A To limit the current so it doesn't burn outB To make it a different colourC To store electricity
A. To limit the current so it doesn't burn out
Year 8 · Computer Systems · Lesson 2 of 5
Key words (1 of 3)
- Control Unit
- The part of the CPU that fetches, decodes and directs.
- ALU
- Arithmetic Logic Unit: the CPU's calculator for maths and logic.
- Registers
- Tiny storage inside the CPU, like the PC or ACC.
- Cache
- Small, very fast memory on the CPU chip.
Year 8 · Computer Systems · Lesson 2 of 5
Key words (2 of 3)
- Clock speed
- How many cycles a CPU does per second, in GHz.
- Cores
- One complete processing unit inside a CPU.
- CPU
- Central Processing Unit: the processor that runs instructions.
- Register
- Tiny storage inside the CPU, like the PC or ACC.
Year 8 · Computer Systems · Lesson 2 of 5
Key words (3 of 3)
- Bus
- A set of wires that carries addresses, data or control signals between parts of the computer.
- RAM
- Random Access Memory: fast, volatile working memory.
- Volatile
- Loses its contents when the power goes off.
- Embedded system
- A small computer built into a device for one job.
The explanation · step 1 of 3
The parts of the CPU
- Control Unit (CU): the manager. Fetches each instruction, works out what it means, tells the other parts what to do.
- ALU: the calculator. Does maths (+, −) and logic (comparisons, AND, OR, NOT).
- Registers: a few tiny, super-fast storage spaces inside the CPU.
- Cache: small, very fast memory on the chip for things used often.
- Clock: a steady pulse. Each tick lets the CPU take a step.
The explanation · step 2 of 3 · part 1 of 2
Fetch, decode, execute
Fetch
- The PC holds the next address, e.g. 20.
- Copy 20 into the MAR.
- Send it to RAM along the address bus.
- RAM sends back what's at address 20, along the data bus, into the MDR.
- The PC goes up by 1 (to 21).
Decode: the Control Unit works out what the instruction means.
The explanation · step 2 of 3 · part 2 of 2
Fetch, decode, execute (continued)
Execute: do it. The ALU may calculate, data may move, the result goes to the ACC or memory. Then back to fetch.
This loop runs billions of times a second.
The explanation · step 3 of 3
What makes a CPU faster
- Clock speed: cycles per second. 3.5 GHz = 3.5 billion ticks a second.
- Cores: each core is a full processor. 4 cores can do 4 things at once, if the program can be split up.
- Cache size: more cache = fewer slow trips to RAM.
Doubling the cores never quite doubles the speed. Not every job can be split.
The explanation · step 3 of 3
The maths: How long is one clock tick?
Year 8 · Computer Systems · Lesson 2 of 5
Try it: Run a tiny CPU
Year 8 · Computer Systems · Lesson 2 of 5
Quick quiz · 1 of 3
A CPU runs at 2 GHz. How long is one tick?
- A 2 ns
- B 0.2 ns
- C 0.5 ns
C. 0.5 ns
1 ÷ 2 = 0.5 nanoseconds. More GHz = shorter ticks.
Year 8 · Computer Systems · Lesson 2 of 5
Quick quiz · 2 of 3
Why is ROM needed in a computer?
- A To make games run faster
- B To hold the start-up instructions, because RAM is empty at switch-on
- C To store your photos
B. To hold the start-up instructions, because RAM is empty at switch-on
ROM is non-volatile, so the start-up program is still there when the power comes on.
Year 8 · Computer Systems · Lesson 2 of 5
Quick quiz · 3 of 3
Which is an embedded system?
- A A laptop
- B The computer in a washing machine
- C A games console you install games on
B. The computer in a washing machine
It does one fixed job inside a bigger device.
Year 8 · Computer Systems · Lesson 2 of 5
Exit ticket
Answer on paper before you go. Then check.
Which register holds the address of the next instruction?
A MDRB ACCC PC
C. PC The Program Counter points to the next instruction. It goes up by 1 during each fetch.
RAM is volatile. That means…
A It can catch fireB It loses everything when power is offC It is very fast
B. It loses everything when power is off Volatile = forgets without power.