Course contentsShow
← Computer Science
Lesson 1086 of 2,87225. Computer Architecture FoundationsFree lesson

The Execute Stage

How the ALU or other functional units perform the operation specified by the decoded instruction.

The Execute Stage

What You'll Learn

You'll learn how the CPU actually carries out the operation specified by a decoded instruction during the execute stage of the instruction cycle.


Performing the Real Work

After an instruction has been fetched from memory and decoded to understand what operation it requires, the CPU moves to the execute stage — where the actual work happens.

During execution, the ALU (Arithmetic Logic Unit) or other specialized functional units perform the operation identified by the instruction's opcode. The control unit directs which functional unit to use and routes the correct operands (data) from registers or memory to that unit.

What Happens Inside

Depending on the instruction type, different actions occur:

  • Arithmetic/Logic operations: The ALU receives two operands (e.g., values from registers) and performs the operation (add, subtract, AND, OR, etc.). The result is typically stored back in a register or the accumulator.

  • Memory operations: For load/store instructions, the ALU might calculate a memory address (base address + offset), then the memory unit reads from or writes to that location.

  • Control flow operations: For branch or jump instructions, the ALU may compare values to determine if a condition is met, then update the program counter (PC) to point to a new instruction address.

An Analogy

Think of the execute stage as a chef actually cooking a dish. The recipe was read (fetch), ingredients were identified (decode), and now the chef is chopping, mixing, and heating (execute) to produce the final result.


Key Takeaway:
The execute stage is where the ALU or other functional units perform the actual operation specified by the decoded instruction, producing results that are stored in registers, memory, or used to control program flow.