SNS COLLEGE OFTECHNOLOGY
Coimbatore-35.
An Autonomous Institution
COURSE NAME : COMPUTER ORGANIZATION AND ARCHITECTURE
II YEAR/ III SEMESTER
UNIT – V I/O Organization, Parallelism, GPU
Topic: Direct Memory Access
Dr.K.Sangeetha
HoD
Department of Computer Science and Engineering
2.
Direct Memory Access
(DMA):Overview
Direct Memory Access (DMA) is a crucial capability that allows
hardware components to access a system's main memory without
involving the Central Processing Unit (CPU). This independence
frees the CPU from tedious data transfer tasks, leading to
significant improvements in overall system efficiency and
performance.
3.
Why DMA isImportant
Without DMA, the CPU would be entirely consumed
during input/output (I/O) data transfers, leading to
severe bottlenecks and reduced system responsiveness.
Imagine your computer freezing every time a file is
saved or a video loads.
DMA acts as a dedicated traffic controller for data,
allowing the CPU to continue processing other tasks
concurrently. This parallel processing capability is
essential for modern computing environments.
Reduced CPU Overhead
DMA significantly lowers the CPU's workload,
enabling it to focus on complex computations
and application execution.
Increased System Throughput
By facilitating faster and more efficient data
transfers, DMA boosts the overall data
processing capacity of the system.
4.
How DMA Works:Basic Operation
CPU Initialization
The CPU configures the DMA
controller, specifying the memory
address, data size, and direction of
the transfer.
DMA Control
The DMA controller takes over,
managing the direct data transfer
between the peripheral device and
memory.
Interrupt Notification
Once the transfer is complete, the
DMA controller sends an interrupt
signal back to the CPU.
This streamlined process ensures efficient data movement without constant CPU supervision.
5.
DMA Controller Components
1
AddressRegister
Stores the starting memory address for the data
transfer, guiding where data will be read from or
written to.
2
Word Count Register
Keeps track of the exact number of data units (bytes
or words) remaining to be transferred during the
operation.
3
Control Register
Defines critical parameters like the direction of the
transfer (read/write) and the specific mode of
operation (e.g., burst, cycle-stealing).
4
Internal Buses
Dedicated pathways within the controller ensure
efficient and rapid data flow between its various
internal components.
6.
Types of DMA
Third-partyDMA
• Utilizes a dedicated DMA controller chip, often
integrated onto the motherboard.
• The controller acts as an intermediary, managing all
aspects of the data transfer.
First-party DMA (Bus Mastering)
• The peripheral device itself has the capability to
become a "bus master."
• This allows the device to directly control the system
bus and transfer data to/from memory without a
separate controller.
Further specialized variants include Single-ended, Dual-ended, Arbitrated-ended, and Interleaved DMA, each
designed for specific system architectures and performance requirements.
7.
Modes of DMAData Transfer
Burst Mode
The DMA controller takes full
control of the bus and transfers
the entire data block in one
continuous sequence. The CPU is
paused until the transfer is
complete.
Cycle-Stealing Mode
The DMA controller transfers one
byte (or word) of data at a time,
"stealing" a bus cycle from the
CPU. The CPU remains
intermittently active, causing
minimal disruption.
Transparent Mode
Data transfers only occur when
the CPU bus is idle, making this
the least disruptive mode.
However, it can be slower as it
waits for CPU inactivity.
8.
Benefits of DMA
ReducedCPU Load
DMA offloads tedious data
movement tasks from the CPU,
allowing it to focus on higher-
level computations and
application logic.
Enhanced Parallelism
The CPU can continue
processing other tasks or
executing instructions while
DMA simultaneously handles
data transfers, boosting
multitasking capabilities.
Improved Performance
This concurrent operation
significantly enhances overall
system performance,
particularly in data-intensive
applications like multimedia
streaming, high-speed
networking, and large-scale
data storage operations.
9.
Common Applications of
DMA
•Disk Drive Controllers: Essential for fast data reads and writes,
allowing rapid access to storage devices without CPU
intervention.
• Graphics Cards (GPUs): Crucial for rapid updates of frame
buffers, enabling smooth video playback and complex 3D
rendering.
• Network Cards (NICs): Facilitate high-speed packet transfers,
enabling quick and efficient data communication over networks.
• FPGA Data Transfers: Used in embedded systems and custom
hardware for efficient data movement between programmable
logic devices and memory.
10.
DMA vs. RelatedTechnologies
Ultra DMA An advanced burst transfer mode
for IDE/ATA interfaces.
Speeds up to 33 MBps (earlier
versions), enhancing hard drive
performance.
Remote Direct Memory Access
(RDMA)
Allows direct memory access from
one computer to another over a
network.
Bypasses CPU involvement on the
remote machine, reducing latency
and overhead.
Bus Mastering A form of DMA where peripheral
devices can act as bus masters.
Enables devices to directly control
the system bus for data transfer,
reducing CPU load.
These technologies build upon or complement the core concept of DMA to achieve even greater efficiency and
performance in specific computing contexts.
11.
Summary and KeyTakeaways
CPU Offload
DMA fundamentally offloads data transfer
responsibilities from the CPU, significantly
boosting overall system efficiency and freeing up
CPU cycles for core computational tasks.
Optimized Data Handling
With multiple types (Third-party, First-party) and
transfer modes (Burst, Cycle-Stealing,
Transparent), DMA can be optimized to meet
diverse system needs and performance
requirements.
Foundation of High Performance
DMA is an essential technology for high-
performance computing and real-time data
handling, enabling modern devices to operate
efficiently with minimal CPU involvement.
Enables Modern Computing
It underpins the smooth operation of critical
components like disk drives, graphics cards, and
network cards, making today's fast and
responsive computing possible.