0% found this document useful (0 votes)
24 views74 pages

Unit 5 COA

The document discusses the input-output interface, detailing the methods for transferring information between internal storage and external devices, including various I/O commands and types of ports. It explains modes of data transfer such as programmed I/O, interrupt-initiated I/O, and direct memory access (DMA), along with their advantages and disadvantages. Additionally, it covers the role of DMA controllers, standard communication interfaces, and types of interrupts in managing I/O operations.

Uploaded by

rhythmgoel1610
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)
24 views74 pages

Unit 5 COA

The document discusses the input-output interface, detailing the methods for transferring information between internal storage and external devices, including various I/O commands and types of ports. It explains modes of data transfer such as programmed I/O, interrupt-initiated I/O, and direct memory access (DMA), along with their advantages and disadvantages. Additionally, it covers the role of DMA controllers, standard communication interfaces, and types of interrupts in managing I/O operations.

Uploaded by

rhythmgoel1610
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
You are on page 1/ 74

Input-Output Interface

•Input-output interface provides a method for transferring information between internal


storage and external I/O devices .Peripherals connected to a computer need special
communication links for interfacing them with the central processing unit.

1)•TheDifferent
12/25/2023 mannerare
major differences of: operation 1

2) Data transfer rate


3) Difference in word format
4) Difference in operating modes of peripherals
12/25/2023 2
I/O Commands

➢ There are four types of I/O Commands:


I. Control Command
II. Status Command
III. Data Output Command
12/25/2023 3

IV. Data Input Command


1.CONTROL COMMAND

A control command is used to activate the peripheral and to inform it what to
do. For example-a magnetic tape unit may be instructed to backspace the
tape by one record,to rewind the tape,or to start the tape moving in the
forward direction.


12/25/2023
2.STATUS COMMAND 4

A status command is used to test various status conditions in the interface


and peripheral. For ex-the computer may wish to check the status of the
peripheral before a transfer is initiated .There are many errors which are
designated by setting bits in a status register that the processor can read at
certain intervals.
3.DATA OUTPUT COMMAND

It causes the interface to respond by transferring data feom the bus into one
of its registers. For ex-the computer starts the tape moving by issuing a
control command.The processor then monitors the status of the tape and
when the tape is in correct position ,the processor issues a data output
command.

12/25/2023

4.DATA INPUT COMMAND 5

In this case the interface receives an item of data from peripheral and places
it in its buffer register.The processor checks if data are available by means of
a status command and then issues a data input command.
I/O VERSUS MEMORY BUS
● Like I/O Bus,Memory Bus also contains data,Address and Control lines.
● Three ways to communicate:

(a) Use two separate buses.


(b)Use one common bus but separate control lines.
(c)Use common bus with common control lines.
12/25/2023 6
ISOLATED VERSUS MEMORY-MAPPED
I/O
ISOLATED I/O MEMORY MAPPED I/O

Separate read/write ●
A single set of read/write
control lines. control lines.
● ●
Separate memory and I/O Common address space
address spaces

Distinct Input and Output



No specific input or output
instuctions. instructions.
EXAMPLE OF AN I/O INTERFACE

12/25/2023 8
Input and output ports
What is ports in computer?

• A port is a connection or a jack provided on a computer to


connect external or peripheral devices to the computer.
• it acts as an interface or a point of attachment
between computer and external devices. It is also called a
communication port, as it is the point where you plug in a
peripheral device to allow data transfer or communication
between the device and computer.
Types of ports

• There are two types of I/O ports,


❑ Serial port

❑ Parallel port
Serial port

• A serial ports is an interface through which peripherals can be


connected using a serial protocol which involves the transmission of
data one bit at the time over a single communication line .
• Serial ports transmit data sequentially over a single channel.The
devices like Keyboards and MODEMS are connected through serial
ports.
Parallel ports

• A Parallel ports is an interface through which peripherals


communicates with a computer in parallel manner.
• It's called a parallel port because it transfers multiple bits of data
simultaneously through multiple wires.
Some Examples of ports

