SlideShare a Scribd company logo
Course Website: http://faculty.iitr.ac.in/~sudiproy.fcs/csn221_2015.html
Piazza Site: https://piazza.com/iitr.ac.in/fall2015/csn221
Dr. Sudip Roy
CSN‐221: COMPUTER ARCHITECTURE
AND MICROPROCESSORS
Input/Output (I/O) Devices
(Lecture – 36)
Dr. Sudip Roy 2
Direct Memory Access:
 Interrupt driven and programmed I/O require active CPU intervention
 Transfer rate is limited
 CPU is tied up
 Additional Module (hardware) on bus
 DMA controller takes over from CPU for I/O
Dr. Sudip Roy 3
Taking I/O Responsibility from the CPU: DMA
Dr. Sudip Roy 4
DMA Operation:
 CPU tells DMA controller:‐
 Read/Write
 Device address
 Starting address of memory block for data
 Amount of data to be transferred
 CPU carries on with other work
 DMA controller deals with transfer
 DMA controller sends interrupt when finished
Dr. Sudip Roy 5
Direct Memory Access (DMA) transfer:
 When the processor needs to be accessed again and again to perform a
repeated data copying operation, then
 to save time & power, control of the data transfer lines is given to the
input device controller
 HOLD & HLDA are used for this process
 HOLD is sent from I/O device to the processor asking for control of the data
lines
 HLDA is sent from processor to the I/O device acknowledging the transfer of
the control of the data lines.
Dr. Sudip Roy 6
Direct Memory Access (DMA) transfer:
 DMA is an IO technique where external IO device requests the use of the
MPU buses.
 Allows external IO devices to gain high speed access to the memory.
 Example of IO devices that use DMA: disk memory system.
 If HOLD=1, 8085 will place it address, data and control pins at their high‐
impedance.
 A DMA acknowledgement is signaled by HLDA=1.
 In DMA, there are 2 modes
 Burst Mode
 Cycle stealing
Dr. Sudip Roy 7
DMA: HOLD and HLDA
HLDA
HLDA
Dr. Sudip Roy 8
Direct Memory Access (DMA) controller:
Dr. Sudip Roy 9
Direct Memory Access (DMA) controller:
During a block input byte transfer, the following sequence occurs as the data byte is
sent from the interface to the memory:
1. The interface sends the DMA controller a request for DMA service.
2. A Bus request is made to the HOLD pin (active High) on the 8085 µp and the
controller gains control of the bus.
3. A Bus grant is returned to the DMA controller from the Hold Acknowledge (HLDA)
pin (active High) on the 8085 µp.
4. The DMA controller places contents of the address register onto the address bus.
5. The controller sends the interface a DMA acknowledgment, which tells the
interface to put data on the data bus. (For an output it signals the interface to
latch the next data placed on the bus.)
6. The data byte is transferred to the memory location indicated by the address bus.
7. The interface latches the data.
8. The Bus request is dropped, the HOLD pin goes Low, and the controller
relinquishes the bus.
9. The Bus grant from the 8085 µp is dropped and the HLDA pin goes Low.
10.The address register is incremented by 1.
11.The byte count is decremented by 1.
12.If the byte count is non‐zero, return to step 1, otherwise stop.
Dr. Sudip Roy 10
Typical DMA Module Diagram:
Dr. Sudip Roy 11
DMA Transfer: Cycle Stealing
 DMA controller takes over bus for a cycle
 Transfer of one word of data
 Not an interrupt
 CPU does not switch context
 CPU suspended just before it accesses bus
 i.e., before an operand or data fetch or a data write
 Slows down CPU but not as much as CPU doing transfer
Dr. Sudip Roy 12
DMA Configurations (1):
 Single Bus, Detached DMA controller
 Each transfer uses bus twice
 I/O to DMA then DMA to memory
 CPU is suspended twice
Dr. Sudip Roy 13
DMA Configurations (2):
 Single Bus, Integrated DMA controller
 Controller may support >1 device
 Each transfer uses bus once
 DMA to memory
 CPU is suspended once
Dr. Sudip Roy 14
DMA Configurations (3):
 Separate I/O Bus
 Bus supports all DMA enabled devices
 Each transfer uses bus once
 DMA to memory
 CPU is suspended once
