Interrupts Cambridge IGCSE Computer Science revision
Not started
Learn it
In plain words
The processor is busy running a program when you press a key. How does it know? The keyboard sends an interrupt: a signal that says "something needs your attention".
It works like a teacher helping one student when another puts a hand up. The teacher finishes the sentence, notes where they were, deals with the question, and then goes back.
6 things to know
- An interrupt is a signal sent to the processor to tell it that something needs attention.
- Hardware interrupts come from devices: pressing a key on the keyboard, or moving the mouse.
- Software interrupts come from programs: a division by zero, or two processes trying to access the same memory location.
- Each interrupt has a priority. The processor finishes its current fetch–decode–execute cycle, then checks whether an interrupt is waiting and how urgent it is.
- If the interrupt has a higher priority than the current task, the processor saves what it was doing and runs the interrupt service routine (ISR) for that interrupt.
- When the routine has finished, the saved task is restored and carries on from where it stopped.
Worked example
A user presses a key while a program is running. Describe what happens.
- The keyboard generates an interrupt signal and sends it to the processor.
- The processor finishes the current fetch–decode–execute cycle, and checks the priority of the interrupt.
- If the priority is high enough, the current state of the program is saved.
- The interrupt service routine for the keyboard runs. Then the program's state is restored and it continues.
Tips and tricks
- The processor finishes its current cycle before it checks for interrupts. It does not stop halfway through an instruction.
- Know two examples of each kind. Hardware: a key press, a mouse movement. Software: division by zero, two processes wanting the same memory location.
It lands in your notebook with its questions as flashcards.
Interrupts: 5 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
What is an interrupt?
It can come from hardware or from software.
Which of these causes a hardware interrupt?
The device sends the signal.
Which of these causes a software interrupt?
The signal comes from a program.
What does the processor run to deal with an interrupt?
There is a routine for each kind of interrupt.
What happens to the task that was running when an interrupt is serviced?
Saving its state lets it carry on from where it stopped.
Quiz
5 questions
Tap an answer and you’ll see straight away whether it’s right, and why.
Worksheet
2 questions, 6 marks. Write your answers on paper, then check them.
Interrupts
Cambridge IGCSE Computer Science 0478 · 6 marks · papermunch.org
Name ______________________________ Date ______________
Give one example of a hardware interrupt and one example of a software interrupt.[2]
Show answerHide answer
Hardware: a key being pressed on the keyboard. Software: a program trying to divide by zero.
Describe how an interrupt is handled.[4]
Show answerHide answer
The processor finishes its current cycle and checks the priority of the interrupt. If it is higher than that of the current task, the state of the current task is saved. The interrupt service routine is run. The saved task is then restored and continues.
Answers: Interrupts
- 1. Hardware: a key being pressed on the keyboard. Software: a program trying to divide by zero.
- 2. The processor finishes its current cycle and checks the priority of the interrupt. If it is higher than that of the current task, the state of the current task is saved. The interrupt service routine is run. The saved task is then restored and continues.



