What is the CPU?
The CPU (Central Processing Unit) is often called the brain of the computer. It is a small but incredibly powerful chip inside every computer, phone, and tablet. The CPU is responsible for carrying out the instructions that make programs run.
When you open an app, play a game, or type a document, the CPU is constantly fetching, decoding, and executing billions of tiny instructions every second.
Modern CPUs can perform billions of operations per second. This speed is measured in gigahertz (GHz) — a 3 GHz processor can handle 3 billion clock cycles per second.
The Fetch-Decode-Execute Cycle
The CPU follows a three-step cycle continuously while the computer is running:
- Fetch — the CPU retrieves the next instruction from RAM
- Decode — the CPU works out what the instruction means
- Execute — the CPU carries out the instruction (e.g. add two numbers, move data, compare values)
This cycle repeats billions of times per second, executing your programs one instruction at a time.
Key Parts of the CPU
| Component | Purpose |
|---|---|
| ALU (Arithmetic Logic Unit) | Performs maths and logical operations (add, compare, etc.) |
| Control Unit | Directs the fetch-decode-execute cycle |
| Registers | Tiny, ultra-fast storage areas for data being processed right now |
| Cache | Small amount of very fast memory built into the CPU to store frequently used data |
Clock Speed and Cores
Clock speed is measured in GHz and tells you how many cycles per second the CPU performs. A higher clock speed generally means faster performance.
Modern CPUs have multiple cores — each core is essentially an independent processor. A quad-core CPU can work on four tasks simultaneously.
| CPU Feature | Effect on Performance |
|---|---|
| Higher clock speed | Faster single tasks |
| More cores | Better at running multiple tasks at once |
| Larger cache | Fewer slow trips to RAM |
When buying a computer or phone, look at both clock speed and the number of cores. A 2 GHz quad-core chip may outperform a 3 GHz single-core chip for everyday multitasking.
The CPU and Other Components
The CPU works closely with RAM (which stores the program and data currently in use) and storage (the hard drive or SSD where files are permanently kept). The CPU can access RAM very quickly but must load programs from storage first.
Practice Problems
List the three stages of the fetch-decode-execute cycle and briefly explain what happens at each stage.
Show answer
A CPU has a clock speed of 4 GHz and 6 cores. Explain what each of these specifications tells you about the CPU's performance.