❑ VGA port
❑ Digital Video Interface (DVI)
❑ High-Definition Media Interface (HDMI)
❑ USB
INPUT OUTPUT PROCESSOR
I/O processor is
▪ A specialized processor.
▪ Not only loads and stores into memory but also can execute instruction , which are
among a set of I/O instructions.
▪ The IOP interfaces to the system and devices.
▪ I/O devices can directly access the memory without intervention by the processor.
▪ CPU only initiate the I/O program after that IOP operate independent of CPU.
CPU-IOP communication
Communication between IOP and CPU
❑ Whenever CPU gets interrupt from IOP to access memory, it sends test path instruction
to IOP.
❑ IOP executes and check for status, if the status given to CPU is OK, then CPU gives start
instruction to IOP and gives it some control and get back to some another (or same)
program.\
❑ After that IOP is able to access memory for its program.
❑ Now IOP start controlling I/O transfer using DMA and create another status report as
well.
❑ AS soon as this I/O transfer completes IOP once again send interrupt to CPU, CPU again
request for status of IOP, IOP check status word from memory location and gives it to
CPU.
❑ Now CPU check the correctness of status and continues with the same process.
Input Output Channel

A channel is an independent hardware component that co-ordinate all

I/O to a set of controllers.

Channel use separate , independent and low cost processor for its

functioning which are called Channel Processor.

Channel processors are simple , but contains sufficient memory to

handle all I/O tasks.


Characterstic of Input Output Channel
❑ 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.
❑ In a computer system with such devices ,CPU does not execute I/O
instructions itself.
❑ CPU initiates I/O transfer by instructing the I/O channel to execute
a program in memory.
MODES OF TRANSFER
INTRODUCTION,PROGRAMMED I/O
INTRODUCTION TO
MODES OF TRANSFER
• The Way of transfering information from and to internal
and external storage.
• The information that is transferred from the CPU to the
external device is originated from the memory unit.
• Data transfer between CPU and the I/O devices may be
done in different modes.
TYPES OF MODES OF TRANSFER

Data transfer to and from the peripherals may be done in any of the three
possible ways:-

• Programmed I/O
• Interrupt- initiated I/O.
• Direct memory access( DMA).
TYPES OF MODES OF TRANSFER
PROGRAMMED I/O:-
Programmed I/O uses the I/O instructions written in the computer program.
The instructions in the program initiate every data item transfer.
Interrupt- initiated I/O:-
An interrupt I/O is a process of data transfer in which an external device or a
peripheral informs the CPU that it is ready for communication and requests
the attention of the CPU.
Direct memory access( DMA):-
Direct memory access (DMA) is the process of transferring data without the
involvement of the processor itself. It is often used for transferring data
to/from input/output devices. A separate DMA controller is required to handle
PROGRAMMED I/O
• Programmed I/O operation are result of
I/O instructions written in computer
program.
• Each data transfer is initiated by an I/O
instruction in the program (to access
register or memory on a device).
• Transferring data sender program control
required constant monitoring of the I/O
devices by the CPU.
PROCESS OF
PROGRAMMED I/O.
In Programmed I/O, CPU
make a request and then
CPU stays in Program Loop
(polling) until the I/O device
indicates that it is ready for
data transfer.
DATA TRANSFER FROM I/O DEVICE TO
CPU
ADVANTAGES
• Programmed I/O is simple to
implement.
• It requires very little hardware
support.
• CPU checks status bits periodically.
DISADVANTAGES
• The processor has to wait for a long
time for the I/O module to be ready
for either transmission or reception
of data.
• The performance of the entire
system is severely degraded.
Interrupt Initiated I/0

P
MODES OF DATA TRANSFER

Interrupt Initiated Direct Memory


Programmed I/O
I/O Access (DMA)
• Result of an input • Upon the •No unnecessary
and output occurrence of an usage of CPU.
instruction. instruction •I/O Processor
•Need CPU’s •Reduce monitors the data
continuous unnecessary transfer.
monitoring. usage of CPU. •Interface handling
•Unnecessary capability and
usage of CPU DMA.
Interrupt driven I/O : Basic Operation

CPU issues read I/O module


command transfer the data

I/O module gets


data from CPU request data
peripheral devices

In the mean time


I/O module
CPU does other
interrupts CPU
works
Advantages and Disadvantages of
Interrupt Initiated I/O

Advantages Disadvantages
• Increased CPU utilization • Complex
• implementation
Potential performance degradation
• Enhanced responsiveness
due to excessive interrupts
• Efficient multitasking • Increased system complexity and
overhead
Real-World Examples of Interrupt Driven
I/O Systems

Printers Network Cards Hard Drives


