Sunteți pe pagina 1din 6

Types of I/O

There are three types of I/O operations:

Sensory input

digital input
analog input
Control output

direct digital output


modulated digital output
analog output
Data transfer

parallel
serial

Notes:

I/O is one of the three main components in a computer system. The


responsibility of I/O is to interface with external devices. Based on their
applications, all I/O operations can be divided into three types, sensory input,
control output, and data transfer. Once the nature of each type of I/O
operation is understood, the hardware design and software for these
operations can be understood easily.

Like memory components, I/O components have addresses and each I/O
address usually consists of 8 or 16 bits of data. Since many sensory input and

control output signals consist of just one bit of information, a single I/O
address may be able to handle multiple input and output signals. For
instance, dome bits of an 8-bit port can be used to receive input signals while
other bits are used to send output signals. Therefore, sometimes one bit of an
I/O address is called an I/O port and sometimes all bits of one I/O address are
called an I/O port. When someone says how many ports are needed, you
need to find out what his or her definition of port is.

I/O type 3: I/O for data transfer

Parallel I/O: data are transferred one byte or one word at a time through
multiple lines.

Synchronous data transfer uses a shared clock.


Asynchronous data transfer may use hand shaking
Serial I/O: data are transferred one bit at a time through a single line.

May be synchronous or asynchronous.

Notes:

Data transfer between a computer and an external device is another main


function of I/O. There are two main types data transfer - parallel and serial.
Parallel data transfers multiple bits simultaneously, thereby achieving higher
information transfer rates. Serial data transfer only allows information to be
transferred one bit at a time. Serial data transfer requires fewer hardware
pins.

Circuits for parallel data transfer are similar to those circuits described for
sensory input and control output. There are not many variations of parallel
data transfer formats.

There are a lot of variations of serial data transfer in terms of protocol and
physical signal specifications. This subject is too broad to be discussed in this
short course so detailed description of various serial data communication will
be deferred to another course. Only a very brief introduction of serial data
transfer is given here.

Handshaking for asynchronous data transfer

The clock rates for sender and receiver may be quite different.

The sender needs to know whether the receiver has received the information.

Handshaking is a way to enable sender and receiver to coordinate data


transfers.

Types of handshaking

simple output
simple strobe
single handshaking
double handshaking

Notes:

For data transfer between two computers, the sending and receiving speeds
on both ends are often different. Therefore, a mechanism is needed to make
sure that the sender does not send a new byte before the previously sent

byte is received by the receiver. Even when the sender and receiver operate
at the same speed, the sender may still want to know whether the receiver
has indeed received the information. Handshaking provides a mechanism for
addressing this issue. Handshaking usually uses two additional hardware
lines, one is called strobe and the other is called acknowledge. The
sender provides the signal to the strobe line and the receiver provides the
signal to the acknowledge line.

Handshaking can be used in both parallel data transfer and serial data
transfer.

We will study four different data transfer conventions: simple output, simple
strobe, single hand shaking and double handshaking.

Simple strobe

Notes:

Simple output is used when the receiving device is dumb (cannot reply to the
sender). It is assumed that the receiving device can always receive the
information on the data bus. A typical application example is turning lights on
and off. The microprocessor does not generally check to see whether the
lights have been turned on or off in response to the command sent.

Simple strobe is used when the receiving device needs to be notified when
the data is sent. It is assumed that the receiving device can always receive
the information on the data bus. A latch receiving data constitutes an
example of simple strobing.

Single handshaking

Notes:

Single handshaking lets the sender tell the receiver that a new frame
(number of bytes) is ready to be sent and lets the receiver notify the sender
that it has received the information. After handshaking, the sender sends the
frame. Single handshaking lets the sender send out data and the strobe
signal without considering whether the receiver is ready to receive the data.
Strobe is the signal controlled by the sender. Acknowledge is a signal
controlled by the receiver. Data is sent by the sender.

Double handshaking

Notes:

Strobe is the signal controlled by the sender. Acknowledge is a signal


controlled by the receiver. Data can be sent by either sender or receiver. In
certain situations (such as multiple device communication), the sender
should not send the information to the bus unless the receiver is ready to
receive the data. Double handshaking can handle such a situation. Double
handshaking lets the sender tell the receiver that a new frame (number of
bytes) is ready to be sent and lets the receiver tell the sender that it is ready
to receive the information. After the first handshaking is completed, the
sender sends the data frame. Once the frame has been received, the receiver
notifies the sender that the data frame was received correctly. In this way,
the sender knows when to send a new frame.

Implementation of handshaking

Hardware implementation

Software implementation

Polling
receiver polls the strobe line
sender polls the acknowledge line
Interrupt
interrupt occurs when the signal level changes

Notes:

Handshaking can be implemented in either hardware or software. Hardware


implementation can use a state machine. Software implementation can use
either polling or interrupts (to be explained later).

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