The CPU
- The central processing unit (CPU) processes data and instructions by carrying out the fetch–execute cycle, billions of times a second.
- Control unit (CU): decodes instructions and sends out control signals to coordinate the other parts.
- Arithmetic logic unit (ALU): carries out calculations and logical comparisons.
- Cache: very fast memory in the CPU for frequently used data and instructions. Registers: tiny, very fast stores inside the CPU. Clock: sends regular pulses that keep every part in step.
Von Neumann architecture
- Programs and data are stored together in the same memory, and instructions are fetched and carried out one at a time.
- The program counter (PC) holds the address of the next instruction. The memory address register (MAR) holds the address being used. The memory data register (MDR) holds the data or instruction just fetched, or about to be written. The accumulator holds the results of calculations.
- Buses carry addresses, data and control signals between the CPU and memory.
The fetch–execute cycle
- Fetch: the address in the PC is copied into the MAR. The instruction at that address is copied from memory into the MDR. The PC goes up by 1.
- 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 into the accumulator.
Performance
- Clock speed: the number of cycles per second. 3.5 GHz means 3.5 billion cycles per second, so more instructions are carried out each second.
- Cores: each core can process instructions on its own, so more cores can do more at once, but only if the software is written to use them.
- Cache size: more cache keeps more data close to the CPU, so there are fewer slow trips to RAM.
- Level 1 cache is the smallest and fastest; level 2 and 3 are bigger but slower.
Embedded systems
- An embedded system is a computer built into a larger device to do one dedicated job, such as in a washing machine, a microwave or a car's engine. They are usually small, cheap, low-power and very reliable.
Key terms
- CPU
- The central processing unit, which processes data and instructions.
- Control unit
- The part of the CPU that decodes instructions and coordinates the other parts.
- ALU
- The arithmetic logic unit, which carries out calculations and logical comparisons.
- Cache
- Very fast memory in the CPU for frequently used data and instructions.
- Register
- A tiny, very fast store inside the CPU.
- Clock speed
- The number of fetch–execute cycles a CPU can carry out each second.
- Core
- A processing unit inside the CPU that can work independently.
- Program counter
- The register that holds the address of the next instruction.
- Von Neumann architecture
- A design where programs and data are stored in the same memory.
- Embedded system
- A computer built into a larger device to do one dedicated job.
Quick questions on CPU architecture and the fetch–execute cycle
- Which part of the CPU carries out calculations and logical comparisons?
- The ALU: ALU stands for arithmetic logic unit.
- What does the control unit do?
- Decodes instructions and coordinates the other parts of the CPU: It sends out control signals.
- What is cache?
- Very fast memory in the CPU for frequently used data: It saves slow trips to RAM.
- What does the program counter hold?
- The address of the next instruction: It goes up by 1 during each fetch.
- What are the three stages of the CPU's cycle?
- Fetch, decode, execute: This is repeated billions of times a second.
- What does a clock speed of 3.5 GHz mean?
- 3.5 billion cycles per second: Giga means billion.
- How does more cache improve performance?
- More data is kept close to the CPU, so there are fewer slow trips to RAM: Cache is much faster than RAM.
- Why might doubling the number of cores not double the speed?
- The software may not be written to use several cores: Some tasks can't be split up.
- In the Von Neumann architecture, where are programs and data stored?
- In the same memory: They share the same memory and buses.
- Which register holds the address of the memory location being used?
- MAR: MAR stands for memory address register.
- What is an embedded system?
- A computer built into a device to do one dedicated job: For example, the controller in a washing machine.
- During the fetch stage, what happens to the program counter?
- It goes up by 1: It then points to the next instruction.
CPU architecture and the fetch–execute cycle: exam-style questions and mark schemes
Which component of the CPU carries out calculations? [1 mark]
Answer: Arithmetic logic unit
Explain three factors that affect the performance of a CPU. [3 marks]
- Clock speed: more cycles per second, so more instructions are carried out each second (1)
- Number of cores: more instructions can be processed at the same time (1)
- Cache size: more frequently used data is kept close to the CPU, so there are fewer trips to RAM (1)
Describe what happens during the fetch–execute cycle. [4 marks]
- The address in the program counter is copied into the MAR (1)
- The instruction at that address is fetched into the MDR, and the program counter goes up by 1 (1)
- The control unit decodes the instruction (1)
- The instruction is executed, e.g. the ALU carries out a calculation (1)
Give two characteristics of an embedded system. [2 marks]
- It does one dedicated job, built into a larger device (1)
- It is small, low cost, low power or very reliable (1)
Describe the fetch–execute cycle, including the roles of the registers in the von Neumann architecture. [6 marks]
- the program counter (PC) holds the address of the next instruction
- this address is copied into the memory address register (MAR)
- the instruction at that address is fetched from memory into the memory data register (MDR)
- the program counter is increased by 1
- the control unit decodes the instruction
- the instruction is executed, for example the ALU does a calculation
- results are held in the accumulator
- in von Neumann architecture, instructions and data are stored together in the same memory
How to answer them: exam technique and command words.
CPU architecture and the fetch–execute cycle: questions and answers
- In the Von Neumann architecture, where are programs and data stored?
- In the same memory. They share the same memory and buses.
- Which register holds the address of the memory location being used?
- MAR stands for memory address register.
- What is an embedded system?
- A computer built into a device to do one dedicated job. For example, the controller in a washing machine.
Practise CPU architecture and the fetch–execute cycle: 12 questions