Interrupts are used to manage Interrupt-driven I/O enables Interrupts are utilized to
print tasks, allowing the CPU network cards to handle communicate read/write
to process other operations incoming and outgoing data requests and handle data
while print data is sent to the packets efficiently. transfers between the hard
printer. drive and the CPU.
INTERRUPTS: HARDWARE,
TYPES OF INTERRUPTS
AND EXCEPTIONS
WHAT IS
INTERRUPT?
Interrupt is a high-priority instruction
generated by h/w device or software
program instructions to get immediate
attention of CPU(processesor)
for eg. Power failure and I/o device
request for data transfer
WORKING OF INTERRUPT
Main
program

ISR
Interrupt
arrives Control transfer to ISR

Control returned to
main program
TYPES OF INTERRUPT
HARDWARE INTERRUPT
A hardware interrupt is a signal sent by a hardware device to the
processor, indicating that it requires attention or action. This
interruption temporarily halts the normal execution of a program.

For eg: Keyboard Interrupt, Network Interrupt and Power Failure etc
MASKABLE NON-MASKABLE
It can be masked off or It cannot be masked off or
made pending. made pending
This interrupt does not disables all This interrupt disables all
nonmaskable interrupts. maskable interrupts.
It is used to interface It is used for emergency purposes
peripherals. like power failure, smoke detectore
It has lower priority. etc.
It has higher priority.
NON-VECTORED

VECTORED
In non-vectored interrupt, the
branch address is assigned to
The source that interrupts the the fixed address in the memory
CPU provides the branch It does not have a memory
information. This information is address.
called the interrupt vector. When a non-vectored interrupt is
It has a memory address. received it jumps into the
It allows the CPU to be able to program counter to fixed address
know what |SR(Interrupt Service in hardware.
Routine) to carry out in software.
THE 8085 INTERRUPTS
The 8085 has 5 Interrupt inputs.
Highest
TRAP • The INTR input is the only non-vectored
interrupt.
• INTR is maskable using the EI/DI
RST 7.5 instruction pair.
• RST 5.5, RST 6.5, RST 7.5 are all
RST 6.5 automatically vectored.
• RST 5.5, RST 6.5, and RST 7.5
RST 5.5 are all maskable.
• TRAP is the only non-maskable

INTR
interrupt in the 8085
Lowest • TRAP is also automatically
Priority order of interrupts vectored
EXCEPTIONS
Exceptions are events or conditions that deviate from the normal flow of
program execution. These anomalies, often arising from errors or
unexpected situations, prompt the processor to interrupt its current operation
and transfer control to a predefined exception handler.
For eg: Divide by zero error & Arithmetic exception etc
Direct Memory
Access (DMA)
Introduction to Direct
Memory Access (DMA)
DMA (Direct memory access) is the special feature within the
computer system that transfers the data between memory and
peripheral devices (like hard drives) without the intervention of
the CPU. In other words Direct Memory Access (DMA) transfers
the block of data between the memory and peripheral devices
of the system, without the participation of the processor.
Need for DMA
:-
Data transfer in microprocessor based system
:

FETCH DECODE EXECUTE

Microprocessor requires considerable time to decode and execute


the instruction. DMA is useful when the CPU cannot keep up with
the rate of data transfer, or when the CPU needs to perform work
while waiting for relatively slow I/O data transfer.
What is DMA Controller ?
Direct Memory Access uses hardware for accessing the memory,
that hardware is called a DMA Controller. DMA Controller is a type
of control unit that works as an interface for the data bus and
the I/O Devices.
:-

How DMA Works :-


MODES OF DMA :-
There are 2 modes of data transfer in DMA that are
described below.
• Burst Mode: In this mode burst of data is transferred before CPU
takes control of the buses back from DMAC. This is the quickest
mode of DMA transfer since at once a huge amount of data is
being transferred.

• Cycle Stealing Mode: It is the process in which DMA controller


used to transfer single word from input/output device to memory.
As compared to burst mode, this mode is slow. Slow I/O device will
take some time to prepare data and within that time CPU keeps
the control of the buses.

• Once the data or the word is ready CPU give back control of
systems buses to DMAC for 1 cycle in which the prepared word is
transferred to memory.
ADVANTAGES Of DMA :-
• Transferring the data without the involvement of the processor will
speed up the read-write task.
• DMA reduces the clock cycle requires to read or write a block of data
• Frees up the CPU to perform other tasks.
• Speeds up memory operations and data transfer.
Limitations of DMA :-
• Requires a DMA controller to carry out the operation, which increases
the cost of the system
• DMA Controller increases the complexity of the software.
• DMA can cause data loss if there is a mismatch between the device and
the controller.
• DMA is not supported by some devices and software. This could cause
compatibility issues and system crashes.
Real-Life Applications
of DMA

