Computer Architecture: Interrupts: Priority Interrupt
Computer Architecture: Interrupts: Priority Interrupt
Interrupts
Data transfer between the CPU and the peripherals is initiated by the CPU. But the
CPU cannot start the transfer unless the peripheral is ready to communicate with the
CPU. When a device is ready to communicate with the CPU, it generates an interrupt
signal. A number of input-output devices are attached to the computer and each
device is able to generate an interrupt request.
The main job of the interrupt system is to identify the source of the interrupt. There is
also a possibility that several devices will request simultaneously for CPU
communication. Then, the interrupt system has to decide which device is to be
serviced first.
Priority Interrupt
A priority interrupt is a system which decides the priority at which various devices,
which generates the interrupt signal at the same time, will be serviced by the CPU.
The system has authority to decide which conditions are allowed to interrupt the CPU,
while some other interrupt is being serviced. Generally, devices with high speed
transfer such as magnetic disks are given high priority and slow devices such
as keyboards are given low priority.
When two or more devices interrupt the computer simultaneously, the computer
services the device with the higher priority first.
Types of Interrupts:
Following are some different types of interrupts:
Hardware Interrupts
When the signal for the processor is from an external device or hardware then this
interrupts is known as hardware interrupt.
Let us consider an example: when we press any key on our keyboard to do some
action, then this pressing of the key will generate an interrupt signal for the processor
to perform certain action. Such an interrupt can be of two types:
Maskable Interrupt
The hardware interrupts which can be delayed when a much high priority interrupt
has occurred at the same time.
The hardware interrupts which cannot be delayed and should be processed by the
processor immediately.
Software Interrupts
The interrupt that is caused by any internal system of the computer system is known
as a software interrupt. It can also be of two types:
Normal Interrupt
The interrupts that are caused by software instructions are called normal software
interrupts.
Exception
Unplanned interrupts which are produced during the execution of some program
are called exceptions, such as division by zero.