SlideShare a Scribd company logo
1 of 24
CSC 203 1.5
Computer System Architecture
Budditha Hettige
Department of Statistics and Computer Science
University of Sri Jayewardenepura
IO Fundamentals
Budditha Hettige 2
I/O Fundamentals
• Computer System has three major functions
– CPU
– Memory
– I/O
Budditha Hettige 3
PC with PCI and ISA bus
Budditha Hettige 4
Types and Characteristics of I/O Devices
• Behavior: how does an I/O device behave?
– Input – Read only
– Output - write only, cannot read
– Storage - can be reread and usually rewritten
• Partner:
– Either a human or a machine is at the other end of the
I/O device
– Either feeding data on input or reading data on output
• Data rate:
– The peak rate at which data can be transferred
• between the I/O device and the main memory
• Or between the I/O device and the CPU
Budditha Hettige 5
Data Rate
Budditha Hettige 6
Buses
• A bus is a shared communication link
• Multiple sources and multiple destinations
• It uses one set of wires to connect multiple
subsystems
• Different uses:
– Data
– Address
– Control
Budditha Hettige 7
Motherboard
Budditha Hettige 8
Advantages
• Versatility:
– New devices can be added easily
– Peripherals can be moved between computer
– systems that use the same bus standard
• Low Cost:
– A single set of wires is shared in multiple ways
Budditha Hettige 9
Disadvantages
• It creates a communication bottleneck
– The bandwidth of that bus can limit the maximum
I/O throughput
• The maximum bus speed is largely limited by:
– The length of the bus
– The number of devices on the bus
– The need to support a range of devices with:
• Widely varying latencies
• Widely varying data transfer rates
Budditha Hettige 10
The General Organization of a Bus
• Control lines:
– Signal requests and acknowledgments
– Indicate what type of information is on the data lines
• Data lines carry information between the source
and the destination:
– Data and Addresses
– Complex commands
• A bus transaction includes two parts:
– Sending the address
– Receiving or sending the data
Budditha Hettige 11
Master Vs Slave
• A bus transaction includes two parts:
– Sending the address
– Receiving or sending the data
• Master is the one who starts the bus transaction by:
– Sending the address
• Salve is the one who responds to the address by:
– Sending data to the master if the master ask for data
– Receiving data from the master if the master wants to
send data
Budditha Hettige 12
Output Operation
Budditha Hettige 13
Input Operation
• Input is defined as the Processor receiving data
from the I/O device
Budditha Hettige 14
Type of Buses
• Processor-Memory Bus (design specific or proprietary)
– Short and high speed
– Only need to match the memory system
– Maximize memory-to-processor bandwidth
– Connects directly to the processor
• I/O Bus (industry standard)
– Usually is lengthy and slower
– Need to match a wide range of I/O devices
– Connects to the processor-memory bus or backplane bus
• Backplane Bus (industry standard)
– Backplane: an interconnection structure within the chassis
– Allow processors, memory, and I/O devices to coexist
• Cost advantage: one single bus for all components
Budditha Hettige 15
Increasing the Bus Bandwidth
• Separate versus multiplexed address and data lines:
– Address and data can be transmitted in one bus cycle if separate
address and data lines are available
– Cost: (a) more bus lines, (b) increased complexity
• Data bus width:
– By increasing the width of the data bus, transfers of multiple words
require fewer bus cycles
– Example: SPARCstation 20’s memory bus is 128 bit wide
– cost: more bus lines
• Block transfers:
– Allow the bus to transfer multiple words in back-to-back bus cycles
– Only one address needs to be sent at the beginning
– The bus is not released until the last word is transferred
– Cost: (a) increased complexity (b) decreased response time for
request
Budditha Hettige 16
Operating System Requirements
• Provide protection to shared I/O resources
– Guarantees that a user’s program can only access the
portions of an I/O device to which the user has rights
• Provides abstraction for accessing devices:
– Supply routines that handle low-level device operation
• Handles the interrupts generated by I/O devices
• Provide equitable access to the shared I/O resources
– All user programs must have equal access to the I/O
resources
• Schedule accesses in order to enhance system
throughput
Budditha Hettige 17
OS and I/O Systems Communication
Requirements
• The Operating System must be able to prevent:
– The user program from communicating with the I/O device
directly
• If user programs could perform I/O directly:
– Protection to the shared I/O resources could not be provided
• Three types of communication are required:
– The OS must be able to give commands to the I/O devices
– The I/O device must be able to notify the OS when the I/O
device has completed an operation or has encountered an
error
• Data must be transferred between memory and an I/O
device
Budditha Hettige 18
Commands to I/O Devices
• Two methods are used to address the device:
– Special I/O instructions
– Memory-mapped I/O
• Special I/O instructions specify:
– Both the device number and the command word
– Device number: the processor communicates this via a set of wires
normally included as part of the I/O bus
– Command word: this is usually send on the bus’s data lines
• Memory-mapped I/O:
– Portions of the address space are assigned to I/O device
– Read and writes to those addresses are interpreted as commands to the I/O
devices
– User programs are prevented from issuing I/O operations directly:
• The I/O address space is protected by the address translation
Budditha Hettige 19
I/O Device Notifying the OS
• The OS needs to know when:
– The I/O device has completed an operation
– The I/O operation has encountered an error
• This can be accomplished in two different
ways:
– Polling:
• The I/O device put information in a status register
• The OS periodically check the status register
– I/O Interrupt:
• Whenever an I/O device needs attention from the
processor, it interrupts the processor from what it is
currently doing.
Budditha Hettige 20
Polling
• Advantage:
– Simple: the processor is totally
in control and does all the work
• Disadvantage:
– Polling overhead can consume a
lot of CPU time
Budditha Hettige 21
Interrupts
• interrupt is an asynchronous signal indicating the
need for attention or a synchronous event in
software indicating the need for a change in
execution
• Advantage:
– User program progress is only halted during actual transfer
• Disadvantage, special hardware is needed to:
– Cause an interrupt (I/O device)
– Detect an interrupt (processor)
– Save the proper states to resume after the interrupt
(processor)
Budditha Hettige 22
Interrupt Driven Data Transfer
• An I/O interrupt is just like the
exceptions except:
– An I/O interrupt is asynchronous
– Further information needs to be
conveyed
• An I/O interrupt is asynchronous
with respect to instruction
execution:
– I/O interrupt is not associated with
any instruction
– I/O interrupt does not prevent any
instruction from completion
– You can pick your own convenient
point to take an interrupt
Budditha Hettige 23
I/O Interrupt
• I/O interrupt is more complicated than
exception:
– Needs to convey the identity of the device
generating the interrupt
– Interrupt requests can have different urgencies:
– Interrupt request needs to be prioritized
• Interrupt Logic
– Detect and synchronize interrupt requests
• Ignore interrupts that are disabled (masked off)
• Rank the pending interrupt requests
• Create interrupt microsequence address
• Provide select signals for interrupt microsequence
Budditha Hettige 24