Supercomputers Audio and Video Networking

Suitable for large data Processing


In audio and video Network cards, routers,
transfer applications, e.g., equipment, DMA is used to and switches use DMA to
data centers, financial reduce latency, enabling transfer data to and from
modeling, scientific faster audio and video the memory, which saves
simulations. processing. CPU time and enhances
network performance.
STANDARD
communication
INTERFACE
STANDARD COMMUNICATION INTERFACE

• A standard communication interface


refers to a set of rules, protocols, or
specifications that define how
different devices or systems
communicate and exchange data
with each other.
Types of Standard
Communication Interfaces

1. PCI (Peripheral Component Interconnect) Bus.

2. SCSI (Small Computer System Interface) Bus.

3. USB (Universal Serial Bus).


PCI
(Peripheral Component Interconnect) : -

• Peripheral Component
Interconnect is a common
connection interface for
attaching
computer peripherals to
the motherboard. PCI
was popular between
1995 and 2005 and was
most often used to
connect sound
cards, network cards,
and video cards.
Block diagram
SCSI (Small Computer System
Interface)

SCSI (Small Computer


System Interface) is used to
connect and communicate
between computers and
peripheral devices, such as
hard disk drives, tape drives,
CD/DVD drives, and
scanners. SCSI was
originally developed as both
a protocol and a parallel
physical interface.
Block diagram
USB (Universal Serial Bus)

Universal Serial Bus (USB) is a


set of connectivity specifications
developed in collaboration with
industry leaders. Originally
released in 1995 at just 12
Mbps, USB allows easy,
high-speed. connections of
peripherals to PCs that, once
plugged in, configure
automatically.
Block diagram
Advantages
PCI
SCSI USB
1. It supports
plug and play 1. Fast Data 1. External power is
Transfer not needed
2. Cost-Effective
ness 2. Versatility 2. Universal
Compatibility:
3. Versatility
3. Device 3. Versatility
Flexibility
Disadvantages

PCI SCSI USB


1. Speed
1. Cost 1. It has limited
Limitation
capability
2. compatibil
2. bandwidth
ity issues 2. USB cables are
limitations.
limited in length.
3. Performan
3. Limited Power
ce 3. Latency
Efficiency:
 What is DMA?
 How cpu comes in idle state
 DMA Controller
 Working of DMA Controller
 DMA Transfer
 Types of DMA transfer using DMAC
 Advatages
 Disadvtages
 PYQs
 References
 Direct memory access (DMA) is
a (I/O) technique that allows an
(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).
CPU is placed in idle state by one
commonly used method withn two
special control signals-
Bus Request (BR signal )
 when BR is 1, CPU places RD,WR,
add. bus and data bus into high
impedance state(behaves like open
circuit)
Bus Grant ( BG signal )
 when BG is 1,CPU informs that the
DMAC can take the control of the
buses.
 DMA controller is a special interface circuit which communicates with
the CPU and I/O device. It has an address register, a word count
register, and a set of address line.

 A DMA controller temporarily borrows the address bus, data bus and
control bus from the CPU and transfers data between I/O devices and
main memory.
 Burst Transfer
In DMA Burst Transfer, a block sequence consisting of a number of
memory words is transferred in continuous burst while the DMA is master
of the memory buses.

 Cycle Stealing
It allows DMA controller to transfer one data word at a time, after which it
mustb return control of the buses to the CPU
 Data Memory Access speeds up memory operations and
data transfer.
 CPU is not involved while transferring data.
 DMA requires very few clock cycles while transferring data.
 DMA distributes workload very appropriately.
 DMA helps the CPU in decreasing its load.
 Direct Memory Access is a costly operation because of
additional operations.
 DMA suffers from Cache-Coherence Problems.
 DMA Controller increases the overall cost of the system.
 DMA Controller increases the complexity of the software.
 Morris Mano.
Section 11.6 page no. 417

 https://www.geeksforgeeks.org/direct-memory-access-dma-controller-
in-computer-architecture/

 Youtube Channel: Shanu Kuttan CSE Classes


https://youtu.be/RLbOHCyhOr4?si=yPtSexU5nb017rIj

You might also like