0% found this document useful (0 votes)
9 views11 pages

Understanding Peripheral Devices and I/O

The document discusses peripheral devices, which enhance a computer's functionality by providing input, output, and storage capabilities. It explains the I/O interface, types of ports, interrupts, and modes of data transfer, including programmed I/O, interrupt-driven I/O, and direct memory access (DMA). Additionally, it covers serial communication methods, including synchronous and asynchronous communication, highlighting their characteristics and applications.

Uploaded by

gyanduttmishra06
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views11 pages

Understanding Peripheral Devices and I/O

The document discusses peripheral devices, which enhance a computer's functionality by providing input, output, and storage capabilities. It explains the I/O interface, types of ports, interrupts, and modes of data transfer, including programmed I/O, interrupt-driven I/O, and direct memory access (DMA). Additionally, it covers serial communication methods, including synchronous and asynchronous communication, highlighting their characteristics and applications.

Uploaded by

gyanduttmishra06
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNIT – V

INPUT / OUTPUT
Peripheral Devices
A Peripheral Device is defined as the device which provides input/output functions for a computer
and serves as an auxiliary computer device without computing-intensive functionality.
Generally peripheral devices, however, are not essential for the computer to perform its basic tasks,
they can be thought of as an enhancement to the user’s experience. A peripheral device is a device
that is connected to a computer system but is not part of the core computer system architecture.
Generally, more people use the term peripheral more loosely to refer to a device external to the
computer case
1. Input Devices: The input devices are defined as it converts incoming data and instructions into a
pattern of electrical signals in binary code that are comprehensible to a digital computer
Example: Keyboard, mouse, scanner, microphone etc.
2. Output Devices: An output device is generally reverse of the input process and generally
translating the digitized signals into a form intelligible to the user. The output device is also performed
for sending data from one computer system to another. For some time punched-card and paper-tape
readers were extensively used for input, but these have now been supplanted by more efficient
devices. Example: Monitors, headphones, printers etc.
3. Storage Devices: Storage devices are used to store data in the system which is required for
performing any operation in the system. The storage device is one of the most requirement devices
and also provide better compatibility. Example: Hard disk, magnetic tape, Flash memory etc.

Advantage of Peripherals Devices:


• It is helpful for taking input very easily.
• It is also provided a specific output.
• It has a storage device for storing information or data
• It also improves the efficiency of the system.

I/O Interface
The I/O interface supports a method by which data is transferred between internal storage and
external I/O devices. All the peripherals connected to a computer require special communication
connections for interfacing them with the CPU.
I/O Bus and Interface Modules: The I/O bus is the route used for peripheral devices to interact with the
computer processor. A typical connection of the I/O bus to I/O devices is shown in the figure.
The I/O bus includes data lines, address lines, and control lines. In any general-purpose computer, the
magnetic disk, printer, and keyboard, and display terminal are commonly employed. Each peripheral
unit has an interface unit associated with it. Each interface decodes the control and address received
from the I/O bus.
It can describe the address and control received from the peripheral and supports signals for the
peripheral controller. It also conducts the transfer of information between peripheral and processor
and also integrates the data flow.
The I/O bus is linked to all peripheral interfaces from the processor. The processor locates a device
address on the address line to interact with a specific device. Each interface contains an address
decoder attached to the I/O bus that monitors the address lines.
When the address is recognized by the interface, it activates the direction between the bus lines and
the device that it controls. The interface disables the peripherals whose address does not equivalent
to the address in the bus.

An interface receives any of the following four commands –


• Control − A command control is given to activate the peripheral and to inform its next task. This
control command depends on the peripheral, and each peripheral receives its sequence of control
commands, depending on its mode of operation.
• Status − A status command can test multiple test conditions in the interface and the peripheral.
• Data Output − A data output command creates the interface counter to the command by sending
data from the bus to one of its registers.
• Data Input − The data input command is opposite to the data output command. In data input, the
interface gets an element of data from the peripheral and places it in its buffer register.

Input Output Ports


Ports The connection point acts as an interface between the computer and external devices like
printers, modems, etc.

