The Wayback Machine - https://web.archive.org/web/20240731071850/https://www.geeksforgeeks.org/direct-memory-access-with-dma-controller-8257-8237/
Open In App

Direct memory access with DMA controller 8257/8237

Last Updated : 14 May, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

Suppose any device which is connected to input-output port wants to transfer data to memory, first of all it will send input-output port address and control signal, input-output read to input-output port, then it will send memory address and memory write signal to memory where data has to be transferred. In normal input-output technique the processor becomes busy in checking whether any input-output operation is completed or not for next input-output operation, therefore this technique is slow. 

This problem of slow data transfer between input-output port and memory or between two memory is avoided by implementing Direct Memory Access (DMA) technique. This is faster as the microprocessor/computer is bypassed and the control of address bus and data bus is given to the DMA controller. 
 

  • HOLD – hold signal 
     
  • HLDA – hold acknowledgment 
     
  • DREQ – DMA request 
     
  • DACK – DMA acknowledgment 
     

 

Suppose a floppy drive that is connected at input-output port wants to transfer data to memory, the following steps are performed: 
 

  • Step-1: First of all the floppy drive will send a DMA request (DREQ) to the DMAC, it means the floppy drive wants its DMA service. 

     

  • Step-2: Now the DMAC will send a HOLD signal to the CPU. 

     

  • Step-3: After accepting the DMA service request from the DMAC, the CPU will send hold acknowledgment (HLDA) to the DMAC, it means the microprocessor has released control of the address bus the data bus to DMAC and the microprocessor/computer is bypassed during DMA service. 
     
  • Step-4: Now the DMAC will send one acknowledgement (DACL) to the floppy drive which is connected at the input-output port. It means the DMAC tells the floppy drive be ready for its DMA service. 
     
  • Step-5: Now with the help of input-output read and memory write signal the data is transferred from the floppy drive to the memory. 
     

Modes of DMAC: 

           1. Single Mode – In this only one channel is used, means only a single DMAC is connected to the bus system. 

 

            2. Cascade Mode – In this multiple channels are used, we can further cascade more number of DMACs. 

 

 

Advantages:

Improved performance: DMA improves system performance by freeing up the CPU to perform other tasks while data is being transferred between memory and I/O devices. This allows for faster and more efficient data transfer.
Reduced CPU overhead: With DMA, the CPU is not required to be involved in data transfer, which reduces the CPU overhead and allows it to focus on other tasks. This is particularly useful in real-time systems where low latency and fast response times are important.
Support for high-bandwidth devices: DMA can support high-bandwidth devices such as graphics cards and network interfaces that require fast data transfer rates.
Efficient use of system resources: DMA allows multiple devices to access memory simultaneously, which makes more efficient use of system resources.
 

Disadvantages:

Complexity: DMA requires specialized hardware and software to function, which can add to the complexity of a system. This can make it difficult to implement and troubleshoot.
Security risks: DMA can be a security risk if not properly configured or secured. Hackers can exploit vulnerabilities in DMA to gain unauthorized access to a computer system or steal data.
Limited control: Since the CPU is not involved in data transfer with DMA, it has limited control over the transfer process. This can lead to data corruption or errors if the transfer process is not properly managed.
Resource conflicts: DMA can lead to resource conflicts if multiple devices attempt to access memory simultaneously. This can cause system instability and performance issues if not properly managed.
 


Previous Article
Next Article

Similar Reads

Direct Memory Access (DMA) Controller in Computer Architecture
DMA Controller is a hardware device that allows I/O devices to directly access memory with less participation of the processor. DMA controller needs the same old circuits of an interface to communicate with the CPU and Input/Output devices. What is a DMA Controller?Direct Memory Access uses hardware for accessing the memory, that hardware is called
5 min read
Internal Registers of DMA Controller
There are various types of controller 1. Base Address Register (16 bit)2. Base Word Count Register (16 bit)3. Current Address Register (16 bit)4. Current Word Count Register (16 bit)5. Temporary Address Register (16 bit)6. Temporary Word Count Register (16 bit)7. Status Register (8 bit)8. Command Register (8 bit)9. Temporary Register (8 bit)10. Mod
3 min read
Difference between Uniform Memory Access (UMA) and Non-uniform Memory Access (NUMA)
Multiprocessors can be categorized into three shared-memory model which are: Uniform Memory Access (UMA)Non-uniform Memory Access (NUMA)Cache-only Memory Access (COMA) Uniform Memory Access (UMA): In UMA, where Single memory controller is used. Uniform Memory Access is slower than non-uniform Memory Access. In Uniform Memory Access, bandwidth is re
4 min read
Random Access Memory (RAM) and Read Only Memory (ROM)
Random Access Memory (RAM) is a type of computer memory that is used to temporarily store data that the computer is currently using or processing. RAM is volatile memory, which means that the data stored in it is lost when the power is turned off. RAM is typically used to store the operating system, application programs, and data that the computer
5 min read
Difference between Random Access Memory (RAM) and Content Addressable Memory (CAM)
Random Access Memory (RAM) is used to read and write. It is the part of primary memory and used in order to store running applications (programs) and program's data for performing operation. It is mainly of two types: Dynamic RAM (or DRAM) and Static RAM (or SRAM). RAM is made up of small memory cells that are arranged in a grid pattern. Each cell
4 min read
I/O Interface (Interrupt and DMA Mode)
The method that is used to transfer information between internal storage and external I/O devices is known as I/O interface. The CPU is interfaced using special communication links by the peripherals connected to any computer system. These communication links are used to resolve the differences between CPU and peripheral. There exists special hardw
6 min read
I/O Program Controlled Transfer vs DMA Transfer
In this article, we will discuss the overview of Modes of transfer and mainly our focus will be on the difference between I/O Program Controlled Transfer vs DMA Transfer. Let's discuss it one by one. Prerequisite – Modes of Transfer in detail Modes of TransferThe CPU executes the I/O instructions & accepts the data temporarily but finally, the
3 min read
Modes of DMA Transfer
In this article we will try to understand the details associated with the DMA (Direct Memory Access) like what exactly DMA is or how it works and also further we will see various modes of DMA Transfer (like Burst mode and other modes). Before directly jumping into the details associated with the modes of DMA transfer let us first try to understand
5 min read
Difference between Virtual memory and Cache memory
Cache Memory: Cache memory increases the accessing speed of CPU. It is not a technique but a memory unit i.e a storage device. In cache memory, recently used data is copied. Whenever the program is ready to be executed, it is fetched from main memory and then copied to the cache memory. But, if its copy is already present in the cache memory then t
2 min read
Difference between Byte Addressable Memory and Word Addressable Memory
Memory is a storage component in the Computer used to store application programs. The Memory Chip is divided into equal parts called as "CELLS" . Each Cell is uniquely identified by a binary number called as "ADDRESS" . For example, the Memory Chip configuration is represented as '64 K x 8' as shown in the figure below. The following information ca
3 min read
three90RightbarBannerImg