SlideShare a Scribd company logo
1 of 23
William Stallings
Computer Organization
and Architecture
8th Edition
Chapter 7
Input/Output
Input/Output Problems
• Computers have a wide variety of peripherals.
▫ Delivering different amounts of data, at different speeds, in
different formats.
• Many are not connected directly to system or expansion
bus.
• Most peripherals are slower than CPU and RAM; a few
are faster.
• Word length for peripherals may vary from the CPU.
• Data format may vary.
Input/Output Module
• Peripheral communications are handled with I/O
modules.
• Two major functions:
—Interface to processor or memory via bus or central link.
—Interface to one or more peripherals via data links.
Generic Model of I/O Module
External Devices
• Human readable (human interface).
—Screen, printer, keyboard, mouse.
• Machine readable.
—Disks, tapes.
– Functional view of disks as part of memory hierarchy.
– Structurally part of I/O system.
—Sensors, actuators.
—Monitoring and control.
• Communications.
—Modem.
—Network Interface Card (NIC).
—Wireless Interface card.
Typical I/O Data Rates
I/O Module Function
• Control & Timing
• CPU Communication
• Device Communication
• Data Buffering
• Error Detection
I/O Module Control & Timing Steps
• Coordination of traffic between internal resources
and external devices.
• Example transaction:
—Processor interrogates status of I/O module.
—Module returns device status.
—Device indicates ready to transmit; processor requests data
transfer by means of a command to the module.
—I/O module obtains a byte of data from the device.
—Data are transferred to the processor.
Processor communication
• Processor communication involves:
—Command decoding
– Commands sent as signals on control bus with parameters on data
bus.
+ E.g. disk: Read Sector, Write Sector, Seek, …
—Data exchange with processor.
—Status reporting.
– Peripherals are very slow compared to processor.
– May take some time after a READ command before data is ready.
– Typical signals: BUSY, READY.
—Address decoding:
– Module recognizes unique address for each device it controls.
Device Communication
• On the other side the I/O module has to communicate
with the device.
—Commands, Status information, Data
• Buffering is often essential.
• Handles the speed mismatch between memory and
the device.
—Low speed devices need to have data from memory
buffered.
—High speed devices need to have data going to memory
buffered.
—With any interrupt-driven device, data may be buffered
pending interrupt handler servicing.
I/O Module Diagram
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
• Interrupt driven
• Direct Memory Access (DMA)
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
Programmed I/O - detail
• 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
Interrupt Driven I/O
• Overcomes CPU waiting
• No repeated CPU checking of device
• I/O module interrupts when ready
Interrupt Driven I/O
Basic Operation
• 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
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
Direct Memory Access
• Interrupt driven and programmed I/O require
active CPU intervention
—Transfer rate is limited
—CPU is tied up
• DMA is the answer
DMA Function
• Additional Module (hardware) on bus
• DMA controller takes over from CPU for I/O
DMA Module Diagram
DMA Operation
• CPU tells DMA controller:-
—Read/Write
—Device address
—Starting address of memory block for data
—Amount of data to be transferred
• CPU carries on with other work
• DMA controller deals with transfer
• DMA controller sends interrupt when finished
DMA Transfer
Cycle Stealing
• DMA controller takes over bus for a cycle
• Transfer of one word of data
• Not an interrupt
—CPU does not switch context
• CPU suspended just before it accesses bus
—i.e. before an operand or data fetch or a data write
• Slows down CPU but not as much as CPU doing
transfer

More Related Content

What's hot

Computer programming1
Computer programming1Computer programming1
Computer programming1A A
 
CS4109 Computer System Architecture
CS4109 Computer System ArchitectureCS4109 Computer System Architecture
CS4109 Computer System Architecturektosri
 
Learn about computer hardware and software
Learn about computer hardware and softwareLearn about computer hardware and software
Learn about computer hardware and softwarefarrukh ishaq choudhary
 
BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE Himanshu Sharma
 
For students wk4_computer_function_and_interconnection
For students wk4_computer_function_and_interconnectionFor students wk4_computer_function_and_interconnection
For students wk4_computer_function_and_interconnectionlimyamahgoub
 
Cpu introduction to computer
Cpu introduction to computerCpu introduction to computer
Cpu introduction to computerBRS ENGINEERING
 
Von Neumann Architecture
Von Neumann ArchitectureVon Neumann Architecture
Von Neumann ArchitectureZahid Rajeel
 
