A device transfers data at 2 MB/s, 4 bytes per interrupt, and each interrupt costs 500 cycles on a 1 GHz CPU. What fraction of CPU time is spent servicing these interrupts?
Correct answer C. 25%
Explanation
The device raises 2,000,000 / 4 = 500,000 interrupts per second. At 500 cycles each that is 250,000,000 cycles per second out of 1,000,000,000, which is 25%. Forgetting to divide by 4 bytes per interrupt gives an impossible 100%, and other slips lead to 50% or 2.5%. This overhead is exactly why fast devices use DMA rather than an interrupt per word.
Answer checked How we write and check questions
Discussion