You are on page 1of 67

Input-Output Organization

Computer Architecture and Organization (SEng2031)


GROUP 4
NAME ID

1. Thitna Endale 3080/14

2. Gebreslassie Dessie 1440/14

3. Firomsa Dine 1386/14

4. Nyok Biliu 3678/14

Instructor:
1
MR.Melkamu D
Content

• Priority interrupts
• Direct Memory Access (DMA)
• Input-Output processor(IOC)
• Serial communication

22
INTRODUCTION
Input-Output Interface
• In computer system, there are special hardware
components between the CPU and peripherals to control
or manage the input-output transfers. These components
are called input-output interface units because they
provide communication links between processor bus and
peripherals.
• The I/O subsystem of a computer provides an efficient
mode of communication between the central system and
the outside environment. It handles all the input- output
operations of the computer system.
3
Priority interrupts

• Priority interrupt is a system which decides


the priority at which various devices, which
generates the interrupt signal at the same time,
will be serviced by the CPU. The system has
authority to decide which conditions are
allowed to interrupt the CPU, while some other
interrupt is being serviced. Generally, devices
with high speed transfer such as magnetic
disks are given high priority and slow devices
such as keyboards are given low priority.
4
Cont…
When two or more devices interrupt the computer
simultaneously, the computer services the device with the
higher priority first.
Types of Interrupts
Following are some different types of interrupts:

A. Hardware Interrupts
 When the signal for the processor is from an external
device or hardware then this interrupts is known
as hardware interrupt.
5
Cont…

Let us consider an example: when we press any


key on our keyboard to do some action, then this
pressing of the key will generate an interrupt signal
for the processor to perform certain action. Such an
interrupt can be of two types:
i. Maskable Interrupt
The hardware interrupts which can be delayed
when a much high priority interrupt has occurred at
the same time.

6
Cont…

ii. Non Maskable Interrupt


The hardware interrupts which cannot be delayed
and should be processed by the processor
immediately.
B . Software Interrupts
The interrupt that is caused by any internal system
of the computer system is known as a software
interrupt. It can also be of two types:

7
Cont…

i. Normal Interrupt
The interrupts that are caused by software
instructions are called normal software interrupts.
ii. Exception
Unplanned interrupts which are produced during
the execution of some program are
called exceptions, such as division by zero.

8
Cont…

C .Daisy Chaining Priority


This way of deciding the interrupt priority consists
of serial connection of all the devices which
generates an interrupt signal. The device with the
highest priority is placed at the first position
followed by lower priority devices and the device
which has lowest priority among all is placed at
the last in the chain.

9
Cont…
 In daisy chaining system all the devices are
connected in a serial form. The interrupt line request
is common to all devices. If any device has interrupt
signal in low level state then interrupt line goes to
low level state and enables the interrupt input in the
CPU. When there is no interrupt the interrupt line
stays in high level state. The CPU respond to the
interrupt by enabling the interrupt acknowledge line.
This signal is received by the device 1 at its PI input.
The acknowledge signal passes to next device
through PO output only if device 1 is not requesting
an interrupt.
10
Cont…

The following figure shows the block diagram for


daisy chaining priority system.

11
Cont…

 There is an interrupt request line which is


common to all the devices and goes into the CPU.
 When no interrupts are pending, the line is in
HIGH state. But if any of the devices raises an
interrupt, it places the interrupt request line in the
LOW state.
 The CPU acknowledges this interrupt request
from the line and then enables the interrupt
acknowledge line in response to the request.
12
Cont…

This signal is received at the PI(Priority in) input of


device 1.
If the device has not requested the interrupt, it passes
this signal to the next device through its PO(priority out)
output. (PI = 1 & PO = 1)
However, if the device had requested the interrupt, (PI
=1 & PO = 0)
If a device gets 0 at its PI input, it generates 0 at the PO
output to tell other devices that acknowledge signal has
been blocked. (PI = 0 & PO = 0).
13
Cont…
If a device gets 0 at its PI input, it generates 0 at the PO
output to tell other devices that acknowledge signal has
been blocked. (PI = 0 & PO = 0).
Hence, the device having PI = 1 and PO = 0 is the highest
priority device that is requesting an interrupt. Therefore,
by daisy chain arrangement we have ensured that the
highest priority interrupt gets serviced first and have
established a hierarchy. The farther a device is from the
first device, the lower its priority.