Dr. Sudip Roy 15
Direct Memory Access (DMA) controller:
Dr. Sudip Roy 16
8237 DMA Usage of Systems Bus:
Dr. Sudip Roy 17
Intel 8237A DMA Controller:
 Interfaces to 80x86 family and DRAM
 When DMA module needs buses it sends HOLD signal to processor
 CPU responds HLDA (hold acknowledge)
 DMA module can use buses
 E.g. transfer data from memory to disk
1. Device requests service of DMA by pulling DREQ (DMA request) high
2. DMA puts high on HRQ (hold request)
3. CPU finishes present bus cycle (not necessarily present instruction)
and puts high on HDLA (hold acknowledge). HOLD remains active for
duration of DMA
4. DMA activates DACK (DMA acknowledge), telling device to start
transfer
5. DMA starts transfer by putting address of first byte on address bus
and activating MEMR; it then activates IOW to write to peripheral.
DMA decrements counter and increments address pointer. Repeat
until count reaches zero
6. DMA deactivates HRQ, giving bus back to CPU
Dr. Sudip Roy 18
Mode of Data Transfer:
Dr. Sudip Roy 19
Serial and Parallel Communication:
Dr. Sudip Roy 20
Data Communication: Serial vs. Parallel
Dr. Sudip Roy 21
Type of Serial Communications:
Dr. Sudip Roy 22
Format of Serial Communications:
Dr. Sudip Roy 23
Format of Serial Communications:
Dr. Sudip Roy 24
Type of Serial Communications:
Stop bits
Dr. Sudip Roy 25
Framing in Asynchronous:

More Related Content

PPTX
Direct memory access (dma)
PPTX
Direct Memory Access(DMA)
PPTX
Direct access memory
PPTX
A case study on Data Memory Access. - DMA - DMA Controller -Working Mechanism...
PPTX
DMA operation
PDF
discuss the drawbacks of programmed and interrupt driven io and des.pdf
PPTX
Direct memory access controller slide.pptx
PPTX
Dma and dma controller 8237
Direct memory access (dma)
Direct Memory Access(DMA)
Direct access memory
A case study on Data Memory Access. - DMA - DMA Controller -Working Mechanism...
DMA operation
discuss the drawbacks of programmed and interrupt driven io and des.pdf
Direct memory access controller slide.pptx
Dma and dma controller 8237

Similar to CSN221_Lec_36 Computer Architecture and Microprocessor (20)

PPTX
Direct Memory Access
PPTX
What is Input output processor by hdl and coa.pptx
PPT
8237 / 8257 DMA
PDF
Module 3 special purpose programmable devices and their interfacing
PPTX
PPTX
Direct access memory
PPTX
This pot is about computer architecture.
PPTX
ch -6 IO.pptx
PPT
07 Input Output
PPTX
PPTX
Direct memory access
PPT
8555046.ppt
PPTX
8257 DMA Controller
PPTX
Direct Memory Access (DMA).pptx
PPTX
DMA airctecture.pptx
PDF
Direct Memory Access
PPTX
Direct Memory Access_Unit 5.pptx
PPTX
DMA Versus Polling or Interrupt Driven I/O
Direct Memory Access
What is Input output processor by hdl and coa.pptx
8237 / 8257 DMA
Module 3 special purpose programmable devices and their interfacing
Direct access memory
This pot is about computer architecture.
ch -6 IO.pptx
07 Input Output
Direct memory access
8555046.ppt
8257 DMA Controller
Direct Memory Access (DMA).pptx
DMA airctecture.pptx
Direct Memory Access
Direct Memory Access_Unit 5.pptx
DMA Versus Polling or Interrupt Driven I/O
Ad

More from ssuser034ce1 (20)

