![]() |
VOOZH | about |
Direct Memory Access (DMA) is a technique that allows data transfer between memory and I/O devices without continuous involvement of the CPU, improving system performance and efficiency.
Now after getting some brief idea about DMA and its working it's the time to analyze Modes of DMA Transfer.
Pros:
Cons:
Percentage of Time CPU remains blocked:
Let time taken to prepare the data be Tx and time taken to transfer the data be Ty. Then percentage of time CPU remains blocked due to DMA is as follows.
In Burst Mode, the CPU is completely blocked during the entire data transfer. Therefore, percentage of CPU blocked time = 100%
Pros:
Cons:
Percentage of Time CPU remains blocked:
Let time taken to prepare data be Tx and time taken to transfer the data be Ty. Then percentage of time CPU remains blocked due to DMA is as follows.
Percentage of CPU blocked time = (Ty / Tx) × 100%
Pros:
Cons:
Since, DMA will use system bus only when CPU is not using it so,
Percentage of time CPU remains in blocked state = 0%
An I/O device has a data preparation speed of 2 MB/s. Calculate the percentage of time the CPU remains blocked in Cycle Stealing Mode if the data transfer time is 2 microseconds per word. Given,
Data preparation speed = 2 MB per second
So,
Time to prepare 2 MB = 1 second
Therefore, Time to prepare 1 Byte = 1 / (2 × 10^6) seconds
Time to prepare 16 Bytes =
= (1 / (2 × 10^6)) × 16
= 16 / (2 × 10^6)
= 8 × 10^-6 seconds
= 8 microseconds
Given:
Data transfer time (Ty) = 2 microseconds
Data preparation time (Tx) = 8 microseconds
Formula:
Percentage of CPU blocked time = (Ty / Tx) × 100
Calculation:
= (2 / 8) × 100
= 25%