Lecture 2.3.2 (Interrupts)
Lecture 2.3.2 (Interrupts)
ASSISTANT PROFESSOR
BE-CSE
INTERRUPTS
Before interrupts, the CPU had to wait for the signal to process by continuously
checking for related hardware and software components (a method used earlier,
referred to as "polling"). This method expends CPU cycles waiting, reducing our
efficiency. The effective usage time of the CPU is reduced, reducing response
time, and there's also increased power consumption.
The solution proposed to the above problem was the use of interrupts. In this
method, instead of constantly checking for a signal, the CPU receives a signal
from the hardware or software components. The process of sending the signal by
hardware or software components is referred to as sending interrupts or
interrupting the system.
INTERRUPTS
The interrupts divert the CPU's attention to the signal request from the running
process. Once the interrupt signal is handled, the control is transferred back to the
previous process to continue from the exact position where it had left off.
Types of Interrupts
1. Hardware interrupt
2. Software interrupt
1. Hardware Interrupt: Interrupts generated by the hardware are referred to as
hardware interrupts. The failure of hardware components and the completion of
I/O can trigger hardware interrupts.
After the interrupt has occurred, the CPU needs to pass the control from the
current process to service the interrupts instead of moving to the next
instruction in the current process. Before transferring the control over to the
interrupt generated program, we need to store the state of the currently running
process.
The summary of the process followed during an interrupt is as below:
3. The system sends an acknowledgement for the interrupt, and the interrupt
signal from the source stops on receiving the acknowledgement.
4. The process's state of the current task is stored (register values, address of the
next instruction to be processed when the control comes back to the process
(Program counter in PC register), etc.), i.e., moved to the stack.
5. The processor now handles the interrupt and executes the interrupt generated
program.
6. After handling the interrupt, the control is sent back to the point in the
original process using the state information of the process that we saved earlier.
Interrupt Triggering Methods
The processor samples the interrupt input signal during each instruction
cycle. The processor will recognize the interrupt request if the signal is
asserted when sampling occurs.
Level-triggered inputs allow multiple devices to share a common interrupt
signal via wired-OR connections. The processor polls to determine which
devices are requesting service. After servicing a device, the processor may
again poll and, if necessary, service other devices before exiting the ISR.
Edge-triggered: An edge-triggered interrupt is an interrupt signaled by a
level transition on the interrupt line, either a falling edge (high to low) or a
rising edge (low to high). A device wishing to signal an interrupt drives a pulse
onto the line and releases it to its inactive state. If the pulse is too short to be
detected by polled I/O, then special hardware may be required to detect it.
Advantages of Interrupts
Reference Books:
J.P. Hayes, “Computer Architecture and Organization”, Third Edition.
Mano, M., “Computer System Architecture”, Third Edition, Prentice Hall.
Stallings, W., “Computer Organization and Architecture”, Eighth
Edition, Pearson Education.
Text Books:
Carpinelli J.D,” Computer systems organization &Architecture”, Fourth
Edition, Addison Wesley.
Patterson and Hennessy, “Computer Architecture”, Fifth Edition Morgaon
Kauffman.
Other References
http://www.ecs.csun.edu/~cputnam/Comp546/Input-Output-Web.pdf
http://www.ioenotes.edu.np/media/notes/computer-organization-and-archite
cture- coa/Chapter7-Input-Output-Organization.pdf
https://www.geeksforgeeks.org/io-interface-interrupt-dma-mode/
I/O Interface (Interrupt and DMA Mode) – GeeksforGeeks