More Related Content

What's hot

Lecture1 - Computer Architecture
Lecture1 - Computer ArchitectureLecture1 - Computer Architecture
Lecture1 - Computer ArchitectureVolodymyr Ushenko
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and ArchitectureSubhasis Dash
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An IntroductionDilum Bandara
 
Basics of Computer! BATRA COMPUTER CENTRE IN AMBALA
Basics of Computer! BATRA COMPUTER CENTRE IN AMBALABasics of Computer! BATRA COMPUTER CENTRE IN AMBALA
Basics of Computer! BATRA COMPUTER CENTRE IN AMBALAjatin batra
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1Hatem Abd El-Salam
 
Embedded system Design
Embedded system DesignEmbedded system Design
Embedded system DesignAJAL A J
 
introduction to embedded systems part 2
introduction to embedded systems part 2introduction to embedded systems part 2
introduction to embedded systems part 2Hatem Abd El-Salam
 
Unit 2 processor&memory-organisation
Unit 2 processor&memory-organisationUnit 2 processor&memory-organisation
Unit 2 processor&memory-organisationPavithra S
 
Computer organization
Computer organizationComputer organization
Computer organizationishapadhy
 
Basic structure of computers by aniket bhute
Basic structure of computers by aniket bhuteBasic structure of computers by aniket bhute
Basic structure of computers by aniket bhuteAniket Bhute
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoDamien Magoni
 
03 top level view of computer function and interconnection
03 top level view of computer function and interconnection03 top level view of computer function and interconnection
03 top level view of computer function and interconnectionSher Shah Merkhel
 
