Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Megha Chaudhary
Input-Output Interface
Input-Output interface provides a method for
transferring information between internal
storage and external I/O devices.
The data transfer rate is different from the clock rate of the
CPU(usually slower). A synchronization mechanism may be
needed.
Data codes and formats in peripherals differ from the word format
in the CPU and Memory.
Valid data
Data
Strobe
(b) Timing diagram
STROBE
Destination Initiated Strobe
Data bus
Source Destination
unit Strobe unit
Valid data
Data
Strobe
(b) Timing diagram
HANDSHAKING
Disadvantages of strobe method
Source unit that initiate the transfer has no way of knowing
whether the destination unit has actually received the data
item.
Similarly destination unit has no way of knowing whether the
source unit has actually placed the data on the bus.
Handshake mechanism solves this problem by introducing a
second control signal that provides a reply to the unit that
initiates transfer.
Handshaking : Agreement between two independent units.
Source-initiated handshake
Destination-initiated handshake
SOURCE INITIATED HANDSHAKE
Handshaking signals are used to synchronise
bus activities.
1 1 0 0 0 1 0 1
Start Stop
Character bits
bit bit
ASYNCHRONOUS SERIAL TRANSFER
Baud Rate : Data transfer rate in bits per second.
10 character per second with 11 bit format = 110 bit
per second.
Such circuit is called universal asynchronous receiver
transmitter(UART).
ASYNCHRONOUS SERIAL TRANSFER
ASYNCHRONOUS SERIAL TRANSFER
ASYNCHRONOUS SERIAL TRANSFER
Double Buffered
New character can be loaded as soon as the previous one
starts transmission.
Possible errors
parity error : Even parity or odd parity.
Framing error : right number of stop bits are not detected at
the end of the received character.
Overrun error : CPU does not read the character from the
receiver register before the next one is available.
MODES OF TRANSFER
Data transfer to and from peripherals may be
handled in one of three possible modes.
Programmed I/O
Interrupt-initiated I/O
Direct memory access(DMA)
PROGRAMMED I/O
Each data transfer is initiated by an instruction in
the program.
CPU stays in the program loop until I/O indicates
it is ready for data transfer.
It is time consuming process since it keeps the
processor busy needlessly.
PROGRAMMED I/O
Status
I/O write F
register Data accepted
F = Flag bit
= 0
Flag
= 1
Operation no
complete ?
yes
Continue
with
program
INTERRUPT INITIATED I/O
In this type of I/O, computer does not check the
flag continuously.
Whenever any device wants attention, it sends
the interrupt signal to the CPU.
CPU then deviates from what it is doing, store
the return address from PC and branch to the
address of the subroutine.
INTERRUPT INITIATED I/O
There are two ways of choosing the branch
address.
Vectored interrupts : The source that interrupts the
CPU provides the branch information(interrupt
vector).
Non vectored interrupts : Branch address is assigned
to fixed address in the memory.
PRIORITY INTERRUPT
There are number of devices attached to the
computer.
They are all capable of generating an interrupt.
When the interrupt is generated for more than
one device, priority interrupt system is used to
determine which device is to be serviced first.
Devices with high speed transfer are given higher
priority.
PRIORITY INTERRUPT
Establishing the priority can be done in two
ways:
Using Software
Using Hardware
A polling procedure is used to identify high
priority in software means.
POLLING PROCEDURE
There is a common branch address for all interrupts.
No interrupt request
Invalid : interrupt request, but no acknowledge
No interrupt request : Pass to other device (other
device requested interrupt )
Interrupt request
PARALLEL PRIORITY INTERRUPT
It consist of the interrupt register whose bits are set
separately by interrupting devices.
Internal bus
DMA select CS Address register
Register select RS
Read RD Word count register
Write WR
Control
Bus request BR logic Control register
Bus grant BG
DMA request
Interrupt Interrupt
to I/O device
DMA Acknowledge
DMA Controller
It communicate with CPU through data bus
and control lines.
Registers in DMA are selected by CPU by
enabling DS and RS.
When BG=0, the CPU can communicate with
DMA register for read and write operation.
When BG=1 DMA communicate directly with
the memory.
DMA Controller
Three registers
Address Register : Contains the address which specify
the location of memory to read and write, it is
incremented after each word is transferred to
memory.
Word count register : holds number of words to be
transferred. It is decremented by 1 after each word
transfer and regularly checked for 0.
Control register : specify the mode of the
transfer(read/write).
DMA Transfer
Interrupt
BG Random access
CPU
memory (RAM)
BR
Read control
Write control
Data bus
Address bus
Address
select
RD WR Address Data
DMA acknowledge
DS
RS Direct memory I/O
access (DAM) Peripheral
BR controller device
DMA request
BG
Interrupt
DMA Transfer
I/O Device sends a DMA request.
DMAC activates the BR line.
CPU responds with BG line.
DMAC sends a DMA acknowledge to the I/O device.
I/O device puts a word in the data bus (for memory write).
DMAC write a data to the address specified by Address register.
Decrement Word count register.
When word count register reaches zero, control is given back to
the CPU.
Now I/O device can again request DMA.
Input-Output Processor
Input-Output Processor
It is a processor with direct memory access capability
that communicates with I/O devices.
IOP is similar to CPU except that it is designed to
handle the details in I/O operations.
Unlike DMA which is initialized by CPU, IOP can fetch
and execute its own instructions.
IOP instructions are specially designed to handle I/O
operations.
Channel accesses memory by cycle stealing
CPU IOP COMMUNICATION