Lecture1 - Computer Architecture
Lecture1 - Computer ArchitectureLecture1 - Computer Architecture
Lecture1 - Computer ArchitectureVolodymyr Ushenko
 
Basic CPU (Central Processing Unit)
Basic CPU (Central Processing Unit)Basic CPU (Central Processing Unit)
Basic CPU (Central Processing Unit)Faraz Ahmed
 
CPU and its components
CPU and its componentsCPU and its components
CPU and its componentssamina khan
 
Computer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerComputer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerAmrutaMehata
 
Wk 4 top_level_view_of_computer_function_and_interconnection
Wk 4 top_level_view_of_computer_function_and_interconnectionWk 4 top_level_view_of_computer_function_and_interconnection
Wk 4 top_level_view_of_computer_function_and_interconnectionlimyamahgoub
 
introduction of microprocessor
introduction of microprocessorintroduction of microprocessor
introduction of microprocessorReetika Singh
 
Block diagram of a computer
Block diagram of a computerBlock diagram of a computer
Block diagram of a computerQsrealm
 
Computer architecture
Computer architectureComputer architecture
Computer architectureBurhan Ahmed
 

What's hot (20)

Computer programming1
Computer programming1Computer programming1
Computer programming1
 
CS4109 Computer System Architecture
CS4109 Computer System ArchitectureCS4109 Computer System Architecture
CS4109 Computer System Architecture
 
Learn about computer hardware and software
Learn about computer hardware and softwareLearn about computer hardware and software
Learn about computer hardware and software
 
BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
 
For students wk4_computer_function_and_interconnection
For students wk4_computer_function_and_interconnectionFor students wk4_computer_function_and_interconnection
For students wk4_computer_function_and_interconnection
 
Basic computer architecture
Basic computer architectureBasic computer architecture
Basic computer architecture
 
Cpu introduction to computer
Cpu introduction to computerCpu introduction to computer
Cpu introduction to computer
 
Von Neumann Architecture
Von Neumann ArchitectureVon Neumann Architecture
Von Neumann Architecture
 
Slides of cpu
Slides of cpuSlides of cpu
Slides of cpu
 
Lecture1 - Computer Architecture
Lecture1 - Computer ArchitectureLecture1 - Computer Architecture
Lecture1 - Computer Architecture
 
Basic CPU (Central Processing Unit)
Basic CPU (Central Processing Unit)Basic CPU (Central Processing Unit)
Basic CPU (Central Processing Unit)
 
CPU and its components
CPU and its componentsCPU and its components
CPU and its components
 
Computer hardware course
Computer hardware courseComputer hardware course
Computer hardware course
 
Computer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerComputer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and Microcontroller
 
Wk 4 top_level_view_of_computer_function_and_interconnection
Wk 4 top_level_view_of_computer_function_and_interconnectionWk 4 top_level_view_of_computer_function_and_interconnection
Wk 4 top_level_view_of_computer_function_and_interconnection
 
introduction of microprocessor
introduction of microprocessorintroduction of microprocessor
introduction of microprocessor
 
Block diagram of a computer
Block diagram of a computerBlock diagram of a computer
Block diagram of a computer
 
Basic+machine+organization
Basic+machine+organizationBasic+machine+organization
Basic+machine+organization
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 

Similar to Chapter 7 (20)

07 input output
07 input output07 input output
07 input output
 
Ch12 io systems
Ch12   io systemsCh12   io systems
Ch12 io systems
 
07 input output
07 input output07 input output
07 input output
 
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
 
Cs intro-ca
Cs intro-caCs intro-ca
Cs intro-ca
 
In out system
In out systemIn out system
In out system
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 
Computer Basics
Computer BasicsComputer Basics
Computer Basics
 
I/O systems chapter 12 OS
I/O systems chapter 12 OS I/O systems chapter 12 OS
I/O systems chapter 12 OS
 
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
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
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
 
5120224.ppt
5120224.ppt5120224.ppt
5120224.ppt
 
Ch01
Ch01Ch01
Ch01
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
 
Computer Architecture and Organization.pptx
Computer Architecture and Organization.pptxComputer Architecture and Organization.pptx
Computer Architecture and Organization.pptx
 
What is computer and how it works
What is computer and how it worksWhat is computer and how it works
What is computer and how it works
 
I.T for Management: What is a computer and how does it work
I.T for Management: What is a computer and how does it work I.T for Management: What is a computer and how does it work
I.T for Management: What is a computer and how does it work
 
Cpu
CpuCpu
Cpu
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk scheduling
 

More from talhashahid40

