Lec 7 I-o Modules-computer Architecture
Lec 7 I-o Modules-computer Architecture
LECTURE 7
I/O INTERFACE
■ An interface is a shared boundary between two separate components
of the computer system which can be used to attach two or more
components to the system for communication purposes.
Definition:
An I/O interface is a hardware circuit used between the CPU and I/O
devices (peripherals) to supervise and synchronize all input and output
transfers.
– I/O interface provides a method for transferring information
between internal storage to external I/O devices.
– Peripherals connected to a computer need special communication
links for interfacing them with the CPU
I/O BUS AND INTERFACE
MODULES
■ In addition to the processor and a set of memory modules, the third
key of the computer system is a set of I/O modules.
■ Each module interfaces to the system bus or central switch to control
one or more peripheral devices.
■ An I/O modules is the entity within a computer responsible for the
control of one or more external devices and for the exchange of data
between those devices and main memory and / or CPU registers.
Thus, the I/O module must have an interface to the computer (to the
CPU and main memory) and an interface internal to the computer (to
the external device).
Input and output modules (i/o
■ modules)
I/O modules stands for input/output modules which is a device that acts as
the connective bridge between a computer system at one end and an I/O or
peripheral device of some kind at the other such as printers, webcams, or
scanner.
■ A device connected to an I/O module of a computer is called a peripheral
device
Block Diagram of an I/O
Module
Importance of an I\O module
■ Operation method: variety of I/O devices are available with different
operation method. It was not possible to develop operation logic of each I/O
devices in the CPU itself.
■ Slow speed: The I/O devices are much slower than that of the CPU. Hence
it is not possible to match to match high speed of CPU with speed of I/O
devices.
■ Data formats: As I/O devices are made with different operation method
some of them uses different data formats. It was impractical to integrate
each data format in the CPU.
■ Storage and error detection: I/O module should have facilities like
buffer (storage area) and error detection mechanism. since there are speed
differences between CPU and I/O devices,
I/O module functions
■ The I/O transfer rate is limited by the speed with which the processor
can test and service a device.
■ The processor is tied up in managing an I/O transfer; a number of
instructions must be executed for each I/O transfer.
DIRECT MEMORY ACCESS
■ DMA uses special I/O CPU that take control of an I/O operation to move
large block of data. This technique adds additional module on system bus
■ DMA involves an additional module on the system bus. The DMA module
is capable of mimicking the processor and, indeed, of taking over control
of the system from the processor. It needs to do this to transfer data to
and from memory over the system bus. For this purpose, the DMA
module must use the bus only when the processor does not need it, or it
must force the processor to suspend operation temporarily.
■ The main idea of direct memory access (DMA) is to enable peripheral
devices to cut out the role of the CPU in data transfer. It allows peripheral
devices to transfer data directly from and to memory without the
intervention of the CPU. Having peripheral devices access memory
directly would allow the CPU to do other work, which would lead to
improved performance, especially in the cases of large transfers
DIRECT MEMORY ACCESS cont’d
■ In this, the interface transfers data to and from the memory through
memory bus. A DMA controller manages to transfer data between
peripherals and memory unit without the help of the processor.The
DMA controller is a piece of hardware that controls one or more
peripheral devices.
■ Many hardware systems use DMA such as disk drive controllers,
graphic cards, network cards and sound cards etc. It is also used for
intra chip data transfer in multi-core processors. In DMA, CPU has line
connecting to I/O module. Line is used to exchange control signal,
status signal and data between the I/O module and the I/O devices
When CPU needs to read or write data, it issues command to the
DMA module, by sending to the DMA module following information:
■ Whether a read and write is requested, using read, or write control line
between the CPU and DMA module.
■ The address of I/O module involved, communicated on the data line.
■ The starting location is in memory to read from or write to,
communicated on the lines and stored by the DMA module in its address
registers.
■ The number of words to be read or written, again communicated via the
data lines and stored in the data count register. The CPU then continues
with other work.
The processor then continues with other work. It has delegated this I/O
operation to the DMA module. The DMA module transfers the entire block of
data, one word at a time, directly to or from memory, without going through
the processor.
In summary
■ CPU tells DMA controller:-
– Read/Write
– Device address
– Starting address of memory block for data
– Amount of data to be transferred
■ CPU carries on with other work
■ DMA controller deals with transfer
■ DMA controller sends interrupt when finished
DMA Data Transfer Modes
There are three typed of data transfer modes and they are as follows:
■ Burst/Block Transfer Mode – In burst mode, the DMA controller keeps
control of the bus until all the data has been transferred to (from) memory
from (to) the peripheral device. This mode of transfer is needed for fast
devices where data transfer cannot be stopped until the entire transfer is
done. While data is transferring CPU does some internal operation that does
not require system bus interaction.
■ Cycle Stealing – In this case instead of transferring entire block of data, it
transfers only word by word.The DMA controller relinquishes the bus after
each transfer of one data word. This minimizes the amount of time that the
DMA controller keeps the CPU from controlling the bus, but it requires that
the bus request/acknowledge sequence be performed for every single
transfer. Cycle is stole only when CPU is using some work that does not
require system bus.
■ Interleaved – Interleaved is same as block transfer mode, only difference is
it takes control of system bus, when CPU is not using it.
DMA Configuration
■ There are two types of configuration and they are as follows:
■ Single bus configuration: In first type, it allows DMA, I/O and all
types of modules to share the same system bus
DMA Configuration