You are on page 1of 13

DMA

Presented by : Anshika
What is DMA?
DMA, or Direct Memory Access, is a critical component of computer architecture
that allows peripheral devices to transfer data to and from the system's memory
without involving the central processing unit (CPU) in every step of the process.
This improves overall system performance by offloading data transfer tasks from
the CPU.
Need of DMA:
DMA (Direct Memory Access) is essential in computer architecture to improve data
transfer efficiency.

It allows peripherals like hard drives or network interfaces to access system


memory directly, reducing CPU involvement.

This enhances system performance and multitasking capabilities by freeing the


CPU from handling every data transfer, thereby optimizing overall system
throughput.
Components of DMA:
DMA involves several key components:

● DMA Controller: This is a dedicated hardware component responsible for


managing DMA operations. It coordinates data transfers between the
peripheral device and memory.
● Peripheral Devices: These are the devices that need to transfer data to or
from memory. Examples include hard drives, network cards, and graphics
cards.
● System Memory: The main memory where data is read from or written to
during DMA transfers.
Operation or Working of DMA:
The DMA process typically involves the following steps:

● Initialization: The CPU sets up the DMA controller with information about the
data transfer, including the source and destination addresses, data size, and
transfer direction (read or write).
● Request: When the peripheral device needs to transfer data, it sends a DMA
request to the DMA controller.
● Arbitration: If multiple devices request DMA simultaneously, the DMA
controller arbitrates between them to determine which one gets access to the
bus.
● Data Transfer: The DMA controller takes control of the system bus and
performs the data transfer directly between the peripheral and memory,
bypassing the CPU.
● Completion: Once the transfer is complete, the DMA controller signals the
CPU.
Diagram of working of DMA:
Advantages of DMA:
● Faster Data Transfer: DMA allows data to be transferred between devices and
memory without involving the CPU, which can result in faster and more
efficient data transfer rates.
● Reduced CPU Overhead: DMA offloads data transfer tasks from the CPU,
reducing its workload. This frees up the CPU to perform other tasks,
improving overall system performance.
● Improved Multitasking: DMA enables devices to transfer data concurrently
with CPU operations, enhancing multitasking capabilities and reducing
bottlenecks.
● Enhanced I/O Performance: DMA can significantly improve input/output (I/O)
performance by accelerating data transfer to and from storage devices,
network interfaces, and other peripherals.
● Lower Latency: By reducing CPU intervention, DMA can minimize data
transfer latency, making it ideal for real-time applications where low latency is
crucial.
● Scalability: DMA can be used to efficiently manage data transfers in systems
with multiple devices, ensuring that data is moved efficiently between various
components.
● Reliable Data Transfers: DMA can enhance data transfer reliability by
reducing the chances of data corruption or errors introduced by CPU
interruptions.
Bus and memory transfer
Buses:
Buses are communication pathways that connect various components of a
computer, allowing them to exchange data and instructions. There are different
types of buses, including:

● Data Bus: This carries data between the CPU and memory or between
different components. It's typically bi-directional and has a width measured in
bits (e.g., 32-bit or 64-bit).
● Address Bus: The address bus is unidirectional and carries memory
addresses generated by the CPU to specify where data should be read from
or written to in memory.
● Control Bus: The control bus carries control signals that coordinate various
activities within the computer, such as indicating read or write operations,
clock signals, and interrupt signals.
Memory transfer :
Memory transfers involve moving data between the CPU and memory. This
process is fundamental for program execution. There are two primary types of
memory transfers:
● Read Operation: In a read operation, the CPU requests data from a specific
memory address. The address is placed on the address bus, and the data
stored at that address is transferred onto the data bus, allowing the CPU to
access it.
● Write Operation: In a write operation, the CPU sends data to a specific
memory address. The address is placed on the address bus, and the data is
placed on the data bus and written into the specified memory location.

You might also like