Sunteți pe pagina 1din 13

UNIT-3

INPUT-OUTPUT ORGANIZATION
3.1 EXTERNAL DEVICES:
I/O,

provides

an

efficient

mode

of

communication between the central system


and the outside environment.
Programs and data must be entered into
computer memory for processing and results
obtained from computations must be recorded
Fig: BLOCK DIAGRAM OF EXTERNAL DEVICE

or displayed for the user


Input or output devices attached to the
computer are also called peripherals.
Among the most common peripherals are
keyboards, display units, and printers
We can broadly classify peripheral devices
into three categories:
Human Readable: Communicating with
the computer users, e.g. video display

Control signals determine the function that


the device will perform such as send data to
I/O module, accept data from I/O module.
Status signals indicate the state of the device
i.e. device is ready or not.
Data bits are actual data transformation.
Control logic associated with the device
controls the device's operation in response to

terminal, printers etc.


Machine Readable: Communicating with

direction from the I/O module.

equipments, e.g. magnetic disk, magnetic

The transducer converts data from electrical

tape, sensor, actuators used in robotics etc.

to other forms of energy during output and

Communication: Communicating with


remote devices means exchanging data

from other forms to electrical during input.


Buffer is associated with the transducer to

with that, e.g. modem, NIC (network

temporarily

hold

data

being

interface Card) etc.

between the I/O module and external devices


i.e. peripheral environment.

Input Device
1. Keyboard
2. Optical input devices
COA

Page 2

transferred

UNIT-3

Card Reader

Paper Tape Reader

central switch (CPU and Memory), interfaces

Optical Character Recognition

and controls to one or more peripheral

(OCR)

devices.

Optical

I/O modules interface to the system bus or

Bar

code

reader

I/O operations are accomplished through a


wide assortment of external devices that

(OBR)

provide a means of exchanging data between

Digitizer

Optical Mark Reader

external environment and computer by a link


to an I/O module

3. Magnetic Input Devices

Magnetic Stripe Reader

Magnetic

Ink

The link is used to exchange control status and


data between I/O module and the external

Character

devices.

Recognition (MICR)
4. Screen Input Devices

Touch Screen

Light Pen

Mouse

5. Analog Input Devices


Output Device

Card Puncher, Paper Tape Puncher

Monitor (CRT, LCD, LED)

Printer (Impact, Ink Jet, Laser, Dot


Matrix)

Plotter

Analog

Voice

External devices are not directly connected to


the

bus.

I/O

modules

communication

perform
between

peripheral(external)and system bus


Thus an I/O module is required which

Question: Explain a typical I/O module with its


functions.(5 M)

performs two major functions.


Interface to the processor and memory

3.2. I/O MODULES:


COA

system

via the system bus.


Interface to one or more peripherals
by tailored data links

Page 3

UNIT-3
I/O Module Functions

too slow and it is important to

The I/O module is a special hardware


component interface between the CPU and

peripherals to supervise and synchronize all

of traffic between internal resources and


external devices. The control of the
transfer of data from external devices to
processor consists following steps:
The processor interrogates the I/O
module to check status of the attached

device.
The I/O module returns the device

status.
If the device is operational and ready
to transmit, the processor requests the

know the status of I/O module.


Address recognition: I/O module
must

I/O transformation
The detailed functions of I/O modules are;
1. Control & Timing: I/O module includes
control and timing to coordinate the flow

Status reporting: Peripherals are

one

unique

address for each peripheral it


controls.
3. Device

Communication:

It

involves

commands, status information and data.


4. Data Buffering: I/O module must be able
to operate at both device and memory
speeds. If the I/O device operates at a rate
higher than the memory access rate, then
the I/O module performs data buffering. If
I/O devices rate slower than memory, it
buffers data so as not to tie up the memory
in slower transfer operation.
5. Error

Detection:

I/O

module

is

transfer of data by means of a

responsible for error detection such as

command to I/O module.


The I/O module obtains the unit of

mechanical and electrical malfunction

data from the external device.


The data are transferred from the I/O

track & unintentional changes to the bit

module to the processor.


2. Processor Communication: I/O module

reported by device e.g. paper jam, bad ink


pattern and transmission error.

communicates with the processor which


involves:
Command decoding: I/O module
accepts

commands

processor.
Data: Data

are

from

the

exchanged

between the processor and I/O


module over the bus.
COA

recognize

Page 4

I/O Module Structure

UNIT-3
Control device functions or leave for CPU

Also O/S decisions ,e.g. Unix


treats everything it can as a file

3.3. Modes of transfer


Data Transfer between the central computer
and I/O devices may be handled in a variety of
Fig: Block diagram of I/O Module

modes.
Some modes use CPU as an intermediate path,

The I/O bus from the processor is attached to all

others transfer the data directly to and from

peripheral interfaces

the memory unit.

Data transfer to and from peripherals may be

To communicate with the particular devices,

handled in one of three possible modes.

the processor places a device address on the

I.

address bus.

Each interface contains an address decoder

II.

that monitors the address line. When the

III.

Interrupt Driven I/O


Direct

Memory

Access (DMA)

interface detects the particular device address,

Programmed I/O

it activates the path between the data line and

Question: Explain in detail the programmed I/O and

devices that it controls.

Interrupt driven I/O operations(10 M)(a).

At the same time that the address is made


available in the address line, the processor

Question:Explain the method of programmed I/O(5


M)

provides a function code in the control way,


includes control command, output data and
I.

input data.

Programmed I/O :(a)


Programmed I/O operations are
the result of I/O instructions

I/O Module Decisions

written in the computer program


Hide or reveal device properties to CPU

Support

multiple

or

In programmed I/O, each data


single

device
COA

transfer

in

initiated

by

the

instructions in the CPU and hence


Page 5

UNIT-3
the CPU is in the continuous
monitoring of the interface.
Input

instruction

is

CPU is in a continuous monitoring of the


interface in which it checks the F bit of the

used

to

status register.

transfer data from I/O device to

If it is set i.e. 1, then the CPU reads

CPU, store instruction is used to

the data from data register and sets F

transfer

bit to zero

data

from

CPU

to

memory and output instruction is

used to transfer data from CPU to


I/O device.

If it is reset i.e. 0, then the CPU


remains monitoring the interface.

Interface disables the data accepted signal and

This technique is generally used


in very slow speed computer and

the system goes to initial state where next item


of data is placed on the data bus.

is not a efficient method if the


speed of the CPU and I/O is
different.

(a)

I/O device places the data on the I/O bus and


enables its data valid signal

I/O Commands:

The interface accepts the data in the

There are four types of I/O commands that an I/O

data register and sets the F bit of

module may receive when it is addressed by a

status register and also enables the

processor:

data accepted signal.

Control: Used to activate a peripheral and tell

Data valid line is disables by I/O


device.

COA

Page 6

it what to do. For example, a magnetic-tape

UNIT-3
unit may be instructed to rewind or to move
forward one record.
Test: Used to test various status conditions
associated with an I/O module and its
peripherals.
To know that the peripheral of interest
is powered on and available for use
and also to know if the most recent
I/O operation is completed and if any
errors occurred.
Read: Causes the I/O module to obtain an
item of data from the peripheral and place it in
an internal buffer (depicted as a data register
in Figure 7.3).The processor can then obtain
the data item by requesting that the I/O
module place it on the data bus.
Write: Causes the I/O module to take an item
of data (byte or word) from the data bus and
subsequently transmit that data item to the
peripheral.

I/O Instructions:
There will be many I/O devices connected
through I/O modules to the system. Each
device is given a unique identifier or address.
When the processor issues an I/O command,
the command contains the address of the
desired device.
Thus, each I/O module must interpret the
address lines to determine if the command is
for itself.
When the processor, main memory, and I/O share a
common bus, two modes of addressing are possible:
i.

Memory mapped :
There is a single address space for
memory locations and I/O devices.

COA

Page 7

UNIT-3
The processor treats the status and
data registers of I/O modules as
memory locations and uses the same
machine instructions to access both

memory and I/O devices


for example, with 10 address lines, a
combined

total

of

2^10=

1024

memory locations and I/O addresses


ii.

can be supported, in any combination.


Isolated:
In this mode the I/O gets isolated from
the memory hence its called isolated
I/O. The command line specifies
whether the address refers to a
memory location or an I/O device.
The full range of addresses may be

available for both.


With 10 address lines, the system now
supports both 1024 memory locations
and 1024 I/O addresses.

II.
INTERRUPT DRIVEN I/O: (a)
The problem with programmed I/O is that the
processor has to wait a long time for the I/O
module

of

concern

to

be

ready

for

transmission of data.
In Interrupt driven I/O the processor issues an
I/O command to a module and then go on to
do some other useful work.
The I/O module will then interrupt the
processor to request service when it is ready to
exchange data with processor.
The processor then executes the data transfer,
and then resumes its former processing. The
interrupt can be initiated either by software or
by hardware.

Interrupt Driven I/O basic operation


a. CPU issues read command

COA

Page 8

UNIT-3
b. I/O module gets data from peripheral
whilst CPU does other work
c. I/O module interrupts CPU
d. CPU requests data
e. I/O module transfers data

(a)
Interrupt Design Issues:
First, because of

multiple

I/O

modules, how does the processor


determine which device issued the
interrupt?
And second, if multiple interrupts
Interrupt Processing from CPU viewpoint
i.
Issue read command
ii.
Do other work
iii.
Check for interrupt at end of each
iv.

