Draft preview. This experiment is not in the public collection.
Workshop/4 min exploration

How a CPU follows instructions

How does a processor turn an instruction into a result?

A program is a sequence of instructions. In this deliberately simple processor, the program counter identifies one instruction in memory, the control logic interprets it, and the data path carries out the selected action. Use the trace position to follow one instruction at a time.

Interactive model

Explore the model and follow its moving parts.

Read the full explanation ↓
Select a part. Change a control. Follow the motion.

The program counter locates the next instruction; decoding turns its bits into a requested action; execution changes a register, memory location, or the next address.

In this model, which part identifies the address of the next instruction to fetch?

Follow the explanation

Back to the model ↑

How the parts work together

  1. Fetch one instruction

    At Fetch, the program counter selects an instruction from memory and the instruction register receives it. This diagram advances a simple sequential PC for comparison.

  2. Decode its fields

    At Decode, control interprets the opcode and identifies operands or an address. Change the example instruction: ADD, LOAD, and BRANCH request different work.

  3. Execute the requested work

    At Execute, the model shows one abstract effect: an ADD writes a register, a LOAD brings a memory value into a register, and a BRANCH can alter the next PC.

The main parts

Instruction memory
The little list is an abstract program. The program counter chooses the next instruction; it is not a cache or a complete memory system.
Program counter
This register holds the address used to fetch the next instruction. Most instructions advance it, while a branch can choose a different next address.
Instruction register and control
The instruction register holds the fetched instruction while control logic interprets its opcode and operand fields.
Registers and ALU
Registers provide small working storage. The ALU is one possible execution unit; real processors include more units and more complex scheduling.

One discovery leads to another.

MachinesInside an inline-sixMachinesWhy gears change everythingMechanicsHow ball bearings workMachinesInside a rotary engine