SlideShare a Scribd company logo
1 of 23
CHAPTER Five
INPUT/OUTPUT UNIT
1
 Introduction
 Input/output Modules
I/O Module Function
I/O Module Structure
 Input/output Techniques
Programmed I/O
Interrupt Driven I/O
Direct Memory Access
2
OUTLINE
 I/O modules
Third key element of a computer system, next to processor and memory
Interfaces to a system bus and controls one or more peripheral devices
Contains logic/intelligence
 To perform communication function b/n the peripherals and the bus
 Definition : Peripheral device/ Peripheral
An external device connected to an I/O module
3
INTRODUCTION
 Why peripheral devices not connected directly to the system bus ?
 Reasons
Wide variety of peripherals with different method of operation
 Impractical to incorporate the necessary logic within the control processor to a range of devices
Delivering different amounts of data
 At different speeds
 In different formats
All slower than CPU and RAM
Hence, an I/O module is required
4
INTRODUCTION…
 Generic model of I/O module
Interface to CPU and Memory via the system bus
Interface to one or more peripherals via data links
INTRODUCTION…
5
 External devices
Used to accomplish I/O operations
Provides a means of exchanging data between
 External environment
 Computer
Attached to a computer by a link to an I/O module
 The link is used to exchange
 Control, status and data
6
INTRODUCTION…
 External devices broadly classified into three categories:
Human readable devices
 Suitable for communicating with the computer user
 E.g., Screen, printer, keyboard
Machine readable devices
 Suitable for communicating with equipment
 E.g., magnetic disk and tape system
Communication devices
 Allow the computer to exchange data with a remote device
 E.g., Modem, Network Interface Card (NIC)
7
INTRODUCTION…
The major functions performed by I/O module fall into the following
categories
Control & Timing
Processor Communication
Device Communication
Data Buffering
Error Detection
8
I/O MODULE FUNCTION
 A block diagram of an I/O module
I/O MODULE STRUCTURE
9
 Module connects to the rest of the computer through a set of signal lines –
system bus
 Data transferred to and from the module are buffered in one or more data registers
 Status information provided through status registers
Status registers may also function as control registers, to accept detailed control information
from the processor
 Module logic interacts with processor via a set of control signal lines
 Processor uses control signal lines to issue commands to the I/O module
Some of the control lines may be used by the I/O module, for arbitration and status signals
 Module must recognize and generate addresses for devices it controls
 The I/O module contains logic specific to the interface with each device that it controls
I/O MODULE STRUCTURE…
10
 Three techniques exist for I/O operations:
Programmed I/O
 The processor issues an I/O command to the I/O module and
waits until the I/O operation is complete
 If the processor is faster than the I/O module, it wastes processor time
Interrupt driven I/O
 The processor issues an I/O command, continues to execute other instructions and is
interrupted by the I/O module when the latter has completed its work
Direct Memory Access (DMA)
 The I/O module and main memory exchange data directly, without the processor involvement
11
INPUT OUTPUT TECHNIQUES
 Overview of Programmed I/O
CPU issues an I/O command to the appropriate I/O module
I/O module performs the requested operation
I/O module sets status bits in the I/O status register
CPU checks status bits periodically
 I/O module does not inform/interrupt CPU directly
 CPU waits for I/O module to complete operation
 Wastes CPU time
12
PROGRAMMED I/O…
 Overview of Interrupt Driven I/O
The CPU issues an I/O command to the I/O module, and then continue to do some
other useful work
The I/O module will interrupt the processor to request service when it is ready to
exchange data with the processor
The processor executes the data transfer and then resumes its former processing
 Interrupt Driven I/O Features
Overcomes CPU waiting
No repeated CPU checking of device
I/O module interrupts when ready
INTERRUPT DRIVEN I/O…
13
 Basic Operation (for input)
CPU issues read command
I/O module gets data from peripheral while CPU does other work
I/O module interrupts CPU
CPU requests data
I/O module transfers data
INTERRUPT DRIVEN I/O…
14
 CPU Viewpoint (for input)
