A system transfers data in blocks of 2000 bytes. With programmed I/O, each…
2026
A system transfers data in blocks of 2000 bytes. With programmed I/O, each byte transfer consumes 6 CPU cycles. With direct memory access (DMA), the complete block transfer takes 3000 clock cycles, while the CPU setup overhead is 200 cycles. The CPU clock frequency is 1 GHz. How many CPU cycles does the CPU spend on the DMA transfer?
Answer: A. 200 cycles — ConceptIn programmed I/O, the CPU participates in each data transfer. In DMA, the CPU configures the DMA controller, while the controller moves the block…
- A.
200 cycles
- B.
3000 cycles
- C.
3200 cycles
- D.
4000 cycles
Attempted by 195 students.
Show answer & explanation
Correct answer: A
Concept
In programmed I/O, the CPU participates in each data transfer. In DMA, the CPU configures the DMA controller, while the controller moves the block independently. Therefore, CPU cycles spent on DMA are counted from CPU overhead, not from the controller's total transfer duration.
Application
The programmed-I/O workload would be 2000 bytes × 6 CPU cycles per byte = 12,000 CPU cycles; this establishes why DMA reduces CPU involvement.
Under DMA, the 3000-cycle figure is the elapsed duration of the complete block transfer handled by the DMA controller.
The CPU's stated setup overhead is 200 cycles. No additional CPU interrupt overhead is specified, so the CPU-cycle count requested is 200 cycles.
Cross-check
The units and roles confirm the separation: 3000 cycles measure the DMA block's duration, whereas 200 cycles measure the CPU's setup work. Thus the CPU spends 200 cycles on the DMA transfer.