0% found this document useful (0 votes)
0 views

04. Interrupts

The document discusses the concept of interrupts in computer systems, detailing their types, including program, I/O, hardware failure, and timer interrupts. It explains the importance of interrupts for improving system efficiency by allowing the CPU to perform other tasks while waiting for I/O operations to complete. Additionally, it covers techniques for handling multiple interrupts, such as disabled interrupts and priority interrupts, as well as the concept of Direct Memory Access (DMA) for enhanced efficiency.

Uploaded by

sunita11076
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

04. Interrupts

The document discusses the concept of interrupts in computer systems, detailing their types, including program, I/O, hardware failure, and timer interrupts. It explains the importance of interrupts for improving system efficiency by allowing the CPU to perform other tasks while waiting for I/O operations to complete. Additionally, it covers techniques for handling multiple interrupts, such as disabled interrupts and priority interrupts, as well as the concept of Direct Memory Access (DMA) for enhanced efficiency.

Uploaded by

sunita11076
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Interrupts

-Akash Mehta
The B.E.S. College
Department of Computer Science
Interrupts

 Every Computer uses the concept of


Interrupts.
 I/O devices are provided with a
mechanism to interrupt the working of
the processor.
 Interrupts belong to 4 different
categories.
Types of Interrupts

 Program Interrupt – Generated by a


program in order to execute a
subroutine call;
 I/O interrupt – Generated by I/O
devices when they require processing;
Types of Interrupts

 H/W Failure – Generated when a


component stops working properly;
 Timer – The computer has set up a
timer, which keeps on generating
interrupts after a regular interval of
time, in order to perform certain
functions.
Why Use Interrupts?

 Improves the efficiency of the System as a


whole;
 The Speed of the Processor >>>> The
Speed of I/O devices;
 The CPU sits idle when the I/O devices
are processing their data;
Why Use Interrupts?
Why Use Interrupts?
 Without Interrupts, the CPU sits idle
while the I/O device is completing its
operation;
 With interrupts, the processor can be
engaged in executing other instructions
while an I/O operation is in progress.
 This improves the efficiency of the entire
system;
Why Use
Interrupts?
Transfer of Control
Instruction Execution Cycle
Instruction Execution Cycle
 If no interrupts are pending, the processor
proceeds to the fetch cycle and fetches the
next instruction of the current program.
 If an interrupt is pending, the processor does
the following:
◦ It suspends execution of the current program
being executed and saves its context. This means
saving the address of the next instruction to be
executed (current contents of the program
counter) and any other data relevant to the
processor’s current activity.
◦ It sets the program counter to the starting
address of an interrupt handler routine.
Multiple Interrupts
 It is possible that 2 or more interrupts
are generated at the same time – How to
solve this problem?
 There are 2 techniques –
◦ Disabled interrupts
◦ Priority Interrupts
Disabled Interrupts
 Works with the first come first serve
concept;
 The First interrupt to arrive is served
first;
 When the processor is working on one
interrupt, it disables the other interrupts;
 Enabled again after the first interrupt has
been taken are of;
Priority Interrupt

 Works along the concept of priority


scheduling;
 Each device has its own priority;
 Interrupts are serviced based upon the
priority of the I/O devices;
Priority Interrupt
Direct Memory Access
 Sometimes it makes more sense to allow
I/O devices direct access to the Memory;
 Doing so will allow the processor to look
after other important tasks;
 DMA – Allows I/O devices to directly
access the Memory, without disturbing
the CPU;
 Improves System Efficiency.

You might also like