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

Lecture 4

Uploaded by

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

Lecture 4

Uploaded by

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

Computer Architecture(CTE214)

by
Engr. B.S. Muhammad(BEng. BUK, MSc. ABU)

Department of Computer Engineering, Kaduna Polytechnic


Lecture Four

Computer Interrupt
Introduction

In the early years of computing, processors had to check each and every
hardware and software program in the system if there’s any signal that requires
processing. This method of checking the signal in the system for processing is
referred to as polling method.
The major disadvantage of this method is that the processor has to waste
number of clock cycles just for checking the signal in the system. Hence, the
processor becomes unnecessarily busy, and as such affects the performance as
well as the response time of the system.

Department of Computer Engineering


To address this problem, a new mechanism that does not require the processor to
check for any signal from hardware or software was developed. In this
mechanism, the hardware/software will only send the signal to the processor for
processing. These signals from the hardware or software will have the highest
priority. As such, the processor will leave the current process being executed and
process the signal of hardware or software. This mechanism is called the
INTERRUPT of the system.
WHAT IS INTERRUPT?
Computer Interrupt can be defined as a signal which has the highest priority from
hardware or software in which the processor will process its signal immediately. It
can also be defined as a mechanism by which computer components, like memory
or I/O modules, may interrupt the normal processing of the processor and request
the processor to perform a specific action.
Department of Computer Engineering
To accommodate interrupts, an interrupt cycle is added into computer instruction
cycle for checking the availability of interrupts as shown below:

Department of Computer Engineering


The following gives the detailed interrupt processing procedure:
i. I/O device issues the interrupt.
ii. The processor finishes the execution of an instruction.
iii. The processor checks for an interrupt. If there is one, it then sends an
acknowledgement signal to the I/O device that issued the interrupt. This
signal allows the device to remove its interrupt signal.
iv. To switch to run interrupt handler, information about the current program is
stored, so that its execution may be resumed later.
v. The processor loads the program counter with the entry location of the
interrupt handler.
vi. The interrupt handler may continue to save other information that is
considered as part of process state.

Department of Computer Engineering


vii. The handler performs the interrupt processing.
viii. When the handler finishes, the saved register values are restored into the
registers that originally hold them when the interrupt handler returns.
ix. Finally, the interrupted program are restored, thus the program may
continue to execute.

TYPES OF INTERRUPTS
Although interrupts have highest priority than other signals, there are many type
of interrupts but basic type of interrupts are
1. Hardware Interrupts: If the signal to be processed is from an external
device or hardware is called hardware interrupt.
Example: when a particular button from the keyboard is pressed to perform certain
actions, this will generate a signal that will enable the processor to execute that
instruction.
Department of Computer Engineering
Hardware interrupts can be classified into two namely;

 Maskable Interrupt: The hardware interrupts which can be delayed when a


much highest priority interrupt has occurred to the processor.
 Non Maskable Interrupt: The hardware which cannot be delayed and should
process by the processor immediately.
2. Software Interrupts: Software interrupt can also divided in to two types
namely;
 Normal Interrupts: these interrupts are caused by the software instructions
 Exception: is an unplanned interrupts that occurs while executing a program.
For example: while executing a program if we get a value which should be
divided by zero is called a exception.

Department of Computer Engineering

You might also like