14
Advantages of priority interrupt:

Priority interrupts allow for the efficient handling of high-


priority tasks that require immediate attention. This is
especially important in real-time systems where certain
tasks must be completed within strict time constraints.
They are more efficient than software polling as the
processor does not waste time constantly checking for
events that have not occurred.
Priority interrupts are also more deterministic, as the
response time to an event can be accurately predicted
based on its priority level.
15
Disadvantages of priority interrupt:

One potential disadvantage of priority interrupts is the


possibility of lower priority tasks being starved of
resources if high-priority tasks are continuously
interrupting the processor.
If not implemented properly, priority interrupts can lead
to priority inversion, where a low-priority task holds a
resource required by a higher-priority task, causing a
delay in the high-priority task’s execution.

16
Advantages Software pulling:

 Software polling is relatively simple to implement and


does not require specialized hardware.
 It can be used to detect events that occur at irregular
intervals, as the processor can check for events whenever
it is not performing other tasks

17
Disadvantages Software pulling:

Software polling is less efficient than priority interrupts as


the processor must constantly check for events even if
none have occurred.
In real-time systems, software polling may not be suitable
as it is difficult to guarantee the response time to an event,
especially if the processor is busy with other tasks.

18
Advantages Daisy chaining:

 Daisy chaining allows multiple devices to share a single


interrupt line, reducing the number of interrupt lines
required.
 It is relatively simple to implement and does not require
specialized hardware.

19
Disadvantages Daisy chaining:
 Daisy chaining can result in increased response time as
each device must wait for the previous device to
complete its interrupt handling before it can start its
own.
 It can also be difficult to implement and troubleshoot,
especially if there are multiple devices on the same
interrupt line.

20
Direct Memory Access

Direct memory access (DMA) is a method that allows an


input/output (I/O) device to send or receive data directly
to or from the main memory, bypassing the CPU to
speed up memory operations.
 The process is managed by a chip known as a DMA
controller (DMAC). In older computers, four DMA
channels were numbered 0, 1, 2 and3.When the16-bit
industry standard architecture (ISA) expansion bus was
introduced, channels 5, 6 and 7 were added.

21
Cont…
 ISA was a computer bus standard for IBM compatible
computers, allowing a device to initiate transactions
(bus mastering) at a quicker speed. ISA has since been
replaced by accelerated graphics port (AGP) and
peripheral component interconnect (PCI) expansion
cards, which are much faster.
Each DMA transfers approximately 2 MB of data per
second. A computer's system resource tools are used for
communication between hardware and software. The
four types of system resources are:
22
Cont…

•I/O addresses
•Memory addresses
•Interrupt request numbers (IRQ)
•Direct memory access (DMA) channels slow devices like
keyboards will generate an interrupt to the main CPU after
each byte is transferred.
If a fast device such as a disk generated an interrupt for
each byte, the operating system would spend most of its
time handling these interrupts. So a typical computer uses
direct memory access (DMA) hardware to reduce this
overhead. 23
Cont…

Direct Memory Access (DMA) means CPU grants I/O


module authority to read from or write to memory
without involvement.
• DMA module itself controls exchange of data between
main memory and the I/O device. CPU is only
involved at the beginning and end of the transfer and
interrupted only after entire block has been transferred.
• Direct Memory Access needs a special hardware called
DMA controller (DMAC) that manages the data
transfers and arbitrates access to the system bus.
24
Cont…
• The controllers are programmed with source and
destination pointers (where to read/write the data),
counters to track the number of transferred bytes, and
settings, which includes I/O and memory types, interrupts
and states for the CPU cycles.
• DMA channels are used to communicate data between
the peripheral device and the system memory.
• All four system resources rely on certain lines on a bus.
Some lines on the bus are used for IRQs, some for
addresses (the I/O addresses and the memory address) and
some for DMA channels.
25
Cont…

A DMA channel enables a device to transfer data without


exposing the CPU to a work overload. Without the DMA
channels, the CPU copies every piece of data using a
peripheral bus from the I/O device.
Using a peripheral bus occupies the CPU during the
read/write process and does not allow other work to be
performed until the operation is completed. With DMA,
the CPU can process other tasks while data transfer is
being performed.

