Draw an instruction cycle state diagram with interrupt and explain it

This answer is restricted. Please login to view the answer of this question.

Login Now

Instruction Cycle:

Instruction cycle is basically related with the execution of the instruction. A program residing in the memory unit of a computer consists of sequence of instructions. In the basic computer, each instruction cycle consists of following phases:

  1. Fetch an instruction from memory
  2. Decode the instruction
  3. Read the effective address for memory if the instruction has an indirect addresses.
  4. Execute the instruction

Instruction Cycle with interrupts:

Instruction Cycle Flowchart with interrupts:

For this, we have one flip-flop R. This flip flop R will decide whether it is interrupt or it is normal execution of our program.

When R = 0:

  • If R is set to 0 then it is our normal execution cycle, in which we will do fetching and decoding of instructions and executing the instructions.
  • But during fetch and decode, if we encounter IEN flag then, following condition occur:
    • If IEN is set to 1 then we check FGI
    • If IEN is 1 then interrupt is occurred. At that time, We have to set flip flop R to 1
    • If IEN is 0 then we go to FGO. If FGO is 1 then interrupt is occurred we need to set flip-flop R to 1.

When R = 1

If R is set to 1 then the interrupt is occurred. Now in this case, we store return address in the location O (free location) i.e. return address always in PC. so it is stored from PC to memory location pointed by zero. After that we jump branch to location 1. Finally we set IEN to 0 and R to 0

 

If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .