Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ORGANISATION
BY: Vaishakh B N
USN:1RV09CS1114
CONTENTS
Bus
A simple arrangement of connecting I/O devices using a single bus is shown in the
above figure.
The bus consists of 3 sets of lines
1)Address lines
2)Data lines
3)Control lines
Since there is a common bus, if more than one device is enabled at a time , the data
on the bus will be ambiguous and results in a problem called “BUS CONTENTION”
To avoid this condition each i/o device is assigned a unique address. Only the
addressed device is enabled and responds to the commands issued by the control
lines
MEMORY MAPPED I/0 (1/2)
Memory mapped I/O is one of the ways to deal with I/O
devices. In this case the memory and the I/o devices
share a common address space.
The most significant bit (MSB) of the address bus is
used to differentiate I/O and memory.
We normally associate a buffer (analogous to
memory) with each I/O device.
Since I/O is also used as memory, any data transfer
instruction like Move, Load can be used to exchange
information.
EX: If DATAIN is the input buffer associated with the
keyboard, then the instruction
Move DATAIN, R0
reads the data from DATAIN (key value stored in buffer
)and stores it to process register R0.
MEMORY MAPPED I/O (2/2)
Similarly the instruction
Move R0, DATAOUT
Sends the contents of register R0 to the location
DATAOUT, where DATAOUT is the name of the output
data buffer of a display unit or a printer.
DISADVANTAGES:
Generally, the number of I/O devices in a system are
not large. Hence, this scheme results in insufficient
utilization of large address space provided to the I/O
devices
Since instructions are same for both memory and I/O
devices , the programmer has to be cautious to decide
whether the data transfer is with I/O or memory.
Also decoding the circuitry is complex.
I/O MAPPED I/O
Memory and I/O address space are different.
IN and OUT special instructions are used for data
transfer.
The advantage of separate I/O space is that I/O
devices deal with lesser address lines resulting in
small decoder size and simpler hardware.
Separate I/O address space does not necessitise
separate address lines on the processor bus. A
special signal on the bus indicates whether the sent
address is from memory or I/O device.
In order to have an efficient and organized data
transfer, an intermediary is required between the
processor and I/O devices. This is called I/O
interface .
I/O INTERFACE
Address lines
BUS
Data lines
Control lines
I/O Interface
Address Control Data and
Decoder Circuits Status Registers
Input Device
INTERFACING I/O DEVICES
Three mechanisms have been developed for
interfacing I/O devices.
Program Controlled I/O
Interrupt I/O
Hardware controlled I/O
PROGRAM CONTROLLED I/O
Consider an example of interfacing of keyboard and display to
the CPU
We have SIN associated with keyboard
SOUT associated with display
SIN=1 indicates that character is entered at the keyboard.
Once the processor reads the character, SIN becomes 0
Similarly SOUT=0 indicates that the display is busy and when
SOUT is 1 the display is ready to receive a character.
In Program Controlled I/O the processor repeatedly checks a
status flag to achieve synchronization with an I/O device, for
data transfer. This is called “POLLING ” of the device.
This method has a drawback that that it wastes the time by
checking the status of the device before the actual data
transfer.
Input/Output Organization
4.1 Accessing I/O Devices -Registers in
Keyboard and Display interfaces
DATAIN
DATAOUT
7 6 5 4 3 2 1 0
Accessing I/O Devices - I/O Program with
Keyboard and Display
Print Routine
Compute Routine
1
2
. .
. .
Interrupt .
i
Occurs .
i+1 .
here
.
M
Input / Output Organization
Interrupts
Assuming arriving of interrupt during
execution of ith instruction in Compute routine
following action will be taking place.
Processor
R
INTR
INTR O
......
INTAp
INTA1 INTA2
Priority arbitration
Circuit
Input/Output Organization
Interrupts - Handling Multiple devices –
Vectored Interrupts – Interrupt nesting – Processor
priority – Simultaneous requests
Simultaneous requests
When simultaneous requests are to be handled from two
or more devices of the same type, processor must have
means of deciding which request to service first.
In this case several devices share one interrupt-request
line.
Polling status registers of such devices is simple, priority
is determined by the order of polling.
When vector interrupts are used, it must be ensured that
only one device is selected to send its interrupt vector.
Input/Output Organization
Interrupts - Handling Multiple devices –
Vectored Interrupts – Interrupt nesting – Processor
priority – Simultaneous requests
Simultaneous requests
A widely used mechanism of connecting devices of
the same type or sharing one Interrupt-request line is
to connect them in daisy chain.
Interrupt request line (INTR) is common to all the
devices.
Interrupt acknowledge line (INTA) is connected in a
daisy-chain fashion, such that the INTA signal
propagates serially through the devices.
Input/Output Organization
Interrupts - Handling Multiple devices –
Vectored Interrupts – Interrupt nesting – Processor
priority – Simultaneous requests
Simultaneous requests
When several devices raise an Interrupt-request and
the INTR line is activated.
The processor sends INTA line to device 1.
The signal (INTA) received by device 1 is passed to
next device in the chain only if it does not require
service.
If Device 1’s request is pending, it blocks INTA signal
and proceeds to its identification by putting its code
on the data bus.
In this daisy chain arrangement the device which is
closer to the processor has highest priority.
Input/Output Organization
Interrupts - Handling of Multiple devices
Interrupt Priority Schemes – Daisy Chain
INTR
Processor
….
Device 1 Device 2 Device n
INTA
Input/Output Organization
Interrupts - Handling Multiple devices –
Vectored Interrupts – Interrupt nesting – Processor
priority – Simultaneous requests
Simultaneous requests
More general structure of connecting/handling devices is
To organize devices in groups, and each group is connected
at a different priority level.
Within a group, devices are connected in a daisy chain.
Input/Output Organization
Interrupts - Handling of Multiple devices
Interrupt Priority Schemes – Arrangement of priority Groups
INTR 1
Device Device
INTA 1
Processor
. .
INTR p . .
Device Device
INTA p
Priority arbitration
circuit
Input/Output Organization
Interrupts - Controlling Device requests