There are two types of ports:


1. Internal Port: It connects the system’s motherboard to internal devices like hard disk, CD drive,
internal Bluetooth, etc.
2. External Port: It connects the system’s motherboard to external devices like a mouse, printer, USB,
etc.
Some important types of ports are as per follows:
1. Serial Port:
• Used for external modems and older computer mouse
• Two versions-9pin,25pin
• Data travels at 115 kilobits per second
2. Parallel Port:
• Used for scanners and printers
• 25 pin model
3. Universal Serial Bus (or USB) Port:
• It can connect all kinds of external USB devices such as external hard disks, printers, scanners,
mouse, keyboards, etc.
• Data travels at 12 megabits per second.
4. Firewire Port:
• Transfers large amounts of data at a very fast speed.
• Connects camcorders and video equipment to the computer.
• Data travels at 400 to 800 megabits per second.
5. Ethernet Port:
• Connects to a network and high-speed Internet.
• Data travels at 10 megabits to 1000 megabits per second depending upon the network bandwidth.
Interrupts
An interrupt in computer architecture is a signal that requests the processor to suspend its current
execution and service the occurred interrupt. To service the interrupt the processor executes the
corresponding interrupt service routine (ISR). After the execution of the interrupt service routine, the
processor resumes the execution of the suspended program. Interrupts can be of two types of
hardware interrupts and software interrupts.

Types of Interrupts
The interrupts can be various type but they are basically classified into hardware interrupts and
software interrupts.
1. Hardware Interrupts
If a processor receives the interrupt request from an external I/O device it is termed as a hardware
interrupt. Hardware interrupts are further divided into maskable and non-maskable interrupt.
• Maskable Interrupt: The hardware interrupt that can be ignored or delayed for some time if the
processor is executing a program with higher priority are termed as maskable interrupts.
• Non-Maskable Interrupt: The hardware interrupts that can neither be ignored nor delayed and must
immediately be serviced by the processor are termed as non-maskable interrupts.

2. Software Interrupts
The software interrupts are the interrupts that occur when a condition is met or a system call occurs
Interrupt Cycle
A normal instruction cycle starts with the instruction fetch and execute. But, to accommodate the
occurrence of the interrupts while normal processing of the instructions, the interrupt cycle is added
to the normal instruction cycle as shown in the figure below.
After the execution of the current instruction, the processor verifies the interrupt signal to check
whether any interrupt is pending. If no interrupt is pending then the processor proceeds to fetch the
next instruction in the sequence.
If the processor finds the pending interrupts, it suspends the execution of the current program by
saving the address of the next instruction that has to be executed and it updates the program counter
with the starting address of the interrupt service routine to service the occurred interrupt.

Mode of Data Transfer


1. Programmed I/Ο
2. Interrupt- initiated I/Ο
3. Direct memory access (DMA)

Programmed I/Ο
It is due to the result of the I/Ο 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.
Example of Programmed I/Ο
• In Programmed Input Output mode of data transfer the I/Ο dеvicе dοеs nοt have direct access to the
memory unit.
• A transfer from I/Ο dеvicе to memory requires thе еxеcutiοn οf sеvеral instructiοns by thе CPU,
including an input instruction to transfer thе data frοm dеvicе tο thе CPU and stοrе instructiοn tο
transfer the data from CPU to memory.
• In prοgrammеd I/Ο, thе CPU stays in thе prοgram lοοp until thе I/Ο unit indicatеs that it is rеady fοr
data transfеr.
• This is a timе cοnsuming prοcеss sincе it nееdlеssly kееps thе CPU busy. This situatiοn can bе
avοidеd by using an intеrrupt facility.

Intеrrupt- initiatеd I/Ο