Issue read command
Do other work
Check for interrupt at end of each instruction cycle
If interrupted:
 Save context (registers) of the current program
 Process the interrupt
 Read a data from the I/O module and store it in memory
 I/O module viewpoint (for input)
I/O module receives read command from the CPU
I/O module reads data from associated peripheral
I/O module puts the data in its data registers
The module signals an interrupt over control line
The module places the data on the data bus when requested by the
processor
The module is ready for another I/O operation
INTERRUPT DRIVEN I/O…
15
 Comparison of the three techniques used when a block of data is
read from a peripheral device into a memory
COMPARISON
16
 The need for Direct Memory Access
Interrupt driven I/O efficient than programmed I/O
But both, interrupt driven and programmed I/O, require active
CPU intervention
 Any data transfer traverses a path through the processor
Both forms of I/O suffer from two inherent drawbacks
 I/O transfer rate is limited by speed of the processor to test and service a device
 CPU is tied up in managing an I/O transfer
 A no of instructions must be executed for each I/O transfer
 DMA is the solution
More efficient technique to move large blocks of data
DIRECT MEMORY ACCESS…
17
 DMA Function
DMA involves an additional module on the system bus
 DMA module/controller
DMA module/ Controller
 Can take over control of the system bus from the processor
 When the processor does not need it OR
 Force the processor to suspend operation temporarily Often called cycle
stealing, as the DMA module in effect steals a bus cycle
 Why ? to transfer data to/from memory over the system bus
18
DIRECT MEMORY ACCESS…
 Typical DMA Module Diagram
DIRECT MEMORY ACCESS…
19
 DMA Operation
When the processor wants to read/write a block of data. It tells the DMA controller the
following information:
 Whether Read/Write is requested
 Using the read/write control line b/n the processor and the DMAmodule
 The address of the I/O device involved
 Communicated over data bus
 Starting location in memory to read from or writeto
 Communicated over data lines and stored by the DMA in its data register
 Amount of data to be transferred
 Communicated via data lines and stored in the data countregister
DIRECT MEMORY ACCESS…
 DMA Operation…
CPU carries on with other work
DMA controller deals with transfer
DMA controller sends interrupt when finished
 The processor is involved only
At the beginning
At end of the transfer
DIRECT MEMORY ACCESS…
 DMA Transfer Cycle Stealing
DMA controller takes over bus for acycle
Transfer one word of data
Not an interrupt
 CPU does not switch context
CPU suspended just before it accessesbus
 i.e. before an operand or data fetch or a datawrite
Slows down CPU but not as much as CPU doing transfer
DIRECT MEMORY ACCESS…
DMA and Interrupt Breakpoints
During an Instruction Cycle
22

More Related Content

Similar to Chapter 5 IO Unit.pptx we are electrical

Computer function-and-interconnection 3
Computer function-and-interconnection 3Computer function-and-interconnection 3
Computer function-and-interconnection 3Mujaheed Sulantingan
 
IO Techniques in Computer Organization
IO Techniques in Computer OrganizationIO Techniques in Computer Organization
IO Techniques in Computer OrganizationOm Prakash
 
CH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfCH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfcauuthovohoaichau
 
Chapter 6 input output
Chapter 6 input outputChapter 6 input output
Chapter 6 input outputrisal07
 
Input/Output System (Part 2)
Input/Output System (Part 2) Input/Output System (Part 2)
Input/Output System (Part 2) Ajeng Savitri
 
input output ports
input output portsinput output ports
input output portsaslamslides
 
Input output in computer Orgranization and architecture
Input output in computer Orgranization and architectureInput output in computer Orgranization and architecture
Input output in computer Orgranization and architecturevikram patel
 
Computer organization
Computer organizationComputer organization
Computer organizationRvishnupriya2
 
Computer organization
Computer organization Computer organization
Computer organization vishnu973656
 
COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxRuhul Amin
 

Similar to Chapter 5 IO Unit.pptx we are electrical (20)