Basic structure of computers
Basic structure of computersBasic structure of computers
Basic structure of computersKumar
 

What's hot (20)

Processors selection
Processors selectionProcessors selection
Processors selection
 
Lecture1 - Computer Architecture
Lecture1 - Computer ArchitectureLecture1 - Computer Architecture
Lecture1 - Computer Architecture
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and Architecture
 
Processors
ProcessorsProcessors
Processors
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An Introduction
 
Basics of Computer! BATRA COMPUTER CENTRE IN AMBALA
Basics of Computer! BATRA COMPUTER CENTRE IN AMBALABasics of Computer! BATRA COMPUTER CENTRE IN AMBALA
Basics of Computer! BATRA COMPUTER CENTRE IN AMBALA
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1
 
Embedded system Design
Embedded system DesignEmbedded system Design
Embedded system Design
 
Cpu
CpuCpu
Cpu
 
introduction to embedded systems part 2
introduction to embedded systems part 2introduction to embedded systems part 2
introduction to embedded systems part 2
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Control unit
Control  unitControl  unit
Control unit
 
Lecture 39
Lecture 39Lecture 39
Lecture 39
 
Unit 2 processor&memory-organisation
Unit 2 processor&memory-organisationUnit 2 processor&memory-organisation
Unit 2 processor&memory-organisation
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Basic structure of computers by aniket bhute
Basic structure of computers by aniket bhuteBasic structure of computers by aniket bhute
Basic structure of computers by aniket bhute
 
Lecture 46
Lecture 46Lecture 46
Lecture 46
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
03 top level view of computer function and interconnection
03 top level view of computer function and interconnection03 top level view of computer function and interconnection
03 top level view of computer function and interconnection
 
Basic structure of computers
Basic structure of computersBasic structure of computers
Basic structure of computers
 

Similar to Computer System Architecture Lecture Note 9 IO fundamentals

I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxwebip34973
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its typesNehal Naik
 
03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.ppt03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.pptAmirZaman21
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and ArchitectureSubhasis Dash
 
io orgnz.ppt
io orgnz.pptio orgnz.ppt
io orgnz.pptVetriM4
 
03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.encAnwal Mirza
 
top level view of computer function and interconnection
top level view of computer function and interconnectiontop level view of computer function and interconnection
top level view of computer function and interconnectionSajid Marwat
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzationdaxesh chauhan
 
Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)SwapnitaSrivastava1
 
Arbitration in computer organization
 Arbitration in computer organization   Arbitration in computer organization
Arbitration in computer organization Amit kashyap
 

Similar to Computer System Architecture Lecture Note 9 IO fundamentals (20)

I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptx
 
Unit4_IO_13623_AnilRawat.ppt
Unit4_IO_13623_AnilRawat.pptUnit4_IO_13623_AnilRawat.ppt
Unit4_IO_13623_AnilRawat.ppt
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
 
Interfacingiodevice
InterfacingiodeviceInterfacingiodevice
Interfacingiodevice
 
comporgppt.pptx
comporgppt.pptxcomporgppt.pptx
comporgppt.pptx
 
Unit 5
Unit 5Unit 5
Unit 5
 
Interfacing
InterfacingInterfacing
Interfacing
 
03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.ppt03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.ppt
 
Ca 2 note mano
Ca 2 note manoCa 2 note mano
Ca 2 note mano
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and Architecture
 
1.instrumentation ii
1.instrumentation ii1.instrumentation ii
1.instrumentation ii
 
io orgnz.ppt
io orgnz.pptio orgnz.ppt
io orgnz.ppt
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 
03 buses
03 buses03 buses
03 buses
 
03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc
 
top level view of computer function and interconnection
top level view of computer function and interconnectiontop level view of computer function and interconnection
top level view of computer function and interconnection
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzation
 
Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)
 
Arbitration in computer organization
 Arbitration in computer organization   Arbitration in computer organization
Arbitration in computer organization
 
Ch6 030702
Ch6 030702Ch6 030702
Ch6 030702
 

More from Budditha Hettige

More from Budditha Hettige (18)

Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Sorting
SortingSorting
Sorting
 
Link List
Link ListLink List
Link List
 
Queue
QueueQueue
Queue
 
