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.
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