2024 25 7b

Computer Organization and Architecture2024-257 marksModes of Data Transfer

Explain the Direct Memory Access (DMA) techniques for data transfer?

Explain the Direct Memory Access (DMA) techniques for data transfer?

Quick answer

Direct Memory Access (DMA) lets an I/O device move data to or from memory without the CPU handling each word. The CPU sets up the transfer in a DMA controller, which then takes over the buses. The controller is given the start address, the word count and the direction. It requests the buses from the CPU, gets a grant, and moves the words one after another. At the end, it interrupts the CPU.

The techniques differ in how the controller shares the bus with the CPU.

Burst (block) transfer

The controller keeps the buses until the whole block is moved. The CPU is blocked from memory during this time. The transfer is very fast, and it suits fast devices like disks. The drawback is that the CPU may have to wait for a long time.

Cycle stealing

The controller takes the bus for a single memory cycle, moves one word, and gives the bus back. This is repeated for each word. The CPU loses only one cycle at a time, so it keeps running, though a little slower. The transfer is slower than burst mode.

Transparent (hidden) DMA

The controller uses the bus only when the CPU does not need it, for example while the CPU is decoding an instruction or working inside the ALU. The CPU is never slowed down. But the speed of the transfer depends on how free the bus is, and the control logic is complicated.

Other arrangements

In a single-operation DMA, one word is transferred per request. In a block DMA, a block is moved for one request, as above. With a daisy chain or a priority circuit, many devices can use one controller, and the highest priority device is served first.

Comparison

TechniqueBus held by DMAEffect on CPUTransfer speed
BurstWhole blockCPU waitsHighest
Cycle stealingOne word at a timeSlight slowingMedium
TransparentOnly free cyclesNoneLowest

Advantages

The CPU is free for other jobs during the transfer. The data rate is high, since each word does not need an instruction. The CPU takes part only at the start and at the end of the block.

DMA is used for disks, network cards, graphics and sound cards, where large blocks must move quickly.

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

Up nextWhat are the different types of Buses used in computer architecture?