A system transfers a 2,000-byte data block using either programmed I/O or…

2026

A system transfers a 2,000-byte data block using either programmed I/O or direct memory access (DMA). With programmed I/O, transferring each byte takes 6 CPU cycles. With DMA, the block transfer takes 3,000 clock cycles, and the CPU spends an additional 200 cycles on setup. The CPU clock rate is 1 GHz. Which method is more CPU-efficient for this large block transfer?

Answer: B. DMAConceptCPU efficiency is determined by the amount of processor time a transfer method occupies. Programmed I/O keeps the CPU involved in each data movement,…

  1. A.

    Programmed I/O

  2. B.

    DMA

  3. C.

    Both programmed I/O and DMA

  4. D.

    Depends on block size

Attempted by 189 students.

Show answer & explanation

Correct answer: B

Concept

CPU efficiency is determined by the amount of processor time a transfer method occupies. Programmed I/O keeps the CPU involved in each data movement, whereas DMA delegates block movement to a controller after a short CPU setup.

At a clock rate f, time equals cycle count divided by f. For comparing CPU efficiency, distinguish CPU-busy cycles from the controller’s transfer duration.

Application

  1. Programmed I/O CPU work: 2,000 bytes × 6 cycles per byte = 12,000 CPU cycles.

  2. At 1 GHz, 12,000 cycles correspond to 12 microseconds of CPU involvement.

  3. DMA CPU work: the CPU performs the stated 200-cycle setup, and the DMA controller then handles the block movement. The stated transfer duration is 3,000 cycles; even if setup and transfer durations are conservatively added, the elapsed count is 3,200 cycles.

  4. Thus DMA reduces CPU involvement from 12,000 cycles to about 200 setup cycles and also has a smaller stated elapsed-cycle count than programmed I/O.

Cross-check

The CPU-cycle ratio is 12,000 ÷ 200 = 60, so programmed I/O occupies the CPU about 60 times as much under the given data. Even the conservative elapsed comparison gives 12,000 ÷ 3,200 = 3.75. Therefore, DMA is more CPU-efficient for the stated block.

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…