CS FundamentalsVery hardGATE CS

A device transfers data at 2 MB/s using programmed I/O with an interrupt per byte; handling each interrupt takes 2 µs of CPU time. What fraction of CPU time is consumed by the transfer? And if DMA is used with one interrupt per 4 KB block (same 2 µs handler)?

  1. A. Over 100% (the CPU cannot keep up) vs about 0.1%
  2. B. 50% vs 1%
  3. C. 4% vs 0.001%
  4. D. 100% vs 0%

Correct answer: A. Over 100% (the CPU cannot keep up) vs about 0.1%

2 MB/s with an interrupt per byte means 2×10⁶ (≈2²¹) interrupts/s × 2 µs ≈ 4.2 s of CPU per second: impossible. With DMA there are 2 MB/4 KB = 512 interrupts/s × 2 µs ≈ 1 ms per second ≈ 0.1%.

More Operating Systems questions

Exams that ask this topic