2025 26 7b

Computer Organization and Architecture2025-267 marksModes of Data Transfer

Explain the working of Direct Memory Access. Describe the DMA controller and its advantages over other I/O methods.

Explain the working of Direct Memory Access. Describe the DMA controller and its advantages over other I/O methods.

Quick answer

In Direct Memory Access, an I/O device exchanges a block of data with main memory without the CPU copying each word. The CPU sets up the transfer and then does other work. The steps in the working are as follows.

Working of DMA

The CPU writes the starting memory address, the number of words and the direction into the DMA controller. The device then raises a DMA request. The controller sends a bus request to the CPU. The CPU finishes its current cycle, releases the buses and sends a bus grant. The controller puts the address on the address bus and sends the memory and device control signals, and one word moves directly between the device and memory. The controller increases the address and decreases the count. This repeats until the count is zero. At that point the controller returns the bus to the CPU and sends an interrupt to say that the transfer is complete.

The DMA controller

The controller has these main parts:

  • Address register: it holds the address of the next memory word.
  • Word count register: it holds the number of words still to be moved.
  • Control register: it holds the direction and the mode (burst or cycle stealing).
  • Data buffer: it connects the controller to the data bus.
  • Bus request and bus grant lines: these connect it to the CPU for taking the buses.
  • DMA request and acknowledge lines: these connect it to the I/O device.

The CPU can read and write these registers through the register select input, in the same way as for any other interface.

Advantages over other I/O methods

PointProgrammed I/OInterrupt-initiated I/ODMA
CPU involvementEvery wordEvery wordOnly start and end
CPU stateBusy waitingFree, but interrupted for each wordFree during the block
SpeedSlowMediumFast
Suited toSimple tasksSlow devicesFast devices and large blocks

The main advantages of DMA are that it gives the highest data rate, since words are not routed through the CPU, and it frees the CPU for other tasks. It has far less overhead than interrupts because only one interrupt is used for a complete block. Its disadvantages are the extra hardware and the need to share the memory bus, which can slow the CPU a little during the transfer.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.

Up nextEnlist the basic functional units of a digital system?