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

PPTX
Input & Output
PPTX
ch-6 COAyjdhfzgsgfzjnfgbcxvbnfsxgcv.pptx
PPTX
PDF
IO_ORGANIZATION.pdf
PPTX
Computer architecture input output organization
PPTX
Chapter 5 IO Unit.pptx we are electrical
PDF
Organisasi dan Arsitektur Komputer MO-06
PPTX
3 unit-DMA-1fjgigkhlhkbkbkvkvkvkvkvkgkvkvkvv.pptx
Input & Output
ch-6 COAyjdhfzgsgfzjnfgbcxvbnfsxgcv.pptx
IO_ORGANIZATION.pdf
Computer architecture input output organization
Chapter 5 IO Unit.pptx we are electrical
Organisasi dan Arsitektur Komputer MO-06
3 unit-DMA-1fjgigkhlhkbkbkvkvkvkvkvkgkvkvkvv.pptx

Similar to CSN221_Lec_35 Computer Architecture and Microprocessor (20)

PPTX
Computre structures and architecture.pptx
PPT
COA chapter 5 finalcomputer organization and architecture course for engineer...
PPTX
MODULE 5-1.computer organization and archit
PPTX
UNIT 5 INPUT OUTPUT.pptx computer
PPTX
Input/Output System
PPTX
input output ports
PPTX
Input/Output System (Part 2)
PPT
6.1_IO-Principles.ppt
PPT
Chapter 6 input output
PPT
Input output module
PPT
Chapter 6
PDF
lecture1.pdf
PPTX
Input Output - Computer Architecture
PDF
Input-Output Modules
PPTX
Lecture 10 - Ch No. 7 Input and Output.pptx
PPTX
Operating System Case Study and I/O System
PDF
Unit 6
PPT
IO (1).ppt
PPT
IO (2).ppt
PPT
Computre structures and architecture.pptx
COA chapter 5 finalcomputer organization and architecture course for engineer...
MODULE 5-1.computer organization and archit
UNIT 5 INPUT OUTPUT.pptx computer
Input/Output System
input output ports
Input/Output System (Part 2)
6.1_IO-Principles.ppt
Chapter 6 input output
Input output module
Chapter 6
lecture1.pdf
Input Output - Computer Architecture
Input-Output Modules
Lecture 10 - Ch No. 7 Input and Output.pptx
Operating System Case Study and I/O System
Unit 6
IO (1).ppt
IO (2).ppt
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_36 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_36 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
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Lecture Notes Electrical Wiring System Components
PDF
composite construction of structures.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPT
introduction to datamining and warehousing
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Artificial Intelligence
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Digital Logic Computer Design lecture notes
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Operating System & Kernel Study Guide-1 - converted.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
bas. eng. economics group 4 presentation 1.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
UNIT 4 Total Quality Management .pptx
Safety Seminar civil to be ensured for safe working.
Lecture Notes Electrical Wiring System Components
composite construction of structures.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Foundation to blockchain - A guide to Blockchain Tech
introduction to datamining and warehousing
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Artificial Intelligence
OOP with Java - Java Introduction (Basics)
Digital Logic Computer Design lecture notes
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...

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