26
Cont…
The transfer of data is first initiated by the CPU. During
the transfer of data between the DMA channel and I/O
device, the CPU performs other tasks. When the data
transfer is complete, the CPU receives an interrupt request
from the DMA controller.
In the Direct Memory Access (DMA) the interface
transfer the data into and out of the memory unit through
the memory bus.
The transfer of data between a fast storage device such as
magnetic disk and memory is often limited by the speed of
the CPU.
27
Cont…

Removing the CPU from the path and letting the


peripheral device manage the 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.

28
Cont…

29
Types of Device DMA

Devices perform one of the following three types of DMA.


 Bus-Master DMA
 Third-party DMA
 First-party DMA
Bus-Master DMA
• If the device is capable of acting as a true bus
master (where the DMA engine resides on the device
board), the driver should program the device's DMA
registers directly. The transfer address and count are
obtained from the DMA cookie and given to the device.
30
Cont…

31
Cont…
Third-party DMA
Third-party DMA utilizes a system DMA engine
resident on the main system board, which has several
DMA channels available for use by devices. The device
relies on the system's DMA engine to perform the data
transfers between the device and memory. The driver
uses DMA engine routines to initialize and program the
DMA engine. For each DMA data transfer, the driver
programs the DMA engine and then gives the device a
command to initiate the transfer in cooperation with that
engine.
32
Cont…

First-party DMA
Under first-party DMA, the device drives its own DMA
bus cycles using a channel from the system's DMA
engine. The function is used to configure this channel in
a cascade mode so that the DMA engine will not
interfere with the transfer.

33
Advantages of Direct Memory Access
( DMA):

1. Improved Performance: DMA enables faster data


transfer between peripheral devices and memory, freeing
up the CPU to perform other operations. This results in
significant performance improvements.
2. Reduced CPU Overhead: With DMA, the CPU doesn't
have to transfer data between the devices and memory,
which means it can focus on executing instructions and
processing data.
34
Cont…
3. Improved Data Integrity: DMA transfers data between
devices and memory in a more efficient, controlled, and
reliable way than CPU operations. As a result, DMA reduces
the likelihood of data loss or corruption during transfer.
4. Reduction in Power Consumption: By offloading the data
transfer tasks from the CPU to DMA, the power
consumption of the CPU is reduced.
5. Increased Flexibility: DMA can be used to transfer data
between a variety of devices, including disk drives, network
interface cards, graphics cards, and sound cards, which
makes it a versatile technology.
35
Cont…

6. Scalability: DMA can be used to transfer large amounts


of data quickly and efficiently. This makes it a highly
scalable technology that can be used in a wide range of
applications, from personal computers to large-scale
servers.
In summary, DMA provides a variety of benefits that
improve the performance, reliability, and efficiency of
data transfer between devices and memory.

36
Disadvantages of Direct Access Memory (DMA) :

1. Security Concerns: DMA transfers data directly to


memory, bypassing the CPU's memory management
unit. This raises concerns about security, as malicious
peripheral devices could use DMA to access protected
areas of the memory and steal sensitive information.
2. Complexity: DMA requires more complex hardware
and software designs than traditional memory access
mechanisms, which can increase system cost and
complexity.

37
Cont…
3. Compatibility Issues: Not all systems or devices
support DMA, which can lead to compatibility issues
when using older devices or software with newer
machines.
4. Limited Memory Access: DMA transfers are typically
limited to a specific range of memory addresses, which
can limit the amount of memory that can be accessed by
peripheral devices.
5. Resource Contention: DMA can potentially compete
with the CPU for access to system resources, which can
cause system slowdowns or stability issues.
38
Cont…

6. Debugging Complexity: Debugging DMA-related issues


can be more complex than traditional memory access
issues, as it requires specialized knowledge of DMA
transfer operations.
In summary, DMA provides many advantages for data
transfers between peripherals and memory, but it also has
some drawbacks, mostly surrounding security,
complexity, compatibility, and resource contention.