PDF
CSN221_Lec_27 Computer Architecture and Microprocessor
PDF
CSN221_Lec_26 Computer Architecture and Microprocessor
PDF
CSN221_Lec_25 Computer Architecture and Microprocessor
PDF
CSN221_Lec_35 Computer Architecture and Microprocessor
PDF
CSN221_Lec_34 Computer Architecture and Microprocessor
PDF
CSN221_Lec_22.pdf Computer Architecture and Microprocessor
PDF
CSN221_Lec_17.pdf Multi Cycle Datapath Design
PDF
CSN221_Lec_16.pdf MIPS ISA and Datapath design
PDF
CSN221_Lec_15.pdf MIPS ISA and Datapath design
PDF
Computer Architecture CSN221_Lec_37_SpecialTopics.pdf
PDF
CSN221_Lec_5.pdf Computer Organization, CPU Structure and Functions
PDF
CSN221_Lec_4.pdf Computer Organization & Architecture
PDF
CS-102 Data Structures huffman coding.pdf
PDF
CS-102 Data Structures HashFunction CS102.pdf
PDF
CS-102 Data Structure lectures on Graphs
PDF
CS-102 DS-class04a Lectures DS Class.pdf
PDF
CS-102 DS-class03 Class DS Lectures .pdf
PDF
CS-102 DS-class_01_02 Lectures Data .pdf
PDF
CS-102 BT_24_3_14 Binary Tree Lectures.pdf
PDF
CS-102 Course_ Binary Tree Lectures .pdf
CSN221_Lec_27 Computer Architecture and Microprocessor
CSN221_Lec_26 Computer Architecture and Microprocessor
CSN221_Lec_25 Computer Architecture and Microprocessor
CSN221_Lec_35 Computer Architecture and Microprocessor
CSN221_Lec_34 Computer Architecture and Microprocessor
CSN221_Lec_22.pdf Computer Architecture and Microprocessor
CSN221_Lec_17.pdf Multi Cycle Datapath Design
CSN221_Lec_16.pdf MIPS ISA and Datapath design
CSN221_Lec_15.pdf MIPS ISA and Datapath design
Computer Architecture CSN221_Lec_37_SpecialTopics.pdf
CSN221_Lec_5.pdf Computer Organization, CPU Structure and Functions
CSN221_Lec_4.pdf Computer Organization & Architecture
CS-102 Data Structures huffman coding.pdf
CS-102 Data Structures HashFunction CS102.pdf
CS-102 Data Structure lectures on Graphs
CS-102 DS-class04a Lectures DS Class.pdf
CS-102 DS-class03 Class DS Lectures .pdf
CS-102 DS-class_01_02 Lectures Data .pdf
CS-102 BT_24_3_14 Binary Tree Lectures.pdf
CS-102 Course_ Binary Tree Lectures .pdf
Ad

Recently uploaded (20)

PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
web development for engineering and engineering
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
PPT on Performance Review to get promotions
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Current and future trends in Computer Vision.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPT
introduction to datamining and warehousing
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
web development for engineering and engineering
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Internet of Things (IOT) - A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
PPT on Performance Review to get promotions
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Current and future trends in Computer Vision.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
CYBER-CRIMES AND SECURITY A guide to understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
introduction to datamining and warehousing
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Mechanical Engineering MATERIALS Selection
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026

