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 – 35)
Dr. Sudip Roy 2
Introduction to I/O:
Dr. Sudip Roy 3
I/O Peripherals:
Dr. Sudip Roy 4
External Device Block Diagram:
External Devices:
 Human readable
 Screen, printer, keyboard
 Machine readable
 Monitoring and control
 Communication
 Modem
 Network Interface Card (NIC)
Dr. Sudip Roy 5
I/O Problems:
 Wide variety of peripherals
 Delivering different amounts of data
 At different speeds
 In different formats
 All slower than CPU and RAM
 Need I/O modules
I/O Module:
 Interface to CPU and Memory
 Interface to one or more peripherals
Dr. Sudip Roy 6
I/O Module Diagram:
Generic Model of I/O
Module
Dr. Sudip Roy 7
I/O Module Function:
 Control & Timing
 CPU Communication
 Device Communication
 Data Buffering
 Error Detection
 CPU checks I/O module device status
 I/O module returns status
 If ready, CPU requests data transfer
 I/O module gets data from device
 I/O module transfers data to CPU
 Variations for output, DMA, etc.
I/O Steps:
Dr. Sudip Roy 8
I/O Module Decisions:
 Hide or reveal device properties to CPU
 Support multiple or single device
 Control device functions or leave for CPU
 Also O/S decisions
 e.g. Unix treats everything it can as a file
Input Output Techniques:
 Programmed I/O
 Interrupt driven I/O
 Direct Memory Access (DMA)
Dr. Sudip Roy 9
Three Techniques for Input of a Block of Data:
Dr. Sudip Roy 10
Programmed I/O:
 CPU has direct control over I/O
 Sensing status
 Read/write commands
 Transferring data
 CPU waits for I/O module to complete operation
 Wastes CPU time
 CPU requests I/O operation
 I/O module performs operation
 I/O module sets status bits
 CPU checks status bits periodically
 I/O module does not inform CPU
directly
 I/O module does not interrupt CPU
 CPU may wait or come back later
Programmed I/O ‐ Details: Addressing I/O Devices:
 Under programmed I/O data
transfer is very much like memory
access (CPU viewpoint)
 Each device given unique identifier
 CPU commands contain identifier
(address)
Dr. Sudip Roy 11
I/O Mapping:
 Isolated I/O
 Separate address spaces
 Need I/O or memory select lines
 Special commands for I/O
 Limited set
 Memory mapped I/O
 Devices and memory share an address space
 I/O looks just like memory read/write
 No special commands for I/O
 Large selection of memory access commands available
Dr. Sudip Roy 12
Type of Peripheral I/O:
Isolated I/O
Dr. Sudip Roy 13
Changes in Memory and Registers for an Interrupt:
Dr. Sudip Roy 14
Interrupt Driven I/O:
 Overcomes CPU waiting
 No repeated CPU checking of device
 I/O module interrupts when ready
Basic Operations:
CPU issues read command
 I/O module gets data from peripheral whilst CPU does other
work
 I/O module interrupts CPU
 CPU requests data
 I/O module transfers data
Dr. Sudip Roy 15
Simple Interrupt
Processing:
Dr. Sudip Roy 16
Interrupt Processing: CPU Viewpoint
 Issue read command
 Do other work
 Check for interrupt at end of each instruction cycle
 If interrupted:‐
 Save context (registers)
 Process interrupt
Fetch data & store
 Will have more discussion in Operating Systems classes
Dr. Sudip Roy 17
Interrupt‐driven I/O Design Issues:
Identifying Interrupting Module:
 Software poll
 CPU asks each module in turn to determine which module caused the
interrupt
 Slow
 Daisy Chain or Hardware poll
 All I/O modules share a common interrupt request line
 Interrupt acknowledge line is daisy chained through the modules
 When the processor senses an interrupt it sends out an interrupt
acknowledge
 Module responsible places vector on bus
 CPU uses vector to identify handler routine
Dr. Sudip Roy 18
Steps to Implement Interrupt:
Dr. Sudip Roy 19
Interrupts & Priority:
Dr. Sudip Roy 20
Interrupts & Priority:
Multiple Interrupts:
 Each interrupt line has a priority
 Higher priority lines can interrupt lower priority lines
 In bus mastering, only current master can interrupt
Example ‐ PC Bus:
 80x86 has one interrupt line
 8086 based systems use one 8259A interrupt controller
 8259A has 8 interrupt lines
Dr. Sudip Roy 21
Intel 82C55A: Programmable Peripheral Interface
Dr. Sudip Roy 22
Intel 82C55A: Programmable
Peripheral Interface

More Related Content

