The CPU and Fetch–Execute Cycle
What the CPU does
The CPU (Central Processing Unit) is the "brain" of the computer. It fetches, decodes and executes instructions from memory, one after another, to run programs. Its performance depends on its internal parts and a few key characteristics.
The purpose of the CPU
The CPU continuously carries out the fetch–decode–execute cycle: it collects an instruction from main memory (RAM), works out what it means, and carries it out — billions of times per second.
Von Neumann architecture
Most CPUs follow the von Neumann design, where programs and data are stored together in the same memory. It uses several key registers (tiny, extremely fast storage inside the CPU):
| Register | Purpose |
|---|---|
| PC – Program Counter | Holds the address of the next instruction to fetch |
| MAR – Memory Address Register | Holds the address being read from / written to |
| MDR – Memory Data Register | Holds the data/instruction just fetched from or sent to memory |
| ACC – Accumulator | Holds the result of calculations |
| CIR – Current Instruction Register | Holds the instruction currently being decoded/executed |
Other key parts: the ALU (Arithmetic Logic Unit) does calculations and logic; the Control Unit (CU) coordinates everything; cache stores frequently used data close to the CPU.
The fetch–decode–execute cycle
1. Fetch – the instruction at the address in the PC is copied from memory into the CPU (via the MAR and MDR). The PC increases by 1 ready for the next instruction.
2. Decode – the Control Unit works out what the instruction means and what's needed to carry it out.
3. Execute – the instruction is carried out (e.g. the ALU does a calculation and stores the result in the ACC).
Then the cycle repeats.
Factors affecting CPU performance
- Clock speed (measured in hertz, e.g. 3.5 GHz) – how many cycles per second. Higher = more instructions per second.
- Number of cores – each core can process instructions independently, so more cores can do more tasks at once (if software supports it).
- Cache size – larger/faster cache means the CPU waits less for data from slower RAM. Bigger cache = better performance.
Worked example
A CPU has a clock speed of 2 GHz. Roughly how many cycles per second is that?
- 2 GHz = 2 × 10⁹ = 2 billion cycles per second (one simple instruction can often be handled per cycle).
Common mistakes
- Confusing the PC (address of next instruction) with the MAR (address currently being accessed).
- Saying more cores always makes every program faster — only if the software is written to use them.
- Forgetting the PC increments during the fetch stage.
Exam tips
- Learn the fetch–decode–execute stages in order and what happens in each.
- Be able to state the job of each register in one line.
- For "how to improve performance" questions, mention clock speed, cores and cache with a reason for each.
Key facts to remember
- CPU runs the fetch–decode–execute cycle continuously.
- Von Neumann: data and instructions share memory; key registers are PC, MAR, MDR, ACC, CIR; the ALU calculates and the CU controls.
- Performance improves with higher clock speed, more cores, and a larger cache.