What is the Instruction Cycle?
You'll learn: How the CPU repeatedly executes instructions through a fundamental three-step process called the instruction cycle.
The Core Idea
The instruction cycle (also called the fetch-decode-execute cycle) is the basic operational process that the CPU repeats over and over to run programs. Every instruction your computer executes—whether adding two numbers, loading data from memory, or checking a condition—goes through this same cycle.
Think of it like a chef following a recipe: first read the next step (fetch), understand what it means (decode), then perform the action (execute). The chef repeats this for every step until the recipe is complete.
The Three Phases
1. Fetch
The Control Unit uses the Program Counter (PC) to determine which instruction to retrieve from memory. It loads this instruction into the Instruction Register (IR) and increments the PC to point to the next instruction.
2. Decode
The Control Unit examines the instruction in the IR to determine:
- What operation to perform (add, load, jump, etc.)
- Which registers or memory locations are involved
- What control signals to send to other CPU components
3. Execute
The CPU carries out the instruction:
- The ALU might perform arithmetic/logic operations
- Data might move between registers and memory
- The PC might jump to a different address (for branches/loops)
After execution completes, the cycle immediately repeats with the next instruction, continuing sequentially through your program unless a jump or branch instruction changes the flow.
Key Takeaway: The instruction cycle is the fetch-decode-execute loop that the CPU repeats continuously, processing one instruction at a time to run programs sequentially.