recategorized by
6,412 views

4 Answers

Best answer
36 votes
36 votes

Time to service an interrupt $=$ saving of cpu state $+$ ISR execution $+$ restoring of CPU state $=( 80+10+10) \times 10^{-6}=\mathbf{100}$ microseconds

For every $1$ ms an interrupt occurs which is served for $100$ microseconds
$1$ ms $\to$ 1000 microseconds.

After every $1000$ microseconds of main code execution, $100$ microseconds for interrupt overhead exists.

Thus, for every $1000$ microseconds, $(1000 - 100 ) = 900$ microseconds of main program and $100$ microseconds of interrupt overhead exists.

Thus, $900/1000$ is usage of CPU to execute main program 

$\%$ of CPU time used to execute main program is $\mathbf{(900 /1000) \times 100 =90.00 \%}.$

edited by
20 votes
20 votes
CPU overhead will be saving context + serving interrupt + restoration.
out of 1ms, these things are overhead for CPU.
OVERHEAD % $= \frac {(10 + 80 +10) * 10^{-6}}{1*10^{-3}   *100} = 10 \%$
                                               
% of time CPU devoted to main program = 90%
edited by
4 votes
4 votes
Here we see before first interrupt is come main program started execution then interrupt is come include over head of(10+80+10) = 100usec. Then program again start execution until second interrupt is acknowledge. So out of 1000usec of total exection of process both main program and interrupt process there is 100usec overhead for interrupt.

So % of Overhead = (100/1000)*100 = 10%

So % of main program execution = 90%
1 votes
1 votes
Lets Assume for 1 second of cpu time,  

cpu time = main program execution + time to service some no of Interrupts

we know in 1 sec there are 10^3 msec, so there are 10^3 interrupts arriving in 1 sec and from diagram we know

1 interrupt takes = 10 usec(saving of cpu state)+80 usec(ISR execution)+10 usec(Restoration of cpu state)

so total 1 interrupt takes 100 usec which is 10^-4 sec

so time to service 10^3 interrupt takes 10^3 * 10^-4 = 10^-1 sec

so Main program execution=cpu time - time to service 10^3 interrupts

Main program exec=1-0.1 = 0.9 sec

which is 90% of cpu time for this assumption
Answer:

Related questions

25 votes
25 votes
4 answers
2
Kathleen asked Sep 29, 2014
5,676 views
Write a concurrent program using $\text{parbegin-parend}$ and semaphores to represent the precedence constraints of the statements $S_1$ to $S_6$, as shown in figure belo...
32 votes
32 votes
2 answers
4
Kathleen asked Sep 29, 2014
13,139 views
The root directory of a disk should be placedat a fixed address in main memoryat a fixed location on the diskanywhere on the diskat a fixed location on the system diskany...