Fetch, Decode, Execute Cycle
What is the Fetch-Decode-Execute Cycle?
The fetch-decode-execute cycle is the fundamental process that the CPU uses to execute instructions. It ensures smooth operation by continuously fetching, interpreting, and executing commands from memory.This cycle is managed by key CPU components, including the Control Unit (CU), Arithmetic Logic Unit (ALU), and Registers.
The Three Stages of the Cycle
| Stage | What Happens? |
|---|---|
| Fetch |
|
| Decode |
|
| Execute |
|
Interaction Between CPU and Memory
The CPU communicates with memory and registers during the cycle to efficiently process instructions:
- Program Counter (PC): Stores the address of the next instruction to be fetched.
- Memory Address Register (MAR): Holds the memory location of the instruction or data.
- Memory Data Register (MDR): Stores the retrieved instruction before decoding.
- Instruction Register (IR): Holds the current instruction while it is being decoded and executed.
- Accumulator (ACC): Holds results from arithmetic and logic operations.
Summary of the Cycle
| Stage | Process | Involved Components |
|---|---|---|
| Fetch | The PC sends the address to the MAR, which fetches the instruction from RAM. | PC, MAR, MDR |
| Decode | The instruction is decoded by the CU, which determines the next action. | CU, Instruction Register |
| Execute | The ALU performs the operation, and the result is stored in registers or memory. | ALU, Registers, RAM |
Key Takeaways
- The fetch-decode-execute cycle is the fundamental process for executing instructions in a CPU.
- It consists of three stages: Fetch (retrieving instructions), Decode (interpreting commands), and Execute (performing operations).
- Registers such as the Program Counter (PC), MAR, and MDR store data during the process.
- The Control Unit (CU) manages decoding, while the ALU executes arithmetic and logic operations.