- Asked 3/19
- 2070 Magh · 2+2 marks
- 2079 Jestha · 4 marks
- 2064 Poush (old course)
DMA controller and flow of actions
Short answer
A DMA controller transfers data blocks directly between peripheral and memory, bypassing CPU per byte. CPU sets up start address, byte count, and direction. On peripheral request, the DMA controller gains bus control, writes each data byte to memory, updates address and count, and signals completion via an interrupt.
Describe the purpose of the direct-memory-access (DMA) controller. Draw the flow of actions between peripheral and memory (peripheral to memory transfer) using DMA, with block diagram.
Purpose of the DMA controller
A direct memory access (DMA) controller transfers blocks of data directly between a peripheral and memory without the processor handling each byte. The processor only sets up the transfer (starting address, number of bytes, direction); the DMA controller then takes the bus and performs the transfers itself. This frees the CPU for other work, gives much higher transfer rates than interrupt-driven or polled I/O, and avoids the overhead of ISR entry/exit for each word.
Block diagram
+-----------+ Hold/Req +-------------+ Req/Ack +------------+
| Processor |<---------->| DMA |<---------->| Peripheral |
| | Hlda/Ack | controller | +-----+------+
+-----+-----+ | (address | |
| | reg, count | |
| | reg, ctrl) | |
| +------+------+ |
======+==================== Address / Data / Control bus ==+====
|
+----+-----+
| Memory |
+----------+
Flow of actions (peripheral to memory)
- The processor is running its main program and sets up the DMA controller registers: starting memory address, byte count and direction (e.g. 100 for the address, 4 bytes), then continues its work.
- The peripheral has data and asserts Req (DMA request) to the DMA controller.
- The DMA controller asserts Hold/Bus request to the processor.
- The processor finishes its current bus cycle, releases the address/data/control buses and sends Hlda/Ack (bus granted).
- The DMA controller sends Ack to the peripheral and places the memory address on the address bus.
- The peripheral places the data on the data bus; memory is written (M[address] = data) in one bus cycle.
- The DMA controller increments the address and decrements the count. Steps 2 to 6 repeat until the count is zero.
- The DMA controller releases the bus (drops Hold) and raises an interrupt to inform the processor that the transfer is complete; the processor resumes use of the bus.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Interrupt and fixed ISR flow of actions · Embedded System, chapter 5
- PID control operation with block diagram · Embedded System, chapter 7 · asked 4×
- Arbitration and memory-mapped vs standard I/O · Embedded System, chapter 5
- Cache memory mapping techniques · Embedded System, chapter 4 · asked 3×
- GPP operation: datapath and controller · Embedded System, chapter 2 · asked 4×
- Single-purpose processor for power · Embedded System, chapter 2 · asked 2×
- DMA controller block diagram and transfer · Computer Organization and Architecture, chapter 7 · asked 6×
- PID controller block diagram, transfer function, characteristics · Control Systems, chapter 7
- MBI block diagram, advantages and DMA · Instrumentation II, chapter 1
- Direct mapping with 32-block memory, 8-block cache · Computer Organization and Architecture, chapter 6 · asked 3×