Similar to CSN221_Lec_35 Computer Architecture and Microprocessor (20)

PPT
Chapter 6 input output
risal07
 
PPTX
Input Output Organization
Kamal Acharya
 
PPTX
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
ggg032019
 
PPTX
Computer architecture presentation
Muhammad Hamza
 
PPTX
Lecture 9.pptx
JavedIqbal549896
 
PDF
IO_ORGANIZATION.pdf
GaganaPurshothama
 
PPT
Chapter 7
talhashahid40
 
PDF
Unit 6
pm_ghate
 
PPTX
Lecture22_New2024 (1).pptx lecture numbere one h yeh
RobosphereIot
 
PPTX
Computer architecture input output organization
Mazin Alwaaly
 
PPTX
Chapter 4
Er. Nawaraj Bhandari
 
PPTX
Input - output organzation
daxesh chauhan
 
PDF
chapter5-Input-output.pdf
rulamohammad1
 
PPTX
Computer organization I/O organization details
423ec0007
 
PPTX
inputoutputorganization-140722085906-phpapp01.pptx
AshokRachapalli1
 
PPTX
Module 6.pptx for computer architecture and organisation
gagansocial1
 
PPT
07_Input Output_Computer Architecture.ppt
fairuzahmed13579
 
PPTX
Io management disk scheduling algorithm
lalithambiga kamaraj
 
PPTX
input -output organization From Computer Organization and Architecture.pptx
sailaja870761
 
PPTX
Io system
Hero Prabhu
 
Chapter 6 input output
risal07
 
Input Output Organization
Kamal Acharya
 
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
ggg032019
 
Computer architecture presentation
Muhammad Hamza
 
Lecture 9.pptx
JavedIqbal549896
 
IO_ORGANIZATION.pdf
GaganaPurshothama
 
Chapter 7
talhashahid40
 
Unit 6
pm_ghate
 
Lecture22_New2024 (1).pptx lecture numbere one h yeh
RobosphereIot
 
Computer architecture input output organization
Mazin Alwaaly
 
Input - output organzation
daxesh chauhan
 
chapter5-Input-output.pdf
rulamohammad1
 
Computer organization I/O organization details
423ec0007
 
inputoutputorganization-140722085906-phpapp01.pptx
AshokRachapalli1
 
Module 6.pptx for computer architecture and organisation
gagansocial1
 
07_Input Output_Computer Architecture.ppt
fairuzahmed13579
 
Io management disk scheduling algorithm
lalithambiga kamaraj
 
input -output organization From Computer Organization and Architecture.pptx
sailaja870761
 
Io system
Hero Prabhu
 

More from ssuser034ce1 (20)

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

Recently uploaded (20)

PDF
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
 
PPTX
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
DOCX
Engineering Geology Field Report to Malekhu .docx
justprashant567
 
PDF
June 2025 - Top 10 Read Articles in Network Security and Its Applications
IJNSA Journal
 
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
 
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
PPTX
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
PPTX
Functions in Python Programming Language
BeulahS2
 
PPTX
template.pptxr4t5y67yrttttttttttttttttttttttttttttttttttt
SithamparanaathanPir
 
PDF
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
PDF
Module - 4 Machine Learning -22ISE62.pdf
Dr. Shivashankar
 
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PDF
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
PPTX
Engineering Quiz ShowEngineering Quiz Show
CalvinLabial
 
PDF
Artificial Neural Network-Types,Perceptron,Problems
Sharmila Chidaravalli
 
PPTX
CM Function of the heart pp.pptxafsasdfddsf
drmaneharshalid
 
PPTX
Artificial Intelligence jejeiejj3iriejrjifirirjdjeie
VikingsGaming2
 
PPT
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
 
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
Engineering Geology Field Report to Malekhu .docx
justprashant567
 
June 2025 - Top 10 Read Articles in Network Security and Its Applications
IJNSA Journal
 
Computer network Computer network Computer network Computer network
Shrikant317689
 
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
Functions in Python Programming Language
BeulahS2
 
template.pptxr4t5y67yrttttttttttttttttttttttttttttttttttt
SithamparanaathanPir
 
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
Module - 4 Machine Learning -22ISE62.pdf
Dr. Shivashankar
 
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
Engineering Quiz ShowEngineering Quiz Show
CalvinLabial
 
Artificial Neural Network-Types,Perceptron,Problems
Sharmila Chidaravalli
 
CM Function of the heart pp.pptxafsasdfddsf
drmaneharshalid
 
Artificial Intelligence jejeiejj3iriejrjifirirjdjeie
VikingsGaming2
 
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
Ad

