Module 4 PPT - Template Ait Ddco
Module 4 PPT - Template Ait Ddco
Text Book:
Carl Hamacher, ZvonkoVranesic, SafwatZaky, Computer
Organization, 5th Edition, Tata McGraw Hill.
Dept of CSE
COMPUTER ORGANIZATION
4. Input/Output Organization
• Accessing I/O Devices.
Dept of CSE
Dept of CSE
I/O Technique
Programmed
Interrupt driven
Dept of CSE
Direct Memory Access (DMA)
Program-Controlled I/O
• Consider a simple example of I/O operations
involving a keyboard and a display device in a
computer system. The four registers shown below
are used in the data transfer operations.
• The two flags KIRQ and DIRQ in STATUS register are
used in conjunction with interrupts.
Dept of CSE
An Example
A program that reads one line from the keyboard,
stores it in memory buffer, and echoes it back to
the display.
Dept of CSE
Program-Controlled I/O
The example described above illustrates program
controlled I/O, in which the processor repeatedly checks a
status flag to achieve the required synchronization
between the processor and an input or output device. We
say that the processor polls the devices
Dept of CSE
There are two other commonly used mechanisms for
implementing I/O operations: interrupts and direct memory
access
Dept of CSE
Interrupt-Service Routine &
Subroutine
Treatment of an interrupt-service routine is very similar to
that of a subroutine
Dept of CSE
ENABLING AND DISABLING INTERRUPTS
• The arrival of an interrupt request from an external device causes the processor
to suspend the execution of one program and start the execution of another.
Because interrupts can arrive at any time, they may alter the sequence of
events from that envisaged by the programmer.
• Hence, the interruption of program execution must be carefully controlled. A
fundamental facility found in all computer is the ability to enable and disable
such interruptions as desired.
Dept of CSE
Let us consider in the specific case of a single interrupt request from one device.
• When a device activates the interrupt-request signal, it keeps this signal
activated until it learns that the processor has accepted its request. This means
that the request signal will be active during execution of the interrupt-service
routine, perhaps until an instruction is reached that accesses the device in
question.
• It is essential to ensure that this active request signal does not lead to
successive interruptions, causing the system to enter an infinite loop from
which it cannot recover.
ENABLING AND DISABLING INTERRUPTS
several ways to address the these issues
The first possibility is to have the processor hardware ignore interrupt-request
line until the execution of first instruction of the interrupt-service routine has
been completed. Then, by using an Interrupt-disable instruction as
the first instruction in the routine, the programmer can ensure that no further
interruptions will occur until an Interrupt-enable instruction is executed.
The second option, which is suitable for a simple processor with only on
Dept of CSE
interrupt- request line, is to have the processor automatically disable interrupts
before starting the execution of the interrupt-service routine. After saving the
contents of the and the processor status register (PS) on the stack, the processor
performs the equivalent of executing an Interrupt-disable instruction.
In third option, the processor has a special Interrupt-request line or which the
interrupt-handling circuit responds only to the leading edge of the signal. Such a
line is said to edge-triggered. In this case, the processor will receive only one
request, regardless of how long the line is activated.
ENABLING AND DISABLING INTERRUPTS
The sequence of events involved in handling an interrupt request from a
single device. Assuming that interrupts are enabled, the following is a
typical scenario:
Dept of CSE
Simultaneous Requests
• Consider the problem of simultaneous arrivals of
interrupt requests from two or more devices. The
processor must have some means of deciding which
request to service first
• Interrupt priority scheme with daisy chain
Dept of CSE
Priority Group
Combination of the interrupt priority scheme with daisy
chain and with individual interrupt request and interrupt
acknowledge lines.
Dept of CSE