In the scheme of instruction execution by CPU recall that it

In the scheme of instruction execution by CPU, recall that it increments PC after each instruction fetch. Suppose we change that and do this increment after the instruction execution but before checking for any interrupt signals lying at the CPU.

Everything else is same as before.

Will there be any problem?

Solution

Dear Student,

In the Scheme of instruction execution by CPU. If we change the process and increment program counter after the instruction execution but before checking any interrupts signals lying at the CPU.

Ans: There will be no problem..

Reason:

In this scheme Processor finishes execution of the current instruction before responding to the interrupt. If any interrupt signal is lying in the CPU then it will execute first after that the the next instruction will executes. And It saves the information needed to return to the current program i.e PC(Program Counter) status. Processor loads the program counter with the entry location of the interrupt-handling program.

When interrupt processing is complete, the saved register values are retrieved from the stack and restored to the registers. And then it restores the program counter values from the stack.

Hence there will not be any problem if increment is going to be done after the instruction execution. because it saves the PC status in stack. Then restore it.

------------------------------------------------------------------------------------------------------------------------------------

We must know what is a Program Counter.?

In Computer System a program counter is a register in a computer processor that contains the address (location) of the instruction being executed at the current time. As each instruction gets fetched, the program counter increases its stored value by 1. After each instruction is fetched, the program counter points to the next instruction in the sequence.

--------------------------------------------------------------------------------------------------------------------------------------

I think now you understood the reason...

Kindly Check and Verify Thanks...!!!

In the scheme of instruction execution by CPU, recall that it increments PC after each instruction fetch. Suppose we change that and do this increment after the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site