CSN221_Lec_35 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 – 35)
  • 2. Dr. Sudip Roy 2 Introduction to I/O:
  • 3. Dr. Sudip Roy 3 I/O Peripherals:
  • 4. Dr. Sudip Roy 4 External Device Block Diagram: External Devices:  Human readable  Screen, printer, keyboard  Machine readable  Monitoring and control  Communication  Modem  Network Interface Card (NIC)
  • 5. Dr. Sudip Roy 5 I/O Problems:  Wide variety of peripherals  Delivering different amounts of data  At different speeds  In different formats  All slower than CPU and RAM  Need I/O modules I/O Module:  Interface to CPU and Memory  Interface to one or more peripherals
  • 6. Dr. Sudip Roy 6 I/O Module Diagram: Generic Model of I/O Module
  • 7. Dr. Sudip Roy 7 I/O Module Function:  Control & Timing  CPU Communication  Device Communication  Data Buffering  Error Detection  CPU checks I/O module device status  I/O module returns status  If ready, CPU requests data transfer  I/O module gets data from device  I/O module transfers data to CPU  Variations for output, DMA, etc. I/O Steps:
  • 8. Dr. Sudip Roy 8 I/O Module Decisions:  Hide or reveal device properties to CPU  Support multiple or single device  Control device functions or leave for CPU  Also O/S decisions  e.g. Unix treats everything it can as a file Input Output Techniques:  Programmed I/O  Interrupt driven I/O  Direct Memory Access (DMA)
  • 9. Dr. Sudip Roy 9 Three Techniques for Input of a Block of Data:
  • 10. Dr. Sudip Roy 10 Programmed I/O:  CPU has direct control over I/O  Sensing status  Read/write commands  Transferring data  CPU waits for I/O module to complete operation  Wastes CPU time  CPU requests I/O operation  I/O module performs operation  I/O module sets status bits  CPU checks status bits periodically  I/O module does not inform CPU directly  I/O module does not interrupt CPU  CPU may wait or come back later Programmed I/O ‐ Details: Addressing I/O Devices:  Under programmed I/O data transfer is very much like memory access (CPU viewpoint)  Each device given unique identifier  CPU commands contain identifier (address)
  • 11. Dr. Sudip Roy 11 I/O Mapping:  Isolated I/O  Separate address spaces  Need I/O or memory select lines  Special commands for I/O  Limited set  Memory mapped I/O  Devices and memory share an address space  I/O looks just like memory read/write  No special commands for I/O  Large selection of memory access commands available
  • 12. Dr. Sudip Roy 12 Type of Peripheral I/O: Isolated I/O
  • 13. Dr. Sudip Roy 13 Changes in Memory and Registers for an Interrupt:
  • 14. Dr. Sudip Roy 14 Interrupt Driven I/O:  Overcomes CPU waiting  No repeated CPU checking of device  I/O module interrupts when ready Basic Operations: CPU issues read command  I/O module gets data from peripheral whilst CPU does other work  I/O module interrupts CPU  CPU requests data  I/O module transfers data
  • 15. Dr. Sudip Roy 15 Simple Interrupt Processing:
  • 16. Dr. Sudip Roy 16 Interrupt Processing: CPU Viewpoint  Issue read command  Do other work  Check for interrupt at end of each instruction cycle  If interrupted:‐  Save context (registers)  Process interrupt Fetch data & store  Will have more discussion in Operating Systems classes
  • 17. Dr. Sudip Roy 17 Interrupt‐driven I/O Design Issues: Identifying Interrupting Module:  Software poll  CPU asks each module in turn to determine which module caused the interrupt  Slow  Daisy Chain or Hardware poll  All I/O modules share a common interrupt request line  Interrupt acknowledge line is daisy chained through the modules  When the processor senses an interrupt it sends out an interrupt acknowledge  Module responsible places vector on bus  CPU uses vector to identify handler routine
  • 18. Dr. Sudip Roy 18 Steps to Implement Interrupt:
  • 19. Dr. Sudip Roy 19 Interrupts & Priority:
  • 20. Dr. Sudip Roy 20 Interrupts & Priority: Multiple Interrupts:  Each interrupt line has a priority  Higher priority lines can interrupt lower priority lines  In bus mastering, only current master can interrupt Example ‐ PC Bus:  80x86 has one interrupt line  8086 based systems use one 8259A interrupt controller  8259A has 8 interrupt lines
  • 21. Dr. Sudip Roy 21 Intel 82C55A: Programmable Peripheral Interface
  • 22. Dr. Sudip Roy 22 Intel 82C55A: Programmable Peripheral Interface