The fetch-decode-execute cycle

Robusta Study

Revision videos, vocabulary practice and written questions for IGCSE.

The fetch-decode-execute cycle

Follow one instruction through the PC, MAR, MDR, CIR and ACC registers, then run a small program.

Transcript

A CPU only understands its own instruction set, written in machine code. Each instruction has an opcode, what to do, and an operand, what to do it to.

The CPU repeats one cycle, billions of times a second: fetch, decode, execute.

Fetch. The address in the program counter is copied to the M A R. The contents of that memory cell go to the M D R, and the program counter goes up by one. Then the instruction is copied to the C I R.

Decode. The control unit works out what the instruction in the C I R means.

Execute. The instruction is carried out. Here, the number at address six is loaded into the accumulator.

Then the cycle starts again. Add the number at address seven, and store the answer, forty two, at address eight.

Fetch, decode, execute. Over and over, that is all a CPU ever does.

More in this series