Lecture 2.3.3 (Modes of Transfer-Programmed IO)
Lecture 2.3.3 (Modes of Transfer-Programmed IO)
ASSISTANT PROFESSOR
BE-CSE
INPUT-OUTPUT INTERFACE
The method that is used to transfer information between internal storage and
external I/O devices is known as I/O interface.
The CPU is interfaced using special communication links by the peripherals
connected to any computer system. These communication links are used to
resolve the differences between CPU and peripheral.
There exist special hardware components between CPU and peripherals to
supervise and synchronize all the input and output transfers that are called
interface units.
Modes of Transfer
The binary information that is received from an external device is usually stored
in the memory unit. The information that is transferred from the CPU to the
external device is originated from the memory unit. CPU merely processes the
information but the source and target are always the memory unit. Data transfer
between CPU and the I/O devices may be done in different modes.
Data transfer to and from the peripherals may be done in any of the three
possible ways
1.Programmed I/O
2.Interrupt-initiated I/O
3.Direct memory access (DMA)
1. Programmed I/O
It is one of the simplest forms of I/O where the CPU has to do all the work. It
is due to the result of the I/O instructions that are written in the computer
program. Each data item transfer is initiated by an instruction in the program.
Usually, the transfer is from a CPU register and memory. In this case it
requires constant monitoring by the CPU of the peripheral devices. This
technique is called Programmed I/O.
2.The program waits for the ready status by repeatedly testing the status
bit(s) and till all the targeted bytes are written to the device.
3.The program in busy (non-waiting) state only after the device gets ready
else wait state.
I/O Commands
Control: Used to activate a peripheral and tell it what to do. For example, a
magnetic- tape unit may be instructed to rewind or to move forward one record.
These commands are tailored to the particular type of peripheral device.
Test: Used to test various status conditions associated with an I/O module
and its peripherals. The processor will want to know that the peripheral of
interest is powered on and available for use. It will also want to know if the
most recent I/O operation is completed and if any errors occurred.
Read: Causes the I/O module to obtain an item of data from the peripheral and
place it in an internal buffer. The processor can then obtain the data item by
requesting that the I/O module place it on the data bus.
Write: Causes the I/O module to take an item of data (byte or word) from the
data bus and subsequently transmit that data item to the peripheral.
I/O Instruction
With memory mapped I/O, there is a single address space for memory
locations and I/O devices and the processor treats the status and data
registers of I/O modules as memory locations and uses the same machine
instructions to access both memory and I/O devices. So, for example, with 10
address lines, a combined total of = 1024 memory locations and I/O addresses
can be supported, in any combination. With memory-mapped I/O, a single read
line and a single write line are needed on the bus.
With isolated I/O, the bus may be equipped with memory read and write plus
input and output command lines. Now, the command line specifies whether
the address refers to a memory location or an I/O device. The full range of
addresses may be available for both. Again, with 10 address lines, the system
may now support both 1024 memory locations and 1024 I/O addresses.
Simple to implement
Very little hardware support
Reference Books:
J.P. Hayes, “Computer Architecture and Organization”,
Third Edition.
Mano, M., “Computer System Architecture”, Third
Edition, Prentice Hall.
Stallings, W., “Computer Organization and Architecture”, Eighth
Edition, Pearson Education.
Text Books:
Carpinelli J.D,” Computer systems organization &Architecture”, Fourth
Edition, Addison Wesley.
Patterson and Hennessy, “Computer Architecture”, Fifth Edition Morgaon
Kauffman.
Other References