Computer function-and-interconnection 3
Computer function-and-interconnection 3Computer function-and-interconnection 3
Computer function-and-interconnection 3
 
I/O Management
I/O ManagementI/O Management
I/O Management
 
IO Techniques in Computer Organization
IO Techniques in Computer OrganizationIO Techniques in Computer Organization
IO Techniques in Computer Organization
 
CH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfCH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdf
 
Chapter 6 input output
Chapter 6 input outputChapter 6 input output
Chapter 6 input output
 
Input/Output System (Part 2)
Input/Output System (Part 2) Input/Output System (Part 2)
Input/Output System (Part 2)
 
07 Input Output
07  Input  Output07  Input  Output
07 Input Output
 
input output ports
input output portsinput output ports
input output ports
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Counit2 2
Counit2 2Counit2 2
Counit2 2
 
Input-Output Modules
Input-Output ModulesInput-Output Modules
Input-Output Modules
 
03 Buses
03 Buses03 Buses
03 Buses
 
computer Unit 3
computer Unit 3computer Unit 3
computer Unit 3
 
Input output in computer Orgranization and architecture
Input output in computer Orgranization and architectureInput output in computer Orgranization and architecture
Input output in computer Orgranization and architecture
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 
Ch 01 os8e
Ch 01  os8eCh 01  os8e
Ch 01 os8e
 
Modes of transfer
Modes of transferModes of transfer
Modes of transfer
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Computer organization
Computer organization Computer organization
Computer organization
 
COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptx
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 

