Explain the instruction execution cycle with state diagram.
The instruction cycle is the cycle which the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instructions. It is also known as the fetch–decode–execute cycle or simply the fetch-execute cycle. It is composed of three main stages: the fetch stage, the decode stage, and the execute stage. In an improved instruction execution cycle, we can introduce a next cycle known as the interrupt cycle.
Fetch
It is the process of obtaining instructions from the memory. The next instruction is fetched from the memory address that is currently stored in the PC (program counter) and stored into the IR (instruction register). At the end of the fetch operation, the PC points to the next instruction that will be read at the next cycle.
Decode
It is the stage of understanding the instructions. During this stage the encoded instruction present in the instruction register is interpreted by the decoder.
Execute
In this stage control unit sends the instructions and data to ALU for taking suitable action on the instruction and writing the result back to a register. If the ALU is involved, it sends a condition signal back to the CU. The result generated by the operation is stored in the main memory or sent to an output device.
Repeats Cycle
Once the execution cycle is complete, It repeats the same process/cycle for the next instruction.
Post a Comment