Yeshwond COA. Assignment
Yeshwond COA. Assignment
Mizan-Tepi university
SCHOOL OF COMPUTING AND INFORMATICS
DEPARTMENT OF SOFTWARE ENGINEERING
ASSIGNMENT OF COMPUTER ORGANIZATION AND ARCHITECTECTURE
Group One
R.no Name ID
1. YESHWOND LISANWORK ……………………………..4719/16
2. MELKAMU BELAYNEH………………………………..4445/16
3. HUSINIYA MOHAMED………………………………...4343/16
4. CHOT TUT……………….…………………………4163/16
5. GATTUOCH KUN…….…………………………...………4282/16
6. NESIREDI JEMAL…………………….………….……..4503/16
7. OLIRA KETAMA…………….………………..…….2586/14
8. LELISE HAYILU………………………………..……4391/16
9. HIWOT LEMA…………………..………………..…..4339/16
10. PATHEL TIAY………………………………….………4524/16
11. SEID YIMAM……………………………………….4579/16
12. ASER MULATU…………………………………….4079/16
Submit to : Mr.Gizachew
Submition date :15/05/2017 E.C
COMPUTER ORGANIZATION AND ARCHITECTURE
Table of contents
CHAPTER 8 ---------------------------------------------------------------------------------------1
INPUT-OUTPUT ORGANIZATION --------------------------------------------------------- 1
Introduction ----------------------------------------------------------------------------------1
8.1.Peripheral Devices: -------------------------------------------------------------------- 1
8.2.Input - Output Interface --------------------------------------------------------------- 2
8.3.Asynchronous Data Transfer --------------------------------------------------------- 4
8.4.Modes of Data Transfer : ------------------------------------------------------------- 8
8.5.Priority Interrupt ----------------------------------------------------------------------11
8.6.Direct Memory Access (DMA): ----------------------------------------------------13
8.7. I/O Controllers ----------------------------------------------------------------------- 16
8.8.Serial Communication --------------------------------------------------------------- 18
Conclusion --------------------------------------------------------------------------------- 21
Reference -----------------------------------------------------------------------------------22
i
COMPUTER ORGANIZATION AND ARCHITECTURE
CHAPTER 8
INPUT-OUTPUT ORGANIZATION
Introduction
Input-Output (I/O) organization within a computer system defines the mechanisms for
communication between the CPU and external devices. This crucial subsystem
encompasses a wide range of components, including peripheral devices (e.g.,
keyboards, monitors), input-output interfaces, and various data transfer modes such as
programmed I/O, interrupt-driven I/O, and Direct Memory Access (DMA).
Asynchronous data transfer allows for flexible data rates, while priority interrupts
ensure timely attention to critical devices. Input-Output Controllers (IOCs) manage
the operation of specific peripherals, and serial communication facilitates data
transmission over a single channel, often used for long-distance connections.
8.1.Peripheral Devices:
The Input / output organization of computer depends upon the size of computer and
the peripherals connected to it. The I/O Subsystem of the computer, provides an
efficient mode of communication between the central system and the outside
environment. The most common input output devices are:
Monitor
Keyboard
Mouse
Printer
Magnetic tapes
The devices that are under the direct control of the computer are said to be connected
online.
1
COMPUTER ORGANIZATION AND ARCHITECTURE
2
COMPUTER ORGANIZATION AND ARCHITECTURE
To communicate with I/O, the processor must communicate with the memory unit.
Like the I/O bus, the memory bus contains data, address and read/write control lines.
There are 3 ways that computer buses can be used to communicate with memory and
I/O:
Use two Separate buses , one for memory and other for I/O.
Use one common bus for both memory and I/O but separate control lines for
each.
Use one common bus for memory and I/O with common control lines.
I/O Processor
In the first method, the computer has independent sets of data, address and control
buses one for accessing memory and other for I/O. This is done in computers that
provides a separate I/O processor (IOP). The purpose of IOP is to provide an
independent pathway for the transfer of information between external device and
internal memory.
3
COMPUTER ORGANIZATION AND ARCHITECTURE
This Scheme is used when speed of I/O devices do not match with microprocessor,
and timing characteristics of I/O devices is not predictable. In this method, process
initiates the device and check its status. As a result, CPU has to wait till I/O device is
ready to transfer data. When device is ready CPU issues instruction for I/O transfer. In
this method two types of techniques are used based on signals before data transfer.
i. Strobe Control
ii. Handshaking
Strobe Signal :
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.
Data Transfer Initiated by Source Unit:
In the block diagram fig. (a), the data bus carries the binary information from source
to 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. The timing diagram fig. (b) the source unit first places the data on
the data bus. The information on the data bus and strobe signal remain in the active
state to allow the destination unit to receive the data.
4
COMPUTER ORGANIZATION AND ARCHITECTURE
5
COMPUTER ORGANIZATION AND ARCHITECTURE
its data valid signal. The data accepted signal is activated by the destination unit after
it accepts the data from the bus. The source unit then disables its data accepted signal
and the system goes into its initial state.
6
COMPUTER ORGANIZATION AND ARCHITECTURE
detected by means of a Timeout mechanism which provides an alarm if the data is not
completed within time.
Asynchronous Serial Transmission:
The transfer of data between two units is serial or parallel. In parallel data
transmission, n bit in the message must be transmitted through n separate conductor
path. In serial transmission, each bit in the message is sent in sequence one at a time.
Parallel transmission is faster but it requires many wires. It is used for short distances
and where speed is important. Serial transmission is slower but is less expensive. In
Asynchronous serial transfer, each bit of message is sent a sequence at a time, and
binary information is transferred only when it is available. When there is no
information to be transferred, line remains idle. In this technique each character
consists of three points :
i. Start Bit- First bit, called start bit is always zero and used to indicate the beginning
character.
ii. Stop Bit- Last bit, called stop bit is always one and used to indicate end of
characters. Stop bit is always in the 1- state and frame the end of the characters to
signify the idle or wait state.
iii. Character Bit- Bits in between the start bit and the stop bit are known as
character bits. The character bits always follow the start bit.
7
COMPUTER ORGANIZATION AND ARCHITECTURE
complete data byte is received it is transferred to receiver register. CPU can select the
receiver register to read the byte through the data bus. Data in the status register is
used for input and output flags.
First In First Out Buffer (FIFO):
A First In First Out (FIFO) Buffer is a memory unit that stores information in such a
manner that the first item is in the item first out. A FIFO buffer comes with separate
input and output terminals. The important feature of this buffer is that it can input data
and output data at two different rates.
When placed between two units, the FIFO can accept data from the source unit at one
rate, rate of transfer and deliver the data to the destination unit at another rate. If the
source is faster than the destination, the FIFO is useful for source data arrive in bursts
that fills out the buffer. FIFO is useful in some applications when data are transferred
asynchronously.
8
COMPUTER ORGANIZATION AND ARCHITECTURE
i. Programmed I/O
ii. Interrupt-Initiated I/O
iii. Direct Memory Access (DMA)
In this mode of data transfer the operations are the results in I/O instructions which is
a part of computer program. Each data transfer is initiated by a instruction in the
program. Normally the transfer is from a CPU register to peripheral device or vice-
versa. Once the data is initiated the CPU starts monitoring the interface to see when
next transfer can made. The instructions of the program keep close tabs on everything
that takes place in the interface unit and the I/O devices.
9
COMPUTER ORGANIZATION AND ARCHITECTURE
10
COMPUTER ORGANIZATION AND ARCHITECTURE
8.5.Priority Interrupt
There are number of IO devices attached to the computer. They are all capable of
generating the interrupt. When the interrupt is generated from 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 and slow devices are given
lower priority. Establishing the priority can be done in two ways:
Using Software :A pooling procedure is used to identify highest priority in
software means.
Using Hardware
Polling Procedure :
There is one common branch address for all interrupts. Branch address contain the
code that polls the interrupt sources in sequence. The highest priority is tested
first.The particular service routine of the highest priority device is served. The
disadvantage is that time required to poll them can exceed the time to serve them in
large number of IO devices.
Using Hardware:
11
COMPUTER ORGANIZATION AND ARCHITECTURE
Device with highest priority is placed first. Device that wants the attention send the
interrupt request to the CPU. CPU then sends the INTACK signal which is applied to
PI(priority in) of the first device. If it had requested the attention, it place its
VAD(vector address) on the bus. And it block the signal by placing 0 in PO(priority
out) If not it pass the signal to next device through PO(priority out) by placing 1. This
process is continued until appropriate device is found. The device whose PI is 1 and
PO is 0 is the device that send the interrupt request.
It consist of interrupt register whose bits are set separately by the interrupting devices.
Priority is established according to the position of the bits in the register. Mask
register is used to provide facility for the higher priority devices to interrupt when
lower priority device is being serviced or disable all lower priority devices when
higher is being serviced. Corresponding interrupt bit and mask bit are AND and
applied to priority encoder. Priority encoder generates two bits of vector address.
Another output from it sets IST(interrupt status flip flop).
12
COMPUTER ORGANIZATION AND ARCHITECTURE
13
COMPUTER ORGANIZATION AND ARCHITECTURE
memory buses directly would improve the speed of transfer. This transfer technique is
called Direct Memory Access (DMA). During the DMA transfer, the CPU is idle and
has no control of the memory buses. A DMA Controller takes over the buses to
manage the transfer directly between the I/O device and memory. The CPU may be
placed in an idle state in a variety of ways. One common method extensively used in
microprocessor is to disable the buses through special control signals such as:
Bus Request (BR)
Bus Grant (BG)
These two control signals in the CPU that facilitates the DMA transfer. The Bus
Request (BR) input is used by the DMA controller to request the CPU. When this
input is active, the CPU terminates the execution of the current instruction and places
the address bus, data bus and read write lines into a high Impedance state. High
Impedance state means that the output is disconnected.
The CPU activates the Bus Grant (BG) output to inform the external DMA that the
Bus Request (BR) can now take control of the buses to conduct memory transfer
without processor. When the DMA terminates the transfer, it disables the Bus Request
(BR) line. The CPU disables the Bus Grant (BG), takes control of the buses and return
to its normal operation. The transfer can be made in several ways that are:
i) DMA Burst :- In DMA Burst transfer, a block sequence consisting of a number of
Me mory words is transferred in continuous burst while the DMA controller is master
of the memory buses.
ii) Cycle Stealing :- Cycle stealing allows the DMA controller to transfer one data
word at a time, after which it must returns control of the buses to the CPU.
DMA Controller: The DMA controller needs the usual circuits of an interface to
communicate with the CPU and I/O device. The DMA controller has three registers:
i. Address Register :- Address Register contains an address to specify the desired
14
COMPUTER ORGANIZATION AND ARCHITECTURE
location in memory.
ii. Word Count Register :- WC holds the number of words to be transferred. The
register is incre/decre by one after each word transfer and internally tested for zero.
iii. Control Register :- Control Register specifies the mode of transfer.The unit
communicates with the CPU via the data bus and control lines. The registers in the
DMA are selected by the CPU through the address bus by enabling the DS (DMA
select) and RS (Register select) inputs. The RD (read) and WR (write) inputs are
bidirectional. When the BG (Bus Grant) input is 0, the CPU can communicate with
the DMA registers through the data bus to read from or write to the DMA registers.
When BG =1, the DMA can communicate directly with the memory by specifying an
address in the address bus and activating the RD or WR control.
DMA Transfer:
The CPU communicates with the DMA through the address and data buses as with
any interface unit. The DMA has its own address, which activates the DS and RS
lines. The CPU initializes the DMA through the data bus. Once the DMA receives the
start control command, it can transfer between the peripheral and the memory.
When BG = 0 the RD and WR are input lines allowing the CPU to communicate with
the internal DMA registers. When BG=1, the RD and WR are output lines from the
DMA controller to the random access memory to specify the read or write operation
of data.
15
COMPUTER ORGANIZATION AND ARCHITECTURE
The devices operate at wide-ranging data transfer speed and also many different
interface standards. The Keyboard, Mouse have very small data rates and are
asynchronous in data transfer to computer. Disk, Solid State Disks have high data
rates. USB has a mediocre data rate. And we know each one has a different
connector and interface standard.
It is overloading on the part of CPU to deal with these devices directly. I/O
controllers play a bridging role between CPU, Memory and I/O Device by taking
care of all kinds of communication.
Due to heterogeneity of the devices, each device /type of interface requires an I/O
Controller (Refer figure 20.1)
I/O controllers also act as a buffer during data transfer
To do the above, each IO Controller will typically have Data Register(s), Status
Register(s), Control Register(s), Address decoding logic and Control Circuitry as in
figure 20.2. The I/O Controller is connected to the system bus. Whenever the I/O
controller wants to use the bus, it has to contend and obtain. All communication from
the CPU and Memory happens via these registers shown in the diagram. These
registers are given a unique address for each I/O controller.
16
COMPUTER ORGANIZATION AND ARCHITECTURE
The address decoding logic is connected to the address bus. The value on the address
bus indicates the register to be accessed. The decoding logic converts this as an
address selection signal to one of these registers.
The control circuitry is connected to the control signals of the system bus. These
signals are MEMW, MEMR, IOR, IOW, INTERRUPT, BREQ, etc. These signals
ensure the synchronization and validation of address and Data on the bus, demanding
the Bus for data transfer, sending interrupt after the normal or abnormal end operation.
The Data Registers take care of Data Transfer. There may be Data In and/or Data
Out Registers depending on the device. Also, fast devices like Disk will have a Buffer
so that the fast bulk data from the disk is stored and then sent to Memory when the
system bus is available.
Printer Commands – Form Feed for a new page, Print, Line Feed, status
check, etc.
Disk – Seek, Write, Read, Reset, status check
17
COMPUTER ORGANIZATION AND ARCHITECTURE
The status of the data transfer on the device side is stored as a flag in the Status
Register.
18
COMPUTER ORGANIZATION AND ARCHITECTURE
Transmission Methods:
Error Detection
19
COMPUTER ORGANIZATION AND ARCHITECTURE
LRC checks are calculated at the end of a block, and the receiving
station compares it with the transmitted LRC.
Transmission Modes:
20
COMPUTER ORGANIZATION AND ARCHITECTURE
Conclusion
Input-Output (I/O) organization facilitates communication between the CPU and
peripheral devices, involving hardware and software components. Key aspects include:
peripheral devices for input/output; interfaces for data translation; asynchronous data
transfer for concurrent CPU operation; various transfer modes like programmed I/O,
interrupt-driven I/O, and DMA for efficient data movement; priority interrupts for
timely handling of critical events; DMA for offloading CPU during data transfers;
Input-Output Controllers (IOCs) for simplified I/O management; and serial
communication for transmitting data bit-by-bit. Effective I/O organization is crucial
for maximizing system performance and responsiveness.
21
COMPUTER ORGANIZATION AND ARCHITECTURE
Reference
1. COMPUTER SYSTEM ARCHITECTURE, MORRIS M. MANO, 3RD EDITION,
PRENTICE HALL INDIA.
2. HTTP://NPTEL.AC.IN/COURSES
3. Geeks for geeks tutorial: https://www.geeksforgeeks.org/io-interface-interrupt-
dma-mode/
4. M. Mano & W. Stallings: https://jagdishkapadnis.wordpress.com/wp-
content/uploads/2018/08/chapter7-input-output-organization.pdf
22