Chapter 5 IO Unit.pptx we are electrical

  • 2.  Introduction  Input/output Modules I/O Module Function I/O Module Structure  Input/output Techniques Programmed I/O Interrupt Driven I/O Direct Memory Access 2 OUTLINE
  • 3.  I/O modules Third key element of a computer system, next to processor and memory Interfaces to a system bus and controls one or more peripheral devices Contains logic/intelligence  To perform communication function b/n the peripherals and the bus  Definition : Peripheral device/ Peripheral An external device connected to an I/O module 3 INTRODUCTION
  • 4.  Why peripheral devices not connected directly to the system bus ?  Reasons Wide variety of peripherals with different method of operation  Impractical to incorporate the necessary logic within the control processor to a range of devices Delivering different amounts of data  At different speeds  In different formats All slower than CPU and RAM Hence, an I/O module is required 4 INTRODUCTION…
  • 5.  Generic model of I/O module Interface to CPU and Memory via the system bus Interface to one or more peripherals via data links INTRODUCTION… 5
  • 6.  External devices Used to accomplish I/O operations Provides a means of exchanging data between  External environment  Computer Attached to a computer by a link to an I/O module  The link is used to exchange  Control, status and data 6 INTRODUCTION…
  • 7.  External devices broadly classified into three categories: Human readable devices  Suitable for communicating with the computer user  E.g., Screen, printer, keyboard Machine readable devices  Suitable for communicating with equipment  E.g., magnetic disk and tape system Communication devices  Allow the computer to exchange data with a remote device  E.g., Modem, Network Interface Card (NIC) 7 INTRODUCTION…
  • 8. The major functions performed by I/O module fall into the following categories Control & Timing Processor Communication Device Communication Data Buffering Error Detection 8 I/O MODULE FUNCTION
  • 9.  A block diagram of an I/O module I/O MODULE STRUCTURE 9
  • 10.  Module connects to the rest of the computer through a set of signal lines – system bus  Data transferred to and from the module are buffered in one or more data registers  Status information provided through status registers Status registers may also function as control registers, to accept detailed control information from the processor  Module logic interacts with processor via a set of control signal lines  Processor uses control signal lines to issue commands to the I/O module Some of the control lines may be used by the I/O module, for arbitration and status signals  Module must recognize and generate addresses for devices it controls  The I/O module contains logic specific to the interface with each device that it controls I/O MODULE STRUCTURE… 10
  • 11.  Three techniques exist for I/O operations: Programmed I/O  The processor issues an I/O command to the I/O module and waits until the I/O operation is complete  If the processor is faster than the I/O module, it wastes processor time Interrupt driven I/O  The processor issues an I/O command, continues to execute other instructions and is interrupted by the I/O module when the latter has completed its work Direct Memory Access (DMA)  The I/O module and main memory exchange data directly, without the processor involvement 11 INPUT OUTPUT TECHNIQUES
  • 12.  Overview of Programmed I/O CPU issues an I/O command to the appropriate I/O module I/O module performs the requested operation I/O module sets status bits in the I/O status register CPU checks status bits periodically  I/O module does not inform/interrupt CPU directly  CPU waits for I/O module to complete operation  Wastes CPU time 12 PROGRAMMED I/O…
  • 13.  Overview of Interrupt Driven I/O The CPU issues an I/O command to the I/O module, and then continue to do some other useful work The I/O module will interrupt the processor to request service when it is ready to exchange data with the processor The processor executes the data transfer and then resumes its former processing  Interrupt Driven I/O Features Overcomes CPU waiting No repeated CPU checking of device I/O module interrupts when ready INTERRUPT DRIVEN I/O… 13
  • 14.  Basic Operation (for input) CPU issues read command I/O module gets data from peripheral while CPU does other work I/O module interrupts CPU CPU requests data I/O module transfers data INTERRUPT DRIVEN I/O… 14
  • 15.  CPU Viewpoint (for input) Issue read command Do other work Check for interrupt at end of each instruction cycle If interrupted:  Save context (registers) of the current program  Process the interrupt  Read a data from the I/O module and store it in memory  I/O module viewpoint (for input) I/O module receives read command from the CPU I/O module reads data from associated peripheral I/O module puts the data in its data registers The module signals an interrupt over control line The module places the data on the data bus when requested by the processor The module is ready for another I/O operation INTERRUPT DRIVEN I/O… 15
  • 16.  Comparison of the three techniques used when a block of data is read from a peripheral device into a memory COMPARISON 16
  • 17.  The need for Direct Memory Access Interrupt driven I/O efficient than programmed I/O But both, interrupt driven and programmed I/O, require active CPU intervention  Any data transfer traverses a path through the processor Both forms of I/O suffer from two inherent drawbacks  I/O transfer rate is limited by speed of the processor to test and service a device  CPU is tied up in managing an I/O transfer  A no of instructions must be executed for each I/O transfer  DMA is the solution More efficient technique to move large blocks of data DIRECT MEMORY ACCESS… 17
  • 18.  DMA Function DMA involves an additional module on the system bus  DMA module/controller DMA module/ Controller  Can take over control of the system bus from the processor  When the processor does not need it OR  Force the processor to suspend operation temporarily Often called cycle stealing, as the DMA module in effect steals a bus cycle  Why ? to transfer data to/from memory over the system bus 18 DIRECT MEMORY ACCESS…
  • 19.  Typical DMA Module Diagram DIRECT MEMORY ACCESS… 19
  • 20.  DMA Operation When the processor wants to read/write a block of data. It tells the DMA controller the following information:  Whether Read/Write is requested  Using the read/write control line b/n the processor and the DMAmodule  The address of the I/O device involved  Communicated over data bus  Starting location in memory to read from or writeto  Communicated over data lines and stored by the DMA in its data register  Amount of data to be transferred  Communicated via data lines and stored in the data countregister DIRECT MEMORY ACCESS…
  • 21.  DMA Operation… CPU carries on with other work DMA controller deals with transfer DMA controller sends interrupt when finished  The processor is involved only At the beginning At end of the transfer DIRECT MEMORY ACCESS…
  • 22.  DMA Transfer Cycle Stealing DMA controller takes over bus for acycle Transfer one word of data Not an interrupt  CPU does not switch context CPU suspended just before it accessesbus  i.e. before an operand or data fetch or a datawrite Slows down CPU but not as much as CPU doing transfer DIRECT MEMORY ACCESS… DMA and Interrupt Breakpoints During an Instruction Cycle
  • 23. 22