COA

instruction cycle
If interrupted:a) Save context (registers)
b) Process interrupt
c) Fetch data & store

have occurred, how does the processor


decide which one to process?
Four general categories of techniques
are in common use:
a) Multiple interrupt lines
b) Software poll
c) Daisy chain (hardware poll,
vectored)
d) Bus arbitration (vectored)
a) Multiple interrupt lines:

Page 9

UNIT-3

Provide multiple interrupt lines

between the processor and the I/O

The

requesting

module

typically

responds by placing a word(vector) on

modules
The problem in this technique is even

the data lines.


The processor may also use the vector

if multiple lines are used, each line

as a pointer to the appropriate device-

will

I/O modules

service routine. This avoids the need

attached to it.
So any one of the other three

to execute a general interrupt-service

techniques are used .


b) Software Poll:
Priority is established by the order of

vectored interrupt
d) Bus Arbitration (vectored):
Bus arbitration uses vector technique
An I/O module must first gain control

have

multiple

polling the devices (interrupt sources),


(i.e)identify

the

highest-priority

of the bus before it can raise the

source by software means


One common branch address is used

interrupt request line.


So, only one module can raise the line

for all interrupts


Program polls the interrupt sources in

at a time.
When the

sequence
The highest-priority source is tested

first
Flexible since it is established by

software
Low cost since it needs a very little

hardware
Very slow
c) Daisy Chain:
I/O modules share a common interrupt

request line.
The interrupt acknowledge line is

daisy chained through the modules.


The processor senses an interrupt, it

sends out an interrupt acknowledge.


This signal propagates through a
series of I/O modules until it gets to a
requesting module.

COA

routine first. This technique is called a

Page 10

processor

detects

the

interrupt, it responds on the interrupt

acknowledge line.
The requesting module then places its
vector on the data lines.

Question: Explain the DMA method of I/O


processing with necessary diagrams.(10 M)
III.

DIRECT MEMORY ACCESS (DMA)


Drawback of Programmed and
Interrupt-Driven I/O
I/O transfer rate limited to
speed that processor can test

and service devices


Processor tied up managing

I/O transfers
DMA Function

UNIT-3

DMA module on system bus

used to mimic the processor.


DMA module only uses

DMA Break points during instruction


cycle:

system bus when processor

does not need it.


DMA
module

may

temporarily force processor to


suspend operations cycle
stealing.

The processor is suspended just before it


needs to use the bus.
The DMA module transfers one word

processor does not have to save

DMA Block Diagram

DMA Operation:
The processor issues a command to DMA
module
Read or write
I/O device address using data lines
Starting memory address using data

and returns control to the processor.


Since this is not an interrupt the

lines stored in address register


Number of words to be transferred
using data lines stored in data

register
The processor then continues with other work
DMA module transfers the entire block of data

context.
The processor executes more slowly,
but this is still far more efficient that
either programmed or interrupt-driven

I/O.
DMA Configurations:

Single bus detached DMA module


Each transfer uses bus twice I/O to DMA,

DMA to memory
Processor suspended twice

one word at a time directly to or from


memory without going through the processor
DMA module sends an interrupt to the
processor when complete
COA

Single bus integrated DMA module


Page 11

UNIT-3

Module may support more than one device


Each transfer uses bus once DMA to

memory
Processor suspended once

Ability to execute I/O instructions specialpurpose processor on I/O channel complete


control over I/O operations
Processor does not execute I/O instructions
itself processor initiates I/O transfer by
instructing the I/O channel to execute a

Separate I/O bus


Bus supports all DMA enabled devices
Each transfer uses bus once DMA to

memory
Processor suspended once

Question: Write a brief note on I/O channel

program in memory
Program specifies
Device or devices
Area or areas of memory
Priority
Error condition actions
Two type of I/O channels:
Selector channel:
Controls multiple high-speed devices
Dedicated to the transfer of data with

architecture.(5 M)
III.4.
I/O Channels and Processors:
The Evolution of the I/O Function

one of the devices


Each device handled by a controller,

or I/O module
I/O channel

1. Processor directly controls peripheral device

controls

these

I/O

controllers

2. Addition of a controller or I/O module


programmed I/O
3. Same as 2 interrupts added
4. I/O module direct access to memory using
DMA
5. I/O module enhanced to become processor
like I/O channel
6. I/O module has local memory of its own
computer like I/O processor

More and more the I/O function is performed

without processor involvement.


The processor is increasingly relieved of I/O

related tasks improved performance.


Characteristics of I/O Channels:
Extension of the DMA concept
COA

Multiplexor channel:
Can handle multiple devices at the

same time
Byte multiplexor used for low-speed

devices
Block multiplexor interleaves blocks
of data from several devices.

Page 12

UNIT-3

COA

Page 13

S-ar putea să vă placă și