39
Input-Output Processor
An input-output processor (IOP) is a processor with
direct memory access capability. In this, the computer
system is divided into a memory unit and number of
processors.
Each IOP controls and manage the input-output tasks.
The IOP is similar to CPU except that it handles only
the details of I/O processing. The IOP can fetch and
execute its own instructions. These IOP instructions are
designed to manage I/O transfers only.

40
Cont…

41
Cont…

 The DMA mode of data transfer reduces CPU’s


overhead in handling I/O operations. It also allows
parallelism in CPU and I/O operations.
 Such parallelism is necessary to avoid wastage of
valuable CPU time while handling I/O devices whose
speeds are much slower as compared to CPU.
 The concept of DMA operation can be extended to
relieve the CPU further from getting involved with the
execution of I/O operations.
42
Cont…
This gives rises to the development of special purpose
processor called Input-Output Processor (IOP) or IO
channel.
The Input Output Processor (IOP) is just like a CPU that
handles the details of I/O operations. It is more equipped
with facilities than those are available in typical DMA
controller.
The IOP can fetch and execute its own instructions that
are specifically designed to characterize I/O transfers. In
addition to the I/O-related tasks, it can perform other
processing tasks like arithmetic, logic, and branching and
code translation. The main memory unit takes the pivotal
43
role.
Cont…
It communicates with processor by the means of DMA.
The block diagram – The Input Output Processor is a
specialized processor which loads and stores data into
memory along with the execution of I/O instructions.
It act as an interface between system and devices. It
involves a sequence of events to executing I/O operations
and then stores the results into the memory.

44
Advantages

• The I/O devices can directly access the main memory


without the intervention by the processor in I/O
processor based systems.
• It is used to address the problems that are arises in
Direct memory access method.
The input-output (I/O) process is an essential aspect of
computing that refers to the interaction between a
computer's central processing unit (CPU) and external
devices or data sources. There are several advantages to
this process, including:

45
Cont…
1. Efficiency: The I/O process allows for efficient use of
system resources. By moving data between external
devices and the CPU, the system can free up resources
for other tasks.
2. Flexibility: The I/O process enables the computer
system to interact with a wide range of devices and data
sources. This means that the system can be used in
diverse environments, such as industrial control
systems, scientific research, or consumer applications.

46
Cont…

3. Scalability: The I/O process can be scaled to meet the


needs of a particular application or system. This means that
the system can handle larger amounts of data or higher
levels of complexity, depending on the demands of the task
at hand.
4. Fault-tolerance: The I/O process can enhance system
reliability by incorporating redundancy or redundancy
checks. This means that the system can detect and recover
from errors or failures in external devices or data sources.

47
Cont…

5. User interaction: The I/O process enables users to


interact with the system through input devices, such as
keyboards, mice, or touchscreens, and output devices,
such as displays, speakers, or printers. This allows the
user to communicate with the system and receive
feedback.

48
Serial Communication in Computer
organization
 Serial communication is the process of
sequentially transferring the information/bits on
the same channel. Due to this, the cost of wire
will be reduced, but it slows the transmission
speed. Generally, communication can be
described as the process of interchanging
information between individuals in the form of
audio, video, verbal words, and written
documents.

49
Cont…
The serial protocol is run on every device that can be our
mobile, personal computers, and many more with the
help of following some protocols. The protocol is a type
of reliable and secure form of communication that
contains a set of rules addressed with the help of a source
host and a destination host.
In serial communication, binary pulses are used to show
the data. Binary contains the two numbers 0 and 1.0 is
used to show the LOW or 0 Volts, and 1 is used to show
the HIGH or 5 Volts. The serial communication can
either be asynchronous or synchronous.
50
Cont…

51
Synchronous Communication
 In synchronous communication, the frames or data
will be constructed with the help of combining the
groups of bits. That frames will be continuously sent
in time with a master clock. It uses a synchronized
clock frequency to operate the data of sender or
receiver.
 In synchronous communication, there is no need to
use the gaps, start bits and stop bits. The time taken
by the sender and receiver is synced that's why the
frequency of timing error will be less, and the data
will move faster.
52
Cont…
 On the basis of the timing being synced correctly
between the sender and receiver devices, the data
accuracy is totally dependent.
 The synchronous serial transmission is more expensive
as compared to asynchronous serial transmission.

53
Cont…

54
Asynchronous Communication

 In asynchronous communication, the groups of bits


