Input-Output Interface
• Input-output interface provides a method for transferring
information between internal storage and external I/0 devices.
• Peripherals connected to a computer need special
communication links for interfacing them with the central
processing unit.
• The purpose of the communication link is to resolve the
differences that exist between the central computer and each
peripheral.
Input-Output Interface
• 1. Peripherals are electromechanical and electromagnetic
devices and their manner of operation is different from the
operation of the CPU and memory, which are electronic devices.
Therefore, a conversion of signal values may be required.
• 2. Data codes and formats in peripherals differ from the word
format in the CPU and memory.
• 3. The data transfer rate of peripherals is usually slower than the
transfer rate of the CPU, and consequently, a synchronization
mechanism may be needed.
Input-Output Interface
• 4. The operating modes of peripherals are different from each
other and each must be controlled so as not to disturb the
operation of other peripherals connected to the CPU.
• To Resolve these differences, computer systems include special
hardware components between the CPU and Peripherals to
supervises and synchronizes all input and out transfers.
• These components are called Interface Units because they
interface between the processor bus and the peripheral
devices.
Connection of i/o bus to i/o devices
I/O BUS and Interface Module
• Each peripheral device has associated with it an interface unit.
• Each interface decodes the address and control received from
the I/O bus, interprets them for the peripheral, and provides
signals for the peripheral controller.
• It also synchronizes the data flow and supervises the transfer
between peripheral and processor.
I/O BUS and Interface Module
• Each peripheral has its own controller that operates the
particular electromechanical device.
• The printer controller controls the paper motion, the print
timing, and the selection of printing characters.
• A controller may be housed separately or may be physically
integrate
• The I/O bus from the processor is attached to all peripheral
interfaces.
I/O command
• I/O Commands are the instructions given by the CPU to I/O
interface or I/O devices to perform specific operations. The
control lines are referred as I/O command.
• Control command- A control command is issued to activate
the peripheral and to inform it what to do.
• Status command- A status command is given by CPU to check
the status of I/O devices.
• Data Output command- A data output command causes the
interface to respond by transferring data from the bus into one
of its registers. This command is given by CPU to read any data
to output devices.
I/O command
• Data Input command- The data input command is the
opposite of the data output.
• In this case the interface receives an item of data from the
peripheral and places it in its buffer register.
• The processor checks if data are available by means of a
status command and then issues a data input command.
• The interface places the data on the data lines, where they
are accepted by the processor.
Isolated i/o
• In the Isolated I/O configuration, the CPU has distinct input
and output instructions
• In Isolated I/O, the address and data bus are common, but
control bus are different.
• For memory, it has memory read and memory write control
lines.
• For I/O devices, it has separate I/O read and I/O write control
lines.
Isolated i/o
• When the CPU fetches and decodes the operation code of an
input or output instruction, it places the address associated
with the instruction into the common address lines.
• At the same time, it enables the I/O read (for input) or I/O
write (for output) control line.
• This informs the external components that are attached to the
common bus that the address in the address lines is for an
interface register and not for a memory word.
Isolated i/o
• When the CPU is fetching an instruction or an operand from
memory, it places the memory address on the address lines
and enables the memory read or memory write control line.
• This informs the external components that the address is for a
memory word and not for an I/O interface.
• The isolated I/O method isolates memory and I/O addresses so
that memory address values are not affected by interface
address assignment since each has its own address space
memory-mapped I/O
• In Memory mapped I/O address, data and control bus are
common for both memory and I/O devices.
• In a memory-mapped l/0 organization there are no specific
input or output instructions.
• In a typical computer, there are more memory-reference
instructions than l/0 instructions.
• With memory mapped l/0 all instructions that refer to memory
are also available for l/0.
Asynchronous Data Transfer
• The internal operations in a digital system are synchronized by
means of clock pulses supplied by a common pulse generator.
• Two units, such as a CPU and an I/O interface, are designed
independently of each other.
• If the registers in the interface share a common clock with the
CPU registers, the transfer between the two units is said to be
synchronous.
Asynchronous Data Transfer
• In most cases, the internal timing in each unit is independent
from the other in that each uses its own private clock for
internal registers.
• In that case, the two units are said to be asynchronous to each
other. This approach is widely used in most computer system.
• Asynchronous data transfer between two independent units
requires that control signals be transmitted between the
communicating units to indicate the time at which data is being
transmitted.
Asynchronous Data Transfer
• One way of achieving this is by means of a strobe pulse supplied
by one of the units to indicate to the other unit when the
transfer has to occur.
• Another method commonly used is to accompany each data
item being transferred with a control signal that indicates the
presence of data in the bus.
• The unit receiving the data item responds with another control
signal to acknowledge receipt of the data.
• This type of agreement between two independent units is
referred to as handshaking.
Asynchronous Data Transfer
• Types of Asynchronous Data Transfer:-
1. Strobe Control-
a) Source-Initiated Strobe for Data Transfer
b) Destination-Initiated Strobe for Data Transfer
2. Handshaking-
a) Source-Initiated Transfer Using Handshaking
b) Destination-Initiated Transfer Using Handshaking
Strobe Control
• The strobe control method of asynchronous data transfer
employs a single control line to time each transfer.
• The strobe may be activated by either the source or the
destination unit.
• The data bus carries the binary information from source unit to
the destination unit.
• Typically, the bus has multiple lines to transfer an entire byte or
word.
• The strobe is a single line that informs the destination unit when
a valid data word is available in the bus.
Source-Initiated Strobe Control
• The source unit first places the data on the data bus. After a
brief delay to ensure that the data settle to a steady value, the
source activates the strobe pulse.
• The information on the data bus and the strobe signal remain in
the active state for a sufficient time period to allow the
destination unit to receive the data.
• The source removes the data from the bus a brief period after it
disables its strobe pulse.
• Strobe signal is disabled indicates that the data bus does not
contain valid data. New valid data will be available only after the
strobe is enabled again.
Source-Initiated Strobe Control
destination -Initiated Strobe Control
• The destination unit activates the strobe pulse, informing the
source to provide the data.
• The source unit responds by placing the requested binary
information on the data bus.
• The data must be valid and remain in the bus long enough for
the destination unit to accept it.
• The falling edge of the strobe pulse can be used again to trigger
a destination register.
• The destination unit then disables the strobe. The source
removes the data from the bus after a predetermined time
interval.
destination -Initiated Strobe Control
handshaking
• The disadvantage of the strobe method is that the source
unit that initiates the transfer has no way of knowing
whether the destination unit has actually received the data
item that was placed in the bus.
• Similarly, a destination unit that initiates the transfer has no
way of knowing whether the source unit has actually placed
the data on the bus.
• The handshake method solves this problem by introducing a
second control signal that provides a reply to the unit that
initiates the transfer.
Handshaking - basic principle
• One control line is in the same direction as the data flow in
the bus from the source to the destination.
• It is used by the source unit to inform the destination unit
whether there are valid data in the bus.
• The other control line is in the other direction from the
destination to the source.
• It is used by the destination unit to inform the source
whether it can accept data.
• The sequence of control during the transfer depends on the
unit that initiates the transfer.
Source-initiated transfer using handshaking
• The two handshaking lines are data valid, which is generated by
the source unit, and data accepted, generated by the
destination unit.
• The timing diagram shows the exchange of signals between the
two units.
• The source unit initiates the transfer by placing the data on the
bus and enabling its data valid signal.
• The data accepted signal is activated by the destination unit
after it accepts the data from the bus.
Source-initiated transfer using handshaking
• The source unit then disables its data valid signal, which
invalidates the data on the bus.
• The destination unit then disables its data accepted signal and
the system goes into its initial state.
• The source does not send the next data item until after the
destination unit shows its readiness to accept new data by
disabling its data accepted signal.
• The rate of transfer is determined by the slowest unit.
Source-initiated transfer using handshaking
destination-initiated transfer using handshaking
• The name of the signal generated by the destination unit
has been changed to ready for data to reflect its new
meaning.
• The source unit in this case does not place data on the bus
until after it receives the ready for data signal from the
destination unit.
• From there on, the handshaking procedure follows the
same pattern as in the source-initiated case.
• The only difference between the source-initiated and the
destination-initiated transfer using
handshaking
Asynchronous serial transfer
• The transfer of data between two units may be done in parallel
or serial.
• In parallel data transmission, each bit of the message has its
own path and the total message is transmitted at the same
time.
• This means that an n-bit message must be transmitted through
n separate conductor paths.
• In serial data transmission, each bit in the message is sent in
sequence one at a time.
• This method requires the use of one pair of conductors or one
Asynchronous serial transfer
• Parallel transmission is faster but requires many wires.
• It is used for short distances and where speed is important.
• Serial transmission is slower but is less expensive since it
requires only one pair of conductors.
• Serial transmission can be synchronous or asynchronous.
• In synchronous transmission, the two units share a common
clock frequency and bits are transmitted continuously at the
rate dictated by the clock pulses.
Asynchronous serial transfer
• In long distant serial transmission, each unit is driven by a
separate clock of the same frequency.
• In asynchronous transmission, binary information is sent only
when it is available and the line remains idle when there is no
information to be transmitted.
• This is in contrast to synchronous transmission, where bits must
be transmitted continuously to keep the clock frequency in both
units synchronized with each other.
Asynchronous serial transfer
• A serial asynchronous data transmission technique used in
many interactive terminals employs special bits that are
inserted at both ends of the character code.
• With this technique, each character consists of three parts:
a start bit, the character bits, and stop bits.
• The first bit, called the start bit, is always a 0 and is used to
indicate the beginning of a character.
• The last bit called the stop bit is always a 1.
Asynchronous serial transfer
• A transmitted character can be detected by the receiver
from knowledge of the transmission rules:
• 1. When a character is not being sent, the line is kept in the
1-state.
• 2. The initiation of a character transmission is detected from
the start bit, which is always 0.
• 3. The character bits always follow the start bit.
• 4. After the last bit of the character is transmitted, a stop bit
is detected when the line returns to the 1-state for at least
one bit time.
Asynchronous serial transfer
Asynchronous serial transfer
• Consider the serial transmission of a terminal whose transfer
rate is 10 characters per second.
• Each transmitted character consists of a start bit, eight
information bits, and two stop bits, for a total of 11 bits.
• Ten characters per second means that each character takes 0.1 s
for transfer.
• Ten characters per second with an 11-bit format has a transfer
rate of 110 baud.