0% found this document useful (0 votes)
6 views

Unit 4 Input Output System_saj

Uploaded by

terepapakamaal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Unit 4 Input Output System_saj

Uploaded by

terepapakamaal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Unit-4

INPUT AND OUTPUT SYSTEM

1
INPUT AND OUTPUT SYSTEM

•Processing speed or program execution determined primarily by ability of I/O operations to stay ahead
of processor.

•I/O (Input/Output) is an information processing system designed to send and receive data from a
computer hardware component, device, or network.

•Data can be sent between devices over a network. Without I/O, computers would not be able to
communicate to other systems or devices.

Input Proces Outpu


s t

2
4.1 External Devices

External devices that provide a means of exchanging data between the external environment and the
computer.

An external device attaches to the computer by a link to an I/O module which is used to exchange
control, status, and data between the I/O module and the external device.

Classification of external devices:

1. Human readable: Suitable for communicating with the computer user


Screen, printer, keyboard
2. Machine readable: Suitable for communicating with equipment
magnetic disk and tape systems,
3. Communication: Suitable for communicating with remote devices
Modem
Network Interface Card (NIC)

3
External Device Block Diagram

4
PERIPHERAL DEVICES

Input Devices Output Devices

• Keyboard • Card Puncher, Paper Tape Puncher


• Optical input devices • CRT
- Card Reader • Printer (Impact, Ink Jet, Laser, Dot Matrix)
- Paper Tape Reader • Plotter
- Bar code reader • Analog
- Digitizer • Voice
- Optical Mark Reader
• Magnetic Input Devices
- Magnetic Stripe Reader
• Screen Input Devices
- Touch Screen
- Light Pen
- Mouse
• Analog Input Devices

5
4.2 I/O Modules

Input or output devices that are connected to computer are called peripheral devices. These devices
are designed to read information into or out of the memory unit upon command from the CPU and are
considered to be the part of computer system. These devices are also called peripherals.
For example: Keyboards, display units and printers are common peripheral devices.
There are three types of peripherals:
Input peripherals : Allows user input, from the outside world to the computer. Example: Keyboard,
Mouse etc.
Output peripherals: Allows information output, from the computer to the outside world. Example:
Printer, Monitor etc
Input-Output peripherals: Allows both input(from outside world to computer) as well as,
output(from computer to the outside world). Example: Touch screen etc.

6
4.2 I/O Modules

● Wide variety of peripherals


● Delivering different amounts of data
● At different speeds
● In different formats
● All slower than CPU and RAM
● Need of I/O modules

7
Generic Model of I/O Modules

What are I/O Modules ?


Interface to CPU and Memory
Interface to one or more peripherals

8
4.3 I/O Module Function

⮚Control & Timing


the I/O function includes a control and timing requirement, to coordinate the flow of traffic between
internal resources and external devices
⮚CPU Communication
: the I/O module must communicate with the processor and with the external device
⮚Device Communication
the I/O module must be able to perform device communication. This communication involves commands,
status information, and data
⮚Data Buffering
The data are buffered in the I/O module and then sent to the peripheral device at its data rate.
⮚Error Detection
an I/O module is often responsible for error detection and for subsequently reporting errors to the
processor

9
I/O Steps - Sequence of operation

1.CPU checks I/O module device status


2.I/O module returns status
3.If ready, CPU requests data transfer
4.I/O module gets data from device
5.I/O module transfers data to CPU
6.Variations for output, DMA, etc.

10
4.4 I/O Module Structure

11
Overall role of the I/O Module

•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

12
Input Output Techniques

•Programmed SOFTWARE Driven


•Interrupt driven
•Direct Memory Access (DMA)

13
I/O Techniques

Programmed
Interrupt driven
Direct Memory Access (DMA)

14
Transferring data with 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
•Usually not a good use of
CPU time

15
I/O Techniques

•The second important question is how data is transferred between a device and
memory.
•Under programmed I/O, it’s all up to a user program or the operating system.
—The CPU makes a request and then waits for the device to become ready (e.g., to move
the disk head).
—Buses are only 32-64 bits wide, so the last few steps are repeated for large transfers.
•A lot of CPU time is needed for this!
—If the device is slow the CPU might have to wait a long time—as we will see, most
devices are slow copared to modern CPUs.
—The CPU is also involved as a middleman for the actual data transfer.

(This CPU flowchart is based on one from Computer Organization and Architecture by William Stallings.)

16
I/O Commands
• CPU issues address
Identifies module (& device if >1 per module)
• CPU issues command
• Control - telling module what to do ? e.g. spin up disk
• Test - check status e.g. power? Error?
• Read/Write
• Module transfers data via buffer from/to device

17
Addressing I/O Devices

•Under programmed I/O data transfer is very like memory access (CPU viewpoint)
•Each device given unique identifier
•CPU commands contain identifier (address)

18
Two Techniques for I/O address allocations - I/O Mapping

•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
•Isolated I/O
—Separate address spaces
—Need I/O or memory select lines
—Special commands for I/O
–Limited set

19
Comparison of Memory Mapped IO and IO
mapped(isolated )IO

20
Interrupt Driven I/O
•Interrupt-driven I/O attacks
the problem of the
processor having to wait for
a slow device.
•Instead of waiting, the CPU
continues with other
calculations. The device
interrupts the processor
when the data is ready.
•The data transfer steps are
still the same as with
programmed I/O, and still
occupy the CPU.
21
Interrupt - Basic Interrupt Processing

22
Interrupt driven I/O - CPU Viewpoint

•Issue I/O command


•Do other work
- Check for interrupt at end of each instruction cycle
•When interrupt request is granted:-
—Save context (registers)
—Process interrupt
–Execute “service routine”
•Continue other work

23
Interrupt driven I/O - CPU Viewpoint

24
Interrupt driven I/O - CPU Viewpoint

• Issue I/O command


• Do other work
- Check for interrupt at end of each instruction cycle
• When interrupt request is granted:-
• Save context (registers)
• Process interrupt
• Execute “service routine”
• Continue other work

25
Interrupt driven I/O - CPU Viewpoint

26
Way to save CPU time……..DMA

27
THANK YOU
28

Vishwakarma Institute of Technology, Pune

You might also like