Instruction State Diagram
Fetch Instruction
The Program Counter (PC) holds the address of the next instruction to be fetched. The instruction is retrieved from memory and placed into the Instruction Register (IR).
Once the instruction is fetched, the PC is incremented to point to the next instruction.
Decode Instruction
: The Control Unit (CU) decodes the fetched instruction. The CU identifies the operation type (e.g., addition, subtraction), operand(s), and the addressing mode.
After decoding, the CU triggers the necessary control signals for the next step.
Execute Instruction
The Arithmetic Logic Unit (ALU) or other functional units execute the instruction based on the decoded operation. For example, arithmetic or logic operations are performed, or data is moved between registers.
Once execution is complete, the results are stored in registers or memory as needed.
Write Back Results
The result from the execution step is written back to the destination register or memory, depending on the instruction type.
After this, the cycle begins again by fetching the next instruction.