Welcome to Home.

Monday, February 22, 2016

How does instruction execute in computer system?

Instruction Execution:

Instruction execution is the process by which a computer retrieves a program instruction from its memory and determines what action the instruction requires and carries out those actions. This execution process is repeated continuously by the CPU from boot up to when the computer is shut down. This process is also called Fetch decode- execute cycle.
                                Each computers CPU have different instruction execution process based on different instruction set will be similar to the following cycle.
1.       Fetch the instruction: during this cycle the instruction is fetched from the memory address i.e. currently stored in the program counter and bring these instruction in the instruction register. At the end of phase operation, the program counter points to the next instruction that will be read at the next cycle.
2.       Decode the instruction: during this cycle the encoded instruction present in instruction register is interpreted by the decoder.
3.       Read the effective address: during this cycle/step, computer checks the indirect or the direct address. If the instruction has indirect address then the effective address is read from the main memory but in the case of direct address the I/O instruction or register instruction operation is performed at clock pulse.
4.       Execute the instruction: this step of instruction cycle is the execute cycle. Here, the function of the instruction is performed such as reading the values from registers, performing ALU operation such on them and the result is stored in the main memory and send to the output device.
Again, program counter may be updated to a different address depending on the next instruction fetched and the cycle Is then repeated.

Note: Instruction cycle is the total time taken for completing one instruction execution. This execution process is continuously repeated. 

No comments:

Post a Comment