will be treated as an independent unit, and these data
bits will be sent at any point in time. In order to make
synchronization between sender and receiver, the stop
bits and start bits are used between the data bytes.
These bits are useful to ensure that the data is
correctly sent. The time taken by data bits of sender
and receiver is not constant, and the time between
transmissions will be provided by the gaps.
.

55
Cont…
 In asynchronous communication, we don't require
synchronization between the sender and receiver
devices, which is the main advantage of asynchronous
communication. This method is also cost-effective. In
this method, there can be a case when data transmission
is slow, but it is not compulsory, and it is the main
disadvantage of the asynchronous method.

56
Cont…

 On the basis of the data transfer rate and the


type of transmission mode, serial
communication will take many forms. The
transmission mode can be classified into
simplex, half-duplex, and full-duplex. Each
transmission mode contains the source, also
known as sender or transmitter, and destination,
also known as the receiver.

57
Transmission Mode
 The transmission modes are described as follows:
Simplex
 In the simplex method, the data transmission can be
performed only in one direction. At a time, only one
client (either sender or receiver) can be active. That
means among the two devices, one device can only
transmit a link while the other device can only receive it.
A sender can only transmit the data, and the receiver can
only accept that data. The receiver cannot reply back to
the sender. In another case, if the receiver sends the data,
the sender will only accept it. The sender cannot reply
back to the receiver.
58
Cont…

There are various examples of the simplex.


Example 1: Keyboard and CPU are the best
examples of a simplex. The keyboard always transmits
characters to the CPU (Central processing unit), but the
CPU does not require transmitting characters or data to
the keyboard.
59
Cont…

Example 2: Printers and computers are one more


example of the simplex. Computers always send data to
the printers, but printers are not able to send the data to
the computers. In some cases, printers can also talk
back, and this case is an exception. There is only one
lane in the simplex.
Example 3: One-way road is also an example of the
simplex. The traffic on the one-way road can go only in
one direction, and the vehicles coming from the
opposite directions are not allowed to drive through
that way.
60
Half Duplex

 In the half-duplex, the sender and receiver can


communicate in both directions, but not at the same
time. If a sender sends some data, the receiver is able
to accept it, but at that time, the receiver cannot send
anything to the receiver. Same as if the receiver sends
data to the sender, the sender cannot send. If there is a
case where we don't need to communicate at a time in
both the direction, we can use the half-duplex.

61
Cont…

 For example, the internet is a good example of half-


duplex. With the help of internet, if a user sends a web
page request to the web server, the server processes the
application and sends the requested page to the user.

62
Cont…
Railroads usually contain the scenario of half-duplex
because it is cheaper and has to lay a single track. The
driver of the train has to hold a train at one end of a single
track until the driver of another train, which is travelling
train in another direction, goes through.
The printer is also a good example of half-duplex. In the
IEEE-1284, printers are also able to send messages to the
computer. When the computer is sending characters to the
printer, at that time, the printer is not able to send the
message to the computer. When the computer successfully
sends all the messages and stop sending them after that,
the printer can send a message back to the computer.
63
Full Duplex

 In the full-duplex, the sender and the receiver are able


to send and receive at the same time. The
communication mode of full-duplex is widely used in
the world. In this mode, signals travelling in one
direction are able to share the capacity of links with
signals travelling in the opposite directions. There are
two ways in which sharing can occur, which is
described as follow:
 Either capacity of the link is divided into the signals
going in both directions.
64
Cont…

Or the links have two physically separated


transmission parts. Where one part can be used for
sending, and another part can be used for receiving.
If we need communication in both directions constantly,
in this case, we will use the full-duplex mode. The
capacity of the channel will be split into two directions.

65
Cont…

Examples: Telephone Network is a good example of


full-duplex mode. While using the telephone or phone,
the two persons are able to talk and hear both things at the
same time. The ordinary two-lane highway is helpful to
explain the full-duplex. If traffic is very much, in this
case, the railroad is decided to lay a double tack which is
used to allow trains to pass in both directions. This type
of case is usually used while communicating in
networking. The fiber optic hubs are used to contain two
connectors on each port. The full-duplex fiber is a type of
two cables, which tie together so that they can form two-
lane roadways. 66
67

You might also like