CSN221_Lec_36 Computer Architecture and Microprocessor

  • 1. Course Website: http://faculty.iitr.ac.in/~sudiproy.fcs/csn221_2015.html Piazza Site: https://piazza.com/iitr.ac.in/fall2015/csn221 Dr. Sudip Roy CSN‐221: COMPUTER ARCHITECTURE AND MICROPROCESSORS Input/Output (I/O) Devices (Lecture – 36)
  • 2. Dr. Sudip Roy 2 Direct Memory Access:  Interrupt driven and programmed I/O require active CPU intervention  Transfer rate is limited  CPU is tied up  Additional Module (hardware) on bus  DMA controller takes over from CPU for I/O
  • 3. Dr. Sudip Roy 3 Taking I/O Responsibility from the CPU: DMA
  • 4. Dr. Sudip Roy 4 DMA Operation:  CPU tells DMA controller:‐  Read/Write  Device address  Starting address of memory block for data  Amount of data to be transferred  CPU carries on with other work  DMA controller deals with transfer  DMA controller sends interrupt when finished
  • 5. Dr. Sudip Roy 5 Direct Memory Access (DMA) transfer:  When the processor needs to be accessed again and again to perform a repeated data copying operation, then  to save time & power, control of the data transfer lines is given to the input device controller  HOLD & HLDA are used for this process  HOLD is sent from I/O device to the processor asking for control of the data lines  HLDA is sent from processor to the I/O device acknowledging the transfer of the control of the data lines.
  • 6. Dr. Sudip Roy 6 Direct Memory Access (DMA) transfer:  DMA is an IO technique where external IO device requests the use of the MPU buses.  Allows external IO devices to gain high speed access to the memory.  Example of IO devices that use DMA: disk memory system.  If HOLD=1, 8085 will place it address, data and control pins at their high‐ impedance.  A DMA acknowledgement is signaled by HLDA=1.  In DMA, there are 2 modes  Burst Mode  Cycle stealing
  • 7. Dr. Sudip Roy 7 DMA: HOLD and HLDA HLDA HLDA
  • 8. Dr. Sudip Roy 8 Direct Memory Access (DMA) controller:
  • 9. Dr. Sudip Roy 9 Direct Memory Access (DMA) controller: During a block input byte transfer, the following sequence occurs as the data byte is sent from the interface to the memory: 1. The interface sends the DMA controller a request for DMA service. 2. A Bus request is made to the HOLD pin (active High) on the 8085 µp and the controller gains control of the bus. 3. A Bus grant is returned to the DMA controller from the Hold Acknowledge (HLDA) pin (active High) on the 8085 µp. 4. The DMA controller places contents of the address register onto the address bus. 5. The controller sends the interface a DMA acknowledgment, which tells the interface to put data on the data bus. (For an output it signals the interface to latch the next data placed on the bus.) 6. The data byte is transferred to the memory location indicated by the address bus. 7. The interface latches the data. 8. The Bus request is dropped, the HOLD pin goes Low, and the controller relinquishes the bus. 9. The Bus grant from the 8085 µp is dropped and the HLDA pin goes Low. 10.The address register is incremented by 1. 11.The byte count is decremented by 1. 12.If the byte count is non‐zero, return to step 1, otherwise stop.
  • 10. Dr. Sudip Roy 10 Typical DMA Module Diagram:
  • 11. Dr. Sudip Roy 11 DMA Transfer: Cycle Stealing  DMA controller takes over bus for a cycle  Transfer of one word of data  Not an interrupt  CPU does not switch context  CPU suspended just before it accesses bus  i.e., before an operand or data fetch or a data write  Slows down CPU but not as much as CPU doing transfer
  • 12. Dr. Sudip Roy 12 DMA Configurations (1):  Single Bus, Detached DMA controller  Each transfer uses bus twice  I/O to DMA then DMA to memory  CPU is suspended twice
  • 13. Dr. Sudip Roy 13 DMA Configurations (2):  Single Bus, Integrated DMA controller  Controller may support >1 device  Each transfer uses bus once  DMA to memory  CPU is suspended once
  • 14. Dr. Sudip Roy 14 DMA Configurations (3):  Separate I/O Bus  Bus supports all DMA enabled devices  Each transfer uses bus once  DMA to memory  CPU is suspended once
  • 15. Dr. Sudip Roy 15 Direct Memory Access (DMA) controller:
  • 16. Dr. Sudip Roy 16 8237 DMA Usage of Systems Bus:
  • 17. Dr. Sudip Roy 17 Intel 8237A DMA Controller:  Interfaces to 80x86 family and DRAM  When DMA module needs buses it sends HOLD signal to processor  CPU responds HLDA (hold acknowledge)  DMA module can use buses  E.g. transfer data from memory to disk 1. Device requests service of DMA by pulling DREQ (DMA request) high 2. DMA puts high on HRQ (hold request) 3. CPU finishes present bus cycle (not necessarily present instruction) and puts high on HDLA (hold acknowledge). HOLD remains active for duration of DMA 4. DMA activates DACK (DMA acknowledge), telling device to start transfer 5. DMA starts transfer by putting address of first byte on address bus and activating MEMR; it then activates IOW to write to peripheral. DMA decrements counter and increments address pointer. Repeat until count reaches zero 6. DMA deactivates HRQ, giving bus back to CPU
  • 18. Dr. Sudip Roy 18 Mode of Data Transfer:
  • 19. Dr. Sudip Roy 19 Serial and Parallel Communication:
  • 20. Dr. Sudip Roy 20 Data Communication: Serial vs. Parallel
  • 21. Dr. Sudip Roy 21 Type of Serial Communications:
  • 22. Dr. Sudip Roy 22 Format of Serial Communications:
  • 23. Dr. Sudip Roy 23 Format of Serial Communications:
  • 24. Dr. Sudip Roy 24 Type of Serial Communications: Stop bits
  • 25. Dr. Sudip Roy 25 Framing in Asynchronous: