RTUEE / EC / EEEYr 2022 · Sem 52022

Q4Computer Architecture

Question

10 marks

Q.4. What are the various modes of data transfer to and from the computer system? Explain.

Answer

Data transfer to/from a computer system occurs via three main modes: Programmed I/O (CPU actively polls/transfers each data item), Interrupt-driven I/O (device signals the CPU when ready, allowing other work in between), and DMA (Direct Memory Access, where a dedicated controller transfers blocks of data directly to/from memory without CPU involvement).

There are three principal modes by which data is transferred between I/O devices and main memory (or CPU registers), differing significantly in how much direct CPU involvement is required.

Programmed I/O: the CPU itself is fully responsible for supervising and executing every data transfer, continuously polling (checking) a status flag/register of the I/O device to determine when it is ready to send or receive the next data item, then executing an explicit instruction to move that single data item between the device and a CPU register or memory. This is simple to implement in software but extremely wasteful of CPU time, since the processor is kept in a busy-wait loop, unable to perform any other useful work, for the entire (often slow, relative to CPU speed) duration of each I/O operation.

Interrupt-driven I/O: rather than continuously polling, the CPU issues an I/O command and then proceeds to execute other, unrelated instructions/programs. When the I/O device becomes ready to transfer data, it raises an interrupt signal to the CPU, which then temporarily suspends its current task, executes a dedicated interrupt-service routine to perform the actual data transfer for that one data item, and then resumes its previous task. This frees the CPU from busy-waiting and allows useful overlap of computation with I/O, though the CPU is still directly involved in transferring every individual data item (just not continuously polling for readiness), and each interrupt incurs some processing overhead (context saving/restoring).

Direct Memory Access (DMA): a specialized DMA controller hardware is given the source/destination addresses and the total block size for an entire transfer by the CPU, and then autonomously manages the transfer of an entire block of data directly between the I/O device and main memory, without requiring the CPU to be involved in moving each individual data item. The DMA controller briefly takes control of the system bus (cycle-stealing from the CPU as needed) to perform each word transfer, and only interrupts the CPU once at the very end, when the entire block transfer is complete. This is by far the most efficient mode for large data transfers (such as disk or high-speed network I/O), since it minimizes CPU involvement to only initiating and being notified of completion, freeing the CPU to perform substantial computation concurrently with the ongoing I/O transfer.

Comparative summary and typical usage: these three modes represent a progression of decreasing CPU involvement and increasing hardware complexity. Programmed I/O is appropriate only for very simple systems or slow, infrequent I/O operations where the CPU has nothing else useful to do (e.g., a basic embedded controller polling a single sensor). Interrupt-driven I/O is well suited to moderate-speed, character-oriented devices such as keyboards and mice, where individual data items arrive relatively infrequently and the overhead of an interrupt for each item is acceptable. DMA is essential for high-speed, block-oriented devices such as disk drives, network interfaces, and graphics frame buffers, where the sheer volume of data would overwhelm the CPU if handled item-by-item via polling or interrupts; virtually all modern general-purpose computer systems rely on DMA for disk and network I/O specifically because of the enormous CPU-time savings it provides for these high-throughput transfer scenarios.

Back to Paper