Unit 5 COA
Unit 5 COA
1)•TheDifferent
12/25/2023 mannerare
major differences of: operation 1
●
12/25/2023
2.STATUS COMMAND 4
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:
12/25/2023 8
Input and output ports
What is ports in computer?
❑ Parallel port
Serial port
❑ 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
Channel use separate , independent and low cost processor for its
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
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
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
:
• 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
• 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)
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/