Menu

Parts of the CPU

Stored Program Computers

A program is a sequence of instructions that the CPU carries out one after another. The data are the values those instructions work on.

Imagine a program that plays a ringtone. Its instructions say things like "take the next note from the tune and sound it for the length given". The notes and their lengths are the data. On their own, the instructions have nothing to play; on their own, the data are just a list of notes and numbers. You need both.

Where the program lives

A computer that uses Von Neumann architecture keeps the program in memory instead of building it into the hardware. The instructions sit in memory alongside the data, and the CPU fetches them from there, one at a time, as it works through the program.

This is what makes a computer general purpose. The hardware only ever does the same small set of jobs, so it doesn't need to know in advance whether it is helping you write an essay or play a game. Load a different program into memory and the same machine does a completely different job.

Same hardware, different job

Suppose you open a photo editor on a laptop. Its instructions are loaded into memory and the CPU begins carrying them out. Later you open a spreadsheet instead: a new set of instructions is loaded into memory in its place, and the CPU carries those out. Nothing inside the laptop has been rebuilt or rewired.

Program built into the hardwareProgram held in memory
Where the program isBuilt into the circuitsHeld in memory with the data
To run a different programA new circuit is neededLoad the new program into memory

The CPU works through the instructions by repeating the fetch-decode-execute cycle, and the same cycle works for every program you load.

Practise this