The Machine Instruction Cycle

The Machine Instruction Cycle

Every program a computer runs is ultimately a long list of simple machine instructions stored in memory. The CPU processes these instructions one after another using a repeating routine known as the machine instruction cycle, or the fetch–decode–execute cycle. Understanding this cycle explains how a static list of numbers in memory becomes live, running behavior.

An overview of the stages

The cycle has three core stages, and IB often adds a fourth for clarity:

  1. Fetch – copy the next instruction from memory into the CPU.
  2. Decode – work out what the instruction means and what operands it needs.
  3. Execute – carry out the operation, using the ALU if arithmetic or logic is required.
  4. Store – write any result back to a register or to memory.

The processor repeats this loop billions of times per sec