02 Stack
02 Stack02 Stack
02 Stack
 
Data Structures 01
Data Structures 01Data Structures 01
Data Structures 01
 
Drawing Fonts
Drawing FontsDrawing Fonts
Drawing Fonts
 
Texture Mapping
Texture Mapping Texture Mapping
Texture Mapping
 
Lighting
LightingLighting
Lighting
 
Viewing
ViewingViewing
Viewing
 
OpenGL 3D Drawing
OpenGL 3D DrawingOpenGL 3D Drawing
OpenGL 3D Drawing
 
2D Drawing
2D Drawing2D Drawing
2D Drawing
 
Graphics Programming OpenGL & GLUT in Code::Blocks
Graphics Programming OpenGL & GLUT in Code::BlocksGraphics Programming OpenGL & GLUT in Code::Blocks
Graphics Programming OpenGL & GLUT in Code::Blocks
 
Introduction to Computer Graphics
Introduction to Computer GraphicsIntroduction to Computer Graphics
Introduction to Computer Graphics
 
Computer System Architecture Lecture Note 8.2 Cache Memory
Computer System Architecture Lecture Note 8.2 Cache MemoryComputer System Architecture Lecture Note 8.2 Cache Memory
Computer System Architecture Lecture Note 8.2 Cache Memory
 
Computer System Architecture Lecture Note 3: computer architecture
Computer System Architecture Lecture Note 3: computer architectureComputer System Architecture Lecture Note 3: computer architecture
Computer System Architecture Lecture Note 3: computer architecture
 
Computer System Architecture Lecture Note 2: History
Computer System Architecture Lecture Note 2: HistoryComputer System Architecture Lecture Note 2: History
Computer System Architecture Lecture Note 2: History
 
Computer System Architecture Lecture Note 4: intel microprocessors
Computer System Architecture Lecture Note 4: intel microprocessorsComputer System Architecture Lecture Note 4: intel microprocessors
Computer System Architecture Lecture Note 4: intel microprocessors
 

