0% found this document useful (1 vote)
175 views

DMA

Direct Memory Access (DMA) allows certain hardware subsystems to access main system memory independently of the CPU. It works by using a DMA controller that can transfer blocks of data between I/O devices and memory with minimal CPU intervention. DMA is useful because some data transfers do not require CPU processing or can be handled by other devices, freeing up the CPU for other tasks. It operates in different modes like burst, cycle stealing, or block transfer depending on the needs of the I/O device and speed of data transfer. DMA provides benefits like faster memory operations and reduced CPU workload but can also increase costs and potentially cause cache coherence issues.

Uploaded by

Lavish Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
175 views

DMA

Direct Memory Access (DMA) allows certain hardware subsystems to access main system memory independently of the CPU. It works by using a DMA controller that can transfer blocks of data between I/O devices and memory with minimal CPU intervention. DMA is useful because some data transfers do not require CPU processing or can be handled by other devices, freeing up the CPU for other tasks. It operates in different modes like burst, cycle stealing, or block transfer depending on the needs of the I/O device and speed of data transfer. DMA provides benefits like faster memory operations and reduced CPU workload but can also increase costs and potentially cause cache coherence issues.

Uploaded by

Lavish Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Direct Memory Access(DMA)

Submitted to:- Submitted By:-


Himani Madam Pranav Surwade
Paras Maravi

04-10-2019 1
Contents

• DMA Definition
• Need
• DMA vs NO DMA
• Working
• Modes
• Numerical
• Advantages/Disadvantages
• References
• Thank you

04-10-2019 2
Direct Memory Access(DMA)

• Direct memory access (DMA) is a feature of computer systems that allows certain hardware
subsystems to access main system memory (random-access memory), independent of the central
processing unit (CPU).
• DMA controller is a control unit, part of I/O device’s interface circuit, which can transfer blocks of
data between I/O devices and main memory with minimal intervention from the processor.

04-10-2019 3
Why do we need DMA?

DMA is a method of transferring data from the computer's RAM to another part of the computer
without processing it using the CPU. While most data that is input or output from your computer is
processed by the CPU, some data does not require processing, or can be processed by another
device .

04-10-2019 4
DMA vs No DMA

Without DMA With DMA


When the CPU is using programmed I/O, it is The CPU initiates the transfer, does other
typically fully occupied for the entire duration of operations while the transfer is in progress, and
the read or write operation, and is thus receives an interrupt from the DMA controller
unavailable to perform other work. when the operation is done.

04-10-2019 5
How does DMA works?

04-10-2019 6
Data Transfer Techniques in DMA Controller

DMA Works on three modes:-

• Burst Mode:-In this mode DMA handover the buses to CPU only after completion of whole data
transfer. Meanwhile, if the CPU requires the bus it has to stay ideal and wait for data transfer.
• Cycle Stealing Mode:-In this mode, DMA gives control of buses to CPU after transfer of every byte.
It continuously issues a request for bus control, makes the transfer of one byte and returns the
bus. By this CPU doesn’t have to wait for a long time if it needs a bus for higher priority task.
• Block-Transfer Mode/Transparent Mode:-Here, DMA transfers data only when CPU is executing
the instruction which does not require the use of buses.

04-10-2019 7
Burst Mode

• Definition:- It is the DMA data transfer technique in which no. of data words are transferred
continuously until whole data is not transferred.

• Data Transfer:-Data transfer Continues until whole data is not transferred.

• Speed:-This is very fast data transfer technique and is used to transfer data for fast speed devices.

• CPU Utilization:-Low CPU Utilization because CPU remains idle until whole data is not transferred.

04-10-2019 8
Cycle Stealing Mode

• Definition:- It is the data transfer technique in which one data word is transferred and then
control is returned to CPU.

• Data Transfer:- Data is transferred Only when CPU is idle.

• Speed:- It is the slow data transfer technique as data is transferred only when CPU is idle

• CPU Utilization:- High CPU utilization because data is transferred when CPU has no task to
perform.

04-10-2019 9
Transfer Mode/Block-Transfer Mode

• Data are divided into fixed size block may have same bytes of data . When DMA receives an I/O
request from CPU ,it will forward the request to the device controller. The device controller
prepare the block of block of data transfer it for DMA ,block by block .
• All system buses are under the control of DMA while transferring one block data from device
controller to DMA . But when two consecutive block transfer CPU steals the system buses to
perform other task.

04-10-2019 10
Numerical on DMA

Q1 . A hard disk system has the following parameters :


• Number of tracks = 500
• Number of sectors/track = 100
• Number of bytes /sector = 500
• Time taken by the head to move from one track to adjacent track = 1 ms
• Rotation speed = 600 rpm.
What is the average time taken for transferring 250 bytes from the disk ?

04-10-2019 11
Solution:-
Avg. time to transfer = Avg. seek time + Avg. rotational delay + Data transfer time
Avg Seek Time – time taken to move from 1st track to 1sr track : 0ms, 1st to 2nd : 1ms, 2ms,
3ms,….499ms
Avg Seek time =( ∑0+1+2+3+…+499)/500 = 249.5 ms
Avg Rotational Delay – RMP : 600 , 600 rotations in 60 sec
1 Rotation = 60/600 sec = 0.1 sec
So, Avg Rotational Delay = 0.1/2= 50 ms
Data Transfer Time:- In One 1 Rotation we can read data on one track = 100 * 500 = 50,000 Bytes
data is read in one rotation.
For 250 bytes = 0.1 * 250 / 50,000 = 0.5 ms
Therefore Average Time Taken = 249.5+50+0.5 = 300 ms

04-10-2019 12
Q2 . A hard disk with a transfer rate of 10 Mb/sec is constantly transferring data to memory
using DMA . The processor runs at 600MHz & takes 300&900 clock cycles to initiate & compute
DMA transfer respectively. If the size of the transfer is 20 Kb, What is the percentage of processor
time consumed for the transfer operation?
Solution:-

1
Clock cycle time = ∗ 106 [ Frequency = 1/Time]
600

900+300
For DMA initiation and completion = × 106=2 microsec .
600

Disk Transfer rate =10 Mbytes/sec

1 byte =1/107

20 Kbytes =2 millisecond =2000 micro second

Percentage = 2/ 22+2000 ×100=0.0999≃0.1%

04-10-2019 13
Advantages/Disadvantages of DMA

Advantages:-
• DMA speedups the memory operations by bypassing the involvement of the CPU.
• The work overload on the CPU decreases.
• For each transfer, only a few numbers of clock cycles are required
Disadvantages:-
• Cache coherence problem can be seen when DMA is used for data transfer.
• Increases the price of the system.

04-10-2019 14
References

DMA Controller in Computer Architecture, Elprocus,2013,https://www.elprocus.com/direct-


memory-access-dma-in-computer-architecture
Difference between Burst Mode and Cycle , Tech-Experts ,Feb-9-
2015,http://dash10mesh.blogspot.com/2015/02/difference-between-burst-mode-and-cycle.html
GATE | Gate IT 2007 | Question 44, GeeksforGeeks, https://www.geeksforgeeks.org/gate-gate-it-
2007-question-44

04-10-2019 15
Thank You

04-10-2019 16

You might also like