A computer with interrupt‐driven I/O has an interrupt response time of 4 μs (i.e., it takes 4 μs to invoke the interrupt handler and begin executing the target code). Similarly, it takes 2 μs to return from the interrupt and begin executing the interrupted program.
a. If this computer executes 10 instructions per microsecond and the interrupt handler is 10 instructions long, how efficient is interrupt handling?
b. If interrupt handling is approximately 80% efficient, how large should the interrupt handler be (in terms of instructions)?
I know the answers are this:
a. efficiency = interrupt execution/(interrupt execution + call + return) = 100 instructions × 0.1 μs/(100 × 0.1 μs + 4 μs + 2 μs) =10μs/(10 + 6)μs = 10/16 = 0.625 = 62.5%
b. 80% = 0.8 = n × 0.1/(n × 0.1 + 4 + 2). = n/(n + 60) Therefore, 0.8n + 48 = n; n = 240
Could someone explain the "100 instructions × 0.1 μs" part. Where did they get 100 instructions and 0.1 μs from?
0.1 micro seconds can be inferred from the fact that, interrupt handler takes 10 instructions per microsecond, therefore time for executing a single instruction is 1/10 micro seconds or 0.1 micro seconds.
I think, it should be 10 instructions instead of 100 instructions as specified in option (a)
a) If this computer executes 10 instructions per microsecond and the interrupt handler is 10 instructions long, how efficient is interrupt handling?
Therefore, time for interrupt instructions execution = No. of instructions * Time per instruction = 10 * 0.1 = 1 micro second
In that case efficiency should be = 10 * 0.1 / (10 * 0.1 + 4 + 2) = 1 / (1 + 4 + 2) = 1 / 7 = 0.14283 or 14.283 %.
Note: We can easily see that it takes 1micro second for executing instruction is interrupt handler, but it takes 6 micro seconds to move and jump back. So efficiency will be lower.
Option (b) solution is right.
Kindly provide thumbs up
A computer with interrupt‐driven I/O has an interrupt response time of 4 μs (i.e., it takes...