The question is as follows:
What is DMA? Briefly explain following with respect to DMA:
(i) Bus request
(ii) Bus Grant
(iii) Burst transfer
(iv) Cycle Stealing
Direct Memory Access (DMA) is a method used in computer systems to transfer data between memory and peripherals (such as hard disks, network cards, or sound cards) without the continuous involvement of the CPU. Instead of relying on the CPU for every data transfer operation, a separate DMA controller (DMAC) handles the process, significantly improving system efficiency and performance.
Working of DMA:
The CPU initiates the DMA transfer by providing necessary details to the DMA controller, such as memory addresses, data size, and transfer direction.
The DMA controller requests control of the system bus from the CPU.
Once the CPU grants control, the DMA controller performs the data transfer directly between the peripheral and memory.
After completing the transfer, the DMA controller notifies the CPU through an interrupt.
ADVERTISEMENT
1. Bus Request (BR)
The bus request is a signal sent by the DMA controller to the CPU to request control over the system bus.
The system bus consists of three main components:
Address Bus (to specify memory locations)
Data Bus (to transfer actual data)
Control Bus (to manage signals for data transfer)
When the DMA controller needs to read/write data, it sends this request, asking the CPU to release control of the bus.
The CPU either grants or denies this request based on its current operations.
Example: When a sound card needs to stream audio data from memory, the DMA controller requests the bus to fetch the required data.
2. Bus Grant (BG)
The bus grant is a signal sent by the CPU to the DMA controller, indicating that the system bus has been released and the DMA controller can now take control.
This ensures that only one device is using the bus at a time, preventing data corruption and conflicts.
Process:
DMA controller requests the bus (Bus Request - BR).
The CPU checks whether it can release the bus (if it's not executing critical tasks).
If possible, the CPU suspends its operations and sends a Bus Grant (BG) signal.
The DMA controller takes over the bus and performs the data transfer.
Example: If a network card needs to transfer a large file to memory, the CPU grants the bus to DMA so that data can be written without CPU intervention.
3. Burst Transfer
In burst mode, the DMA controller transfers an entire block of data (multiple bytes) in a single, uninterrupted operation.
During this time, the CPU is completely halted as the DMA controller has full control of the system bus.
Once the data transfer is complete, the bus is returned to the CPU.
Advantages:
✔ Faster data transfer since multiple bytes are moved at once.
✔ Suitable for high-speed peripherals like disk drives or graphics cards.
Disadvantages:
❌ CPU remains idle during the transfer, leading to reduced processing efficiency.
Example: A hard drive transferring a large file (e.g., 100 MB) to RAM using DMA in burst mode will block the CPU until the transfer is completed.
4. Cycle Stealing
In cycle stealing mode, the DMA controller transfers data one byte or word at a time instead of transferring a full block.
The CPU and DMA share the system bus by alternating control—DMA takes control for a few cycles, transfers a small amount of data, then returns the bus to the CPU.
This allows the CPU to continue executing other instructions while DMA operates in the background.
Advantages:
✔ Prevents CPU from being completely blocked.
✔ Suitable for real-time applications where CPU tasks should not be interrupted for too long.
Disadvantages:
❌ Slower data transfer compared to burst mode since only small chunks of data are transferred at a time.
Example: In video streaming applications, DMA might use cycle stealing to continuously fetch small frames of video data from memory without causing noticeable delays in other system processes.
Comments