Recently uploaded

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Computer System Architecture Lecture Note 9 IO fundamentals

  • 1. CSC 203 1.5 Computer System Architecture Budditha Hettige Department of Statistics and Computer Science University of Sri Jayewardenepura
  • 3. I/O Fundamentals • Computer System has three major functions – CPU – Memory – I/O Budditha Hettige 3
  • 4. PC with PCI and ISA bus Budditha Hettige 4
  • 5. Types and Characteristics of I/O Devices • Behavior: how does an I/O device behave? – Input – Read only – Output - write only, cannot read – Storage - can be reread and usually rewritten • Partner: – Either a human or a machine is at the other end of the I/O device – Either feeding data on input or reading data on output • Data rate: – The peak rate at which data can be transferred • between the I/O device and the main memory • Or between the I/O device and the CPU Budditha Hettige 5
  • 7. Buses • A bus is a shared communication link • Multiple sources and multiple destinations • It uses one set of wires to connect multiple subsystems • Different uses: – Data – Address – Control Budditha Hettige 7
  • 9. Advantages • Versatility: – New devices can be added easily – Peripherals can be moved between computer – systems that use the same bus standard • Low Cost: – A single set of wires is shared in multiple ways Budditha Hettige 9
  • 10. Disadvantages • It creates a communication bottleneck – The bandwidth of that bus can limit the maximum I/O throughput • The maximum bus speed is largely limited by: – The length of the bus – The number of devices on the bus – The need to support a range of devices with: • Widely varying latencies • Widely varying data transfer rates Budditha Hettige 10
  • 11. The General Organization of a Bus • Control lines: – Signal requests and acknowledgments – Indicate what type of information is on the data lines • Data lines carry information between the source and the destination: – Data and Addresses – Complex commands • A bus transaction includes two parts: – Sending the address – Receiving or sending the data Budditha Hettige 11
  • 12. Master Vs Slave • A bus transaction includes two parts: – Sending the address – Receiving or sending the data • Master is the one who starts the bus transaction by: – Sending the address • Salve is the one who responds to the address by: – Sending data to the master if the master ask for data – Receiving data from the master if the master wants to send data Budditha Hettige 12
  • 14. Input Operation • Input is defined as the Processor receiving data from the I/O device Budditha Hettige 14
  • 15. Type of Buses • Processor-Memory Bus (design specific or proprietary) – Short and high speed – Only need to match the memory system – Maximize memory-to-processor bandwidth – Connects directly to the processor • I/O Bus (industry standard) – Usually is lengthy and slower – Need to match a wide range of I/O devices – Connects to the processor-memory bus or backplane bus • Backplane Bus (industry standard) – Backplane: an interconnection structure within the chassis – Allow processors, memory, and I/O devices to coexist • Cost advantage: one single bus for all components Budditha Hettige 15
  • 16. Increasing the Bus Bandwidth • Separate versus multiplexed address and data lines: – Address and data can be transmitted in one bus cycle if separate address and data lines are available – Cost: (a) more bus lines, (b) increased complexity • Data bus width: – By increasing the width of the data bus, transfers of multiple words require fewer bus cycles – Example: SPARCstation 20’s memory bus is 128 bit wide – cost: more bus lines • Block transfers: – Allow the bus to transfer multiple words in back-to-back bus cycles – Only one address needs to be sent at the beginning – The bus is not released until the last word is transferred – Cost: (a) increased complexity (b) decreased response time for request Budditha Hettige 16
  • 17. Operating System Requirements • Provide protection to shared I/O resources – Guarantees that a user’s program can only access the portions of an I/O device to which the user has rights • Provides abstraction for accessing devices: – Supply routines that handle low-level device operation • Handles the interrupts generated by I/O devices • Provide equitable access to the shared I/O resources – All user programs must have equal access to the I/O resources • Schedule accesses in order to enhance system throughput Budditha Hettige 17
  • 18. OS and I/O Systems Communication Requirements • The Operating System must be able to prevent: – The user program from communicating with the I/O device directly • If user programs could perform I/O directly: – Protection to the shared I/O resources could not be provided • Three types of communication are required: – The OS must be able to give commands to the I/O devices – The I/O device must be able to notify the OS when the I/O device has completed an operation or has encountered an error • Data must be transferred between memory and an I/O device Budditha Hettige 18
  • 19. Commands to I/O Devices • Two methods are used to address the device: – Special I/O instructions – Memory-mapped I/O • Special I/O instructions specify: – Both the device number and the command word – Device number: the processor communicates this via a set of wires normally included as part of the I/O bus – Command word: this is usually send on the bus’s data lines • Memory-mapped I/O: – Portions of the address space are assigned to I/O device – Read and writes to those addresses are interpreted as commands to the I/O devices – User programs are prevented from issuing I/O operations directly: • The I/O address space is protected by the address translation Budditha Hettige 19
  • 20. I/O Device Notifying the OS • The OS needs to know when: – The I/O device has completed an operation – The I/O operation has encountered an error • This can be accomplished in two different ways: – Polling: • The I/O device put information in a status register • The OS periodically check the status register – I/O Interrupt: • Whenever an I/O device needs attention from the processor, it interrupts the processor from what it is currently doing. Budditha Hettige 20
  • 21. Polling • Advantage: – Simple: the processor is totally in control and does all the work • Disadvantage: – Polling overhead can consume a lot of CPU time Budditha Hettige 21
  • 22. Interrupts • interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution • Advantage: – User program progress is only halted during actual transfer • Disadvantage, special hardware is needed to: – Cause an interrupt (I/O device) – Detect an interrupt (processor) – Save the proper states to resume after the interrupt (processor) Budditha Hettige 22
  • 23. Interrupt Driven Data Transfer • An I/O interrupt is just like the exceptions except: – An I/O interrupt is asynchronous – Further information needs to be conveyed • An I/O interrupt is asynchronous with respect to instruction execution: – I/O interrupt is not associated with any instruction – I/O interrupt does not prevent any instruction from completion – You can pick your own convenient point to take an interrupt Budditha Hettige 23
  • 24. I/O Interrupt • I/O interrupt is more complicated than exception: – Needs to convey the identity of the device generating the interrupt – Interrupt requests can have different urgencies: – Interrupt request needs to be prioritized • Interrupt Logic – Detect and synchronize interrupt requests • Ignore interrupts that are disabled (masked off) • Rank the pending interrupt requests • Create interrupt microsequence address • Provide select signals for interrupt microsequence Budditha Hettige 24