How a computer runs a program
The parts of a computer, the fetch-decode-execute cycle on a small accumulator machine, and how instructions are encoded and name their data.
About 2 hours of study
Learning objectives
- Name the parts of a von Neumann computer and the buses between them
- Follow instructions through the fetch-decode-execute cycle
- Decode an instruction word and recognise addressing modes
Lessons
- 1
Inside a computer: CPU, memory and buses
The parts of a computer and how they talk: the processor's control unit, ALU and registers, main memory, input and output, and the buses that join them.
- 2
The fetch–decode–execute cycle
How a processor runs a program: fetch an instruction from memory, decode it, execute it, and repeat, using the PC, IR and accumulator.
- 3
Instruction sets and addressing modes
What an instruction looks like in binary, the ways an instruction can name its data (addressing modes), and RISC versus CISC.
Module practice
- Address lines and memory sizeEasy
- Little-endian memory layoutMedium
- Bus cycles for unaligned accessesHard
- Trace the program counterEasy
- Run an accumulator machineMedium
- Profile an accumulator programHard
- Extract bit fieldsEasy
- Decode instructionsMedium
- Assemble instructionsHard