• Sincе in the Programmed Input Output mode of transfer casе wе saw thе CPU is kеpt busy
unnеcеssarily.
• This situatiοn can vеry wеll bе avοidеd by using an intеrrupt drivеn mеthοd fοr data transfеr.
• By using intеrrupt facility and spеcial cοmmands tο infοrm thе intеrfacе tο issuе an intеrrupt rеquеst
signal whеnеvеr data is availablе frοm any dеvicе.
• In thе mеantimе thе CPU can prοcееd fοr any οthеr prοgram еxеcutiοn.
• Thе intеrfacе mеanwhilе kееps mοnitοring thе dеvicе.
• Whеnеvеr it is dеtеrminеd that thе dеvicе is rеady fοr data transfеr it initiatеs an intеrrupt rеquеst
signal tο thе cοmputеr.

Drawbacks of Programmed Input Output and Interrupt Driven Input-Output


Bοth thе mеthοds prοgrammеd I/Ο and Intеrrupt-drivеn I/Ο rеquirе thе activе intеrvеntiοn οf thе
prοcеssοr tο transfеr data bеtwееn mеmοry and thе I/Ο mοdulе, and any data transfеr must
transvеrsе a path thrοugh thе prοcеssοr.
Dirеct Mеmοry Accеss
• Thе data transfеr bеtwееn a fast stοragе mеdia such as magnеtic disk and mеmοry unit is limitеd by
thе spееd οf thе CPU.
• Thus, wе can allοw thе pеriphеrals dirеctly cοmmunicatе with еach οthеr using thе mеmοry busеs,
rеmοving thе intеrvеntiοn οf thе CPU. This typе οf data transfеr tеchniquе is knοwn as DMA οr dirеct
mеmοry accеss.
• During DMA thе CPU is idlе and it has nο cοntrοl οvеr thе mеmοry busеs.
• Thе DMA cοntrοllеr takеs οvеr thе busеs tο managе thе transfеr dirеctly bеtwееn thе I/Ο dеvicеs
and thе mеmοry unit.
Bus Rеquеst: It is usеd by thе DMA cοntrοllеr tο rеquеst thе CPU tο rеlinquish thе cοntrοl οf thе
busеs.
Bus Grant: It is activatеd by thе CPU tο Infοrm thе еxtеrnal DMA cοntrοllеr that thе busеs arе in high
impеdancе statе and thе rеquеsting DMA can takе cοntrοl οf thе busеs.

I/O channels and processors

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. 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, branching and code
translation. The main memory unit takes the pivotal role. It communicates with processor by the
means of DMA.
The Input Output Processor is a specialized processor which loads and stores data into memory along
with the execution of I/O instructions. It acts as an interface between system and devices. It involves a
sequence of events to executing I/O operations and then store the results into the memory.
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.

I/O Channel is an extension of the DMA concept. It has ability to execute I/O instructions using
special-purpose processor on I/O channel and complete control over I/O operations. Processor does
not execute I/O instructions itself. Processor initiates I/O transfer by instructing the I/O channel to
execute a program in memory.
• Program specifies – Device or devices, Area or areas of memory, Priority, and Error condition
actions
• Types of I/O Channels:

Selector Channel: Selector channel controls multiple high-speed devices. It is dedicated to the
transfer of data with one of the devices. In selector channel, each device is handled by a controller or
I/O module. It controls the I/O controllers shown in the figure.
Multiplexer Channel: Multiplexer channel is a DMA controller that can handle multiple devices at the
same time. It can do block transfers for several devices at once.

Two types of multiplexers are used in this channel:


1. Byte Multiplexer – It is used for low-speed devices. It transmits or accepts characters. Interleaves
bytes from several devices.
2. Block Multiplexer – It accepts or transmits block of characters. Interleaves block of bytes from
several devices. Used for high-speed devices.

Serial Communication
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. 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.
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. 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.

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. 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.

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.
Transmission Mode
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.

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. 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.

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. 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.

One lane bridge can also explain the half-duplex. In a one-lane bridge, the two-way vehicles will
provide the way so that they can cross. At a time, only one end will send, and the other end will only
receive. We can also perform the error correction that means if the information received by the
receiver is corrupted, then it can again request the sender to retransmit that information. Walkie-
talkie is also a classic example of half-duplex. Both ends of walkie talkie contain the speakers. We
can use each handset or walkie talkie to either send the message or receive it, but we cannot do both
things at the same time.
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.
• 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.

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.

You might also like