The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+19 votes
2.2k views

A CPU generally handles an interrupt by executing an interrupt service routine:

  1. As soon as an interrupt is raised.

  2. By checking the interrupt register at the end of fetch cycle.

  3. By checking the interrupt register after finishing the execution of the current instruction.

  4. By checking the interrupt register at fixed time intervals.

asked in CO & Architecture by Veteran (59.5k points)
edited by | 2.2k views

2 Answers

+16 votes
Best answer
It will be C.

After finishing the execution of each instruction the CPU reads the interrupt pins to recognize the interrupts.

INTR = 1 = Interrupt is present.(Service the Interrupt)

        = 0 = Interrupt is not present.(Goto next Instruction fetch from user program)
answered by Boss (19.7k points)
selected by
0
Tell me the difference between the option b and c both sound similar to me
0
To finish execution of the current instruction we have to follow different cycle like first Fetch instruction cycle then decode instruction cycle then fetch operand cycle and then finally execute instruction cycle.
in option b he is talking about if ISR is executed after fetch instruction cycle.
in option c he is talking about if ISR is executed after Execution cycle.
have a look here
https://www.slideshare.net/Taqi125/coal-10-instruction-cycle-and-interrupts
0

@Rupendra Choudhary

Correct ur concept!!

option C is not about ISR is executed after the execution cycle.

It is not that execution cycle, it is a general word that we use in daily routine.

CPU is going to check the interrupt bit after finishing the execution of the current instruction, it means we know that every instruction has to various phases like instruction fetching, decoding, fetch operands, execute, write back . After each phase completes by an instruction not after executing phase then CPU check for interrupts.

There is a big difference between the execution of a current instruction and execute cycle of running instruction...

 

 

0 votes
I think it will act differently for hardware and software interrupts for hardware interrupts are the urgent or given the higher priority but we're as the software interrupts are given less priority so it d pends on the interrupt if it is hardware it is immediately addressed but we're as the software interrupts it can wait  

 

According to me if it is an hardware interrupt option a is correct

Software interrupts remaining three are applicable na all the 3 are methods to address the the interrupts irrespective of there performance and feasibility

 if I take for software interrupts ABC all options are ways to handle an interrupt request how are u chooseing that one of the option is best but if we look all options are ways to handle a request

 Integrity is maintained in every option (except option a because it may lead to error as it executes only half instruction it may lead to errors

: I wanted to know why did you think that option c is more appropriate (Iam not able to figure out how to answer this question because every option seems to be valid for me and how what is generally mean in the question it depends on the type of interrupt as I said hardware and software )
answered by Active (1.9k points)
0
i'm not satisfied with the level of explanation of the answer , can someone explain it with shedding light on all options ?
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,058 questions
45,554 answers
131,890 comments
48,909 users