More from talhashahid40 (8)

Talha 11009 call_quiz_addressing_modes
Talha 11009 call_quiz_addressing_modesTalha 11009 call_quiz_addressing_modes
Talha 11009 call_quiz_addressing_modes
 
Only floating point lecture 7 (1)
Only floating point lecture 7 (1)Only floating point lecture 7 (1)
Only floating point lecture 7 (1)
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 9 examples (1)
Lecture 9 examples (1)Lecture 9 examples (1)
Lecture 9 examples (1)
 
Lect 8 updated (1)
Lect 8 updated (1)Lect 8 updated (1)
Lect 8 updated (1)
 
Coal (1)
Coal (1)Coal (1)
Coal (1)
 
Chapter 3 caal (1)
Chapter 3 caal (1)Chapter 3 caal (1)
Chapter 3 caal (1)
 

Recently uploaded

TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensorsonawaneprad
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxJorenAcuavera1
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuinethapagita
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentationtahreemzahra82
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxNandakishor Bhaurao Deshmukh
 

Recently uploaded (20)

TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensor
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptx
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentation
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
 

Chapter 7

  • 1. William Stallings Computer Organization and Architecture 8th Edition Chapter 7 Input/Output
  • 2. Input/Output Problems • Computers have a wide variety of peripherals. ▫ Delivering different amounts of data, at different speeds, in different formats. • Many are not connected directly to system or expansion bus. • Most peripherals are slower than CPU and RAM; a few are faster. • Word length for peripherals may vary from the CPU. • Data format may vary.
  • 3. Input/Output Module • Peripheral communications are handled with I/O modules. • Two major functions: —Interface to processor or memory via bus or central link. —Interface to one or more peripherals via data links.
  • 4. Generic Model of I/O Module
  • 5. External Devices • Human readable (human interface). —Screen, printer, keyboard, mouse. • Machine readable. —Disks, tapes. – Functional view of disks as part of memory hierarchy. – Structurally part of I/O system. —Sensors, actuators. —Monitoring and control. • Communications. —Modem. —Network Interface Card (NIC). —Wireless Interface card.
  • 7. I/O Module Function • Control & Timing • CPU Communication • Device Communication • Data Buffering • Error Detection
  • 8. I/O Module Control & Timing Steps • Coordination of traffic between internal resources and external devices. • Example transaction: —Processor interrogates status of I/O module. —Module returns device status. —Device indicates ready to transmit; processor requests data transfer by means of a command to the module. —I/O module obtains a byte of data from the device. —Data are transferred to the processor.
  • 9. Processor communication • Processor communication involves: —Command decoding – Commands sent as signals on control bus with parameters on data bus. + E.g. disk: Read Sector, Write Sector, Seek, … —Data exchange with processor. —Status reporting. – Peripherals are very slow compared to processor. – May take some time after a READ command before data is ready. – Typical signals: BUSY, READY. —Address decoding: – Module recognizes unique address for each device it controls.
  • 10. Device Communication • On the other side the I/O module has to communicate with the device. —Commands, Status information, Data • Buffering is often essential. • Handles the speed mismatch between memory and the device. —Low speed devices need to have data from memory buffered. —High speed devices need to have data going to memory buffered. —With any interrupt-driven device, data may be buffered pending interrupt handler servicing.
  • 12. 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
  • 13. Input Output Techniques • Programmed • Interrupt driven • Direct Memory Access (DMA)
  • 14. 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
  • 15. Programmed I/O - detail • 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
  • 16. Interrupt Driven I/O • Overcomes CPU waiting • No repeated CPU checking of device • I/O module interrupts when ready
  • 17. Interrupt Driven I/O Basic Operation • 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
  • 18. 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
  • 19. Direct Memory Access • Interrupt driven and programmed I/O require active CPU intervention —Transfer rate is limited —CPU is tied up • DMA is the answer
  • 20. DMA Function • Additional Module (hardware) on bus • DMA controller takes over from CPU for I/O
  • 22. DMA Operation • CPU tells DMA controller:- —Read/Write —Device address —Starting address of memory block for data —Amount of data to be transferred • CPU carries on with other work • DMA controller deals with transfer • DMA controller sends interrupt when finished
  • 23. DMA Transfer Cycle Stealing • DMA controller takes over bus for a cycle • Transfer of one word of data • Not an interrupt —CPU does not switch context • CPU suspended just before it accesses bus —i.e. before an operand or data fetch or a data write • Slows down CPU but not as much as CPU doing transfer