The CPU and the fetch-execute cycle
The central processing unit runs every instruction a program contains, billions of times a second. You need to name its parts, describe what happens in each step of the cycle, and explain what makes one CPU faster than another.
Part 1 of 3: Learn it
In short
- The CPU fetches an instruction from memory, decodes it, then executes it, and repeats.
- The program counter holds the address of the next instruction; the MAR and MDR handle the trip to memory.
- Clock speed, number of cores and cache size all affect performance.
Where this is in your specification
Spec points: AQA 3.4.1 and 3.4.5, OCR 1.1.1 to 1.1.3, Edexcel Topic 3
| Board | Topic: Computer systems |
|---|---|
| AQA 8525 | 3.4.1, 3.4.3 and 3.4.5 |
| Edexcel 1CP2 | Topic 3 |
| OCR J277 | 1.1.1 to 1.1.3, 1.2.1, 1.2.2, 1.5.1 and 1.5.2 |
| Eduqas C500 | 1 Hardware; 6 Operating systems |
| Cambridge IGCSE 0478 | 3.1 to 3.3, 4.1 |
| National 5 C816 75 | Computer systems: computer structure |
Parts of the CPU
| Part | Job |
|---|---|
| Arithmetic logic unit (ALU) | does calculations and logical comparisons |
| Control unit (CU) | decodes instructions and sends control signals to coordinate the other parts |
| Cache | a small amount of very fast memory on or near the CPU, keeping copies of the instructions and data needed most often |
| Registers | tiny, very fast stores inside the CPU, each with one job |
| Clock | sends regular pulses; each pulse lets the CPU take one step |
These follow the Von Neumann architecture, where instructions and data are stored together in the same memory.
The registers
- Program counter (PC): the address of the next instruction to fetch.
- Memory address register (MAR): the address of the memory location about to be read or written.
- Memory data register (MDR): the data or instruction just fetched from memory, or about to be written to it.
- Accumulator (ACC): holds results from the ALU.
The fetch-decode-execute cycle
- Fetch: the address in the PC is copied into the MAR. The instruction at that address is brought from memory into the MDR. The PC goes up by one, ready for the next instruction.
- Decode: the control unit works out what the instruction means.
- Execute: the instruction is carried out, for example the ALU does a calculation and the result goes in the accumulator, or data is loaded from or stored in memory.
Performance and embedded systems
A higher clock speed means more cycles each second: 3.2 GHz is 3.2 billion cycles a second. More cores let several instructions run at once, but only if the software can split its work between them. A bigger cache means fewer slow trips to main memory.
An embedded system is a computer built into a larger device to do one dedicated job, such as the controller in a washing machine. They are usually small, cheap and low power.
What does the ALU do?
Show the answer
It carries out arithmetic calculations and logical comparisons.
Part 2 of 3: See it worked
Worked examples
Example 1
Explain why doubling the number of cores does not always double the speed of a program.
- Some tasks must be done one step after another and cannot be split
- Software has to be written to use more than one core
- Cores also share resources, such as the cache and the path to memory
Answer: Only work that can be split between cores speeds up, so the gain is usually less than double.
Example 2
A CPU's clock speed is 2.5 GHz. How many cycles does it carry out each second?
- 1 GHz = 1 000 000 000 cycles per second
- 2.5 × 1 000 000 000
Answer: 2 500 000 000 cycles (2.5 billion).
Common mistakes
- Mixing up the MAR (an address) and the MDR (the data).
- Saying the PC holds the current instruction. It holds the address of the next one.
- Saying more cores always means a faster computer.
- Describing cache as a kind of secondary storage. It is a small, fast memory close to the CPU.
What happens to the program counter during the fetch stage?
Show the answer
It is incremented so it points to the next instruction.
Part 3 of 3: Test yourself
Check yourself
Answer each one in your head or on paper first, then open it to check.
What does the ALU do?
It carries out arithmetic calculations and logical comparisons.
What happens to the program counter during the fetch stage?
It is incremented so it points to the next instruction.
Give one example of an embedded system.
Any device with a built-in dedicated computer, such as a washing machine, microwave or car engine controller.
Jobs that use this
- Electrical engineer (öffnet einen neuen Tab)
- Software developer (öffnet einen neuen Tab)
- Computer games developer (öffnet einen neuen Tab)
Each link opens the job profile on the National Careers Service (England). In the rest of the UK: My World of Work (Scotland), Careers Wales, nidirect careers (Northern Ireland).
Diese Lernzettel sind auf Englisch, weil sie britischen Prüfungslehrplänen folgen.
Full lessons and marked practice for this course are coming soon to Brainlag Learn. See courses