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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.