Unit 4 Input Output System_saj
Unit 4 Input Output System_saj
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.
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.
3
External Device Block Diagram
4
PERIPHERAL 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
7
Generic Model of I/O Modules
8
4.3 I/O Module Function
9
I/O Steps - Sequence of operation
10
4.4 I/O Module Structure
11
Overall role of the I/O Module
12
Input Output Techniques
13
I/O Techniques
Programmed
Interrupt driven
Direct Memory Access (DMA)
14
Transferring data with programmed I/O
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
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
23
Interrupt driven I/O - CPU Viewpoint
24
Interrupt driven I/O - CPU Viewpoint
25
Interrupt driven I/O - CPU Viewpoint
26
Way to save CPU time……..DMA
27
THANK YOU
28