KeyStage

Key Stage 3 computing · Computer systems

KS3 fetch, decode, execute: how a CPU runs a program

In Key Stage 3, children look inside a computer to see how it actually follows a program. They learn that a program is a list of very simple instructions stored in memory as binary, and that the processor fetches, decodes and executes them one at a time, billions of times a second. Alongside this they meet the hardware and software parts of a computer system and how those parts work together and talk to other systems.

How a CPU runs instructions, explained

A computer feels clever, but the processor at its centre, the CPU, can only do very small jobs: copy a number, add two numbers, compare two numbers, jump to a different instruction. Everything you do on a laptop or phone is built from enormous numbers of these tiny steps. Teachers use this to make a point that surprises many children: the machine does not understand a game or a photo. It follows instructions, extremely quickly and without ever getting bored or tired.

The key idea is that instructions are stored in the computer’s memory in the same way as data, as patterns of binary digits (1s and 0s). The CPU repeats a loop called the fetch, decode, execute cycle. It fetches the next instruction from memory, decodes it to work out what is being asked, and then executes it. A tiny store inside the CPU called the program counter keeps track of the address of the next instruction. Other small, very fast stores called registers hold the numbers being worked on right now. Inside the CPU, one part (the control unit) directs the cycle and another (the arithmetic logic unit) does the sums and comparisons. Schools choose how much of this detail to teach; some stay with fetch, decode, execute, while others name the registers.

Children also learn the difference between kinds of storage, which is where many misunderstandings start. Main memory (RAM) is the working space: fast, but it is emptied when the power goes off. Secondary storage, such as a solid-state drive in a laptop, keeps files and programs permanently but is much slower to read. When you open a program it is copied from secondary storage into RAM so that the CPU can reach it quickly. Clock speed (measured in hertz, where a gigahertz is a billion cycles a second), the number of cores and a small fast store called cache all affect how quickly a processor can work.

The programme of study also asks pupils to understand the hardware and software that make up a system and how they communicate. Hardware is the physical equipment: the CPU, memory, storage, and the input and output devices such as keyboards, screens and speakers. Software is the programs. System software, mainly the operating system, manages the hardware, runs other programs and gives them a fair share of memory and processing time. Application software is what we choose to use, such as a word processor or a game. The operating system uses small programs called drivers to talk to each device. Computers also communicate with one another across networks by following agreed rules called protocols, which children meet in more detail alongside networks.

None of this needs a parent to know the details, and the aim is not to memorise component names. Teachers want children to explain what happens between pressing a key and seeing a letter appear, and to reason about questions such as why a computer with more RAM can juggle more programs at once. That kind of explaining, using the right words in the right order, is the skill that carries forward into GCSE computer science.

Words your child will hear

CPU
The central processing unit: the part that fetches, decodes and executes instructions.
Fetch, decode, execute
The repeating cycle in which the CPU gets an instruction from memory, works out what it means and carries it out.
RAM
Random access memory: fast working memory that holds the programs and data in use, and is cleared when the power is off.
Secondary storage
Long-term storage for files and programs, such as a solid-state drive, that keeps its contents without power.
Register
A tiny, very fast store inside the CPU that holds the number or address being used right now.
Operating system
System software that manages the hardware and memory and lets other programs run.
Clock speed
How many cycles the processor completes each second, measured in hertz. It is only one factor in how fast a computer feels.

What the National Curriculum says

In Key Stage 3, pupils should be taught to:

  • Understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits
  • Understand the hardware and software components that make up computer systems, and how they communicate with one another and with other systems

Objectives from the National Curriculum in England, © Crown copyright, used under the Open Government Licence v3.0.

A worked example: tracing a tiny program

A simple computer has this program in memory. LOAD 10 copies the number at address 10 into the accumulator, a register that holds the current result. ADD 11 adds the number at address 11 to the accumulator. STORE 12 copies the accumulator into address 12. Address 10 holds 7 and address 11 holds 5. What does address 12 hold when the program stops?

  1. Set out memory. The program counter starts at 0, so the CPU will fetch the instruction at address 0 first. The accumulator starts empty.
    Address  Contents
    0        LOAD 10
    1        ADD 11
    2        STORE 12
    3        STOP
    10       7
    11       5
    12       (empty)
  2. Cycle 1. Fetch LOAD 10 from address 0 and add 1 to the program counter. Decode: copy the contents of address 10. Execute: the accumulator now holds 7.
  3. Cycle 2. Fetch ADD 11 from address 1, and the program counter becomes 2. Decode: add the contents of address 11. Execute: 7 + 5 = 12, so the accumulator holds 12.
  4. Cycle 3. Fetch STORE 12 from address 2. Execute: copy the accumulator, 12, into address 12. Cycle 4 fetches STOP, and the CPU halts. Keeping a trace table is how pupils check their thinking.
    Cycle  Instruction  PC after  Acc
    1      LOAD 10      1         7
    2      ADD 11       2         12
    3      STORE 12     3         12
    4      STOP         4         12

Address 12 holds 12. The CPU needed four trips round the fetch, decode, execute cycle, and the instructions and the numbers were both sitting in memory as binary.

Common mistakes and how to help

Thinking the CPU “thinks” or understands what the program is for

Films and everyday language describe computers as smart or as having a brain, so children assume the processor makes judgements.

What helps: Stress that it only follows simple instructions in order. Tracing a short program by hand, as in the example, shows that “clever” behaviour comes from many small steps done very fast.

Mixing up memory and storage

Shops and adverts use “memory” loosely, and a phone might be described as 128 gigabytes of memory when that is its storage.

What helps: Use a desk analogy: RAM is the desk surface where you work on things right now, and secondary storage is the filing cabinet. Ask what happens to an unsaved document if the power fails.

Believing a higher clock speed always means a faster computer

Clock speed is the easiest number to compare, so it gets treated as the whole story.

What helps: Explain that the amount of RAM, the number of cores, cache and storage type also matter. A processor doing more work in each cycle can beat one with a higher number.

Picturing programs and data as stored in different ways

A photo looks different from a program, so children assume the computer keeps them in different forms.

What helps: Both are binary patterns in memory. A pattern is treated as an instruction when the program counter points to it and the CPU fetches it as one; otherwise it is used as data. This is why a program is saved, copied and loaded just like any other file.

How to help at home

  • Be the CPU. Write three or four simple instructions on paper slips, such as “write down 6”, “add 3”, “double it”, and let your child follow them one at a time with a pencil. Then ask them to describe what they did using the words fetch, decode and execute.
  • Look at your own devices. Find the settings page that shows how much storage and memory a phone or laptop has and talk about which number is which. Ask why opening many programs slows things down.
  • Ask a ‘what happens when…’ question. Pick an everyday action, such as pressing a key or opening a photo, and ask your child to explain the journey from input to output. It is fine if the answer is incomplete; the thinking is the point.
  • Compare two specifications. Look at the specifications of two devices and ask which would be better for gaming, for homework or for video, and why. This turns vocabulary into reasoning without a worksheet.

Leads on to

More on computer systems

Everything in Key Stage 3 computing

Updated .