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

Lessons

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

Module quiz

1. How many bytes can a 16-bit address bus address, with one byte per address?
2. Which part of the CPU decodes instructions and sends control signals?
3. A 16-bit instruction has a 4-bit opcode. How many different operations can it name?
4. Which addressing mode computes memory[r3 + 12]?
5. The PC holds 104 right after fetching a 4-byte instruction. At what address was that instruction?
6. A big-endian machine stores 0x0A0B0C0D at address 200. Which byte is at address 203?

Performance and arithmetic ›