← IGCSE Computer Science Paper 1

Hardware interrupts

A signal sent by a hardware device, such as a keyboard, mouse or printer, to tell the CPU it needs attention, for example a key press or a printer out of paper.

Understanding Hardware interrupts in IGCSE Computer Science Paper 1

What it does: The mouse is a hardware device, so when it is moved it signals the CPU, which is a hardware interrupt. The device tells the CPU it has finished by sending an interrupt signal, so the CPU does not need to keep checking. The printer needs attention, so it sends a hardware interrupt to the CPU instead of waiting to be noticed.

Common mistakes: A hardware interrupt is a signal sent to the CPU, not to another device. The line should be SEND interrupt TO CPU. The printer does not wait to be asked. A hardware device generates the interrupt itself when it needs attention. The line should be SEND interrupt TO CPU.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 390–408) and word search (Modules 390–418).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A student presses a key on the keyboard while the CPU is running a program. What type of interrupt is generated?
A hardware interrupt, sent by the keyboardA software interrupt, sent by the program
Matches
The CPU generates the hardware interrupt when a key is pressed.
↓
A hardware interrupt is generated by the hardware device (the keyboard), not by the CPU. The CPU receives the signal and responds to it.
Applying
Meanings
Term
hardware interrupt
Meaning
A signal sent by a hardware device, such as a keyboard, mouse or printer, to tell the CPU it needs attention, for example a key press or a printer out of paper.
Practice
WHILE program is running
Testing
Gaps
A interrupt is sent by a device
Check Answer
Spots
1IF key_pressed THEN
2 SEND interrupt TO printer

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Firefly' badge — Night Coder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A student presses a key on the keyboard while the CPU is running a program. What type of interrupt is generated?
A. A hardware interrupt, sent by the keyboard ✓
B. A software interrupt, sent by the program
The keyboard is a hardware device. It sends a signal to tell the CPU a key was pressed, so this is a hardware interrupt.
2. Which statement describes a hardware interrupt?
A. A signal from a program telling the CPU it has made an error
B. A signal from a hardware device telling the CPU it needs attention ✓
A hardware interrupt comes from a hardware device. An interrupt caused by a program or an error in software is a software interrupt.
3. A printer runs out of paper in the middle of a print job. What happens?
A. The printer sends a hardware interrupt to the CPU ✓
B. The printer waits silently until the CPU checks it
The printer needs attention, so it sends a hardware interrupt to the CPU instead of waiting to be noticed.
4. Which event is an example of a hardware interrupt?
A. Moving the mouse ✓
B. Dividing a number by zero in a program
Moving the mouse sends a signal from a hardware device. Dividing by zero is a runtime error caused by software, so it is a software interrupt.
5. Which device could generate a hardware interrupt?
A. A variable that has been given a new value
B. A device that has finished transferring data ✓
A device finishing a data transfer signals the CPU with a hardware interrupt. A variable is part of a program, not a hardware device.

Match the Pairs

keyboard -> interrupt signal -> CPU → Pressing a key on the keyboard sends a hardware interrupt to the CPU so the key press can be dealt with.
printer: out of paper -> interrupt → A printer running out of paper generates a hardware interrupt to tell the CPU it needs attention.
Moving the mouse is an event that makes the mouse send a hardware interrupt to the CPU. → mouse moved -> hardware interrupt -> CPU
A device that finishes a data transfer sends a hardware interrupt so the CPU knows it can carry on. → transfer complete -> hardware interrupt
The CPU generates the hardware interrupt when a key is pressed. → A hardware interrupt is generated by the hardware device (the keyboard), not by the CPU. The CPU receives the signal and responds to it.
A hardware interrupt is caused by an error in a program, such as dividing by zero. → An error in a program, such as divide by zero, causes a software interrupt. A hardware interrupt comes from a hardware device such as a keyboard, mouse or printer.

Key Term

hardware interrupt
A signal sent by a hardware device, such as a keyboard, mouse or printer, to tell the CPU it needs attention, for example a key press or a printer out of paper.

Fill in the Blanks

1. A hardware interrupt is sent by a device
Hint: Type the word for interrupts that come from the physical parts of a computer, such as a keyboard or printer.
2. IF keyPressed THEN SEND interrupt TO CPU
Hint: Type the name of the signal a device sends to get the CPU's attention.
3. IF paperTray = 0 THEN SEND interrupt
Hint: Type the comparison operator that checks whether the paper tray holds zero sheets.
4. IF transferDone = TRUE THEN SEND interrupt
Hint: Type the pseudocode keyword that comes after the condition and starts the action to run when it is true.
5. IF mouseMoved THEN SEND interrupt TO CPU
Hint: Type the abbreviation for the component that receives the interrupt signal from the mouse.

Spot the Error

Question 1
A IF key_pressed THEN
B SEND interrupt TO printer
C CPU runs keyboard ISR
D ENDIF
Line B — A hardware interrupt is a signal sent to the CPU, not to another device. The line should be SEND interrupt TO CPU.
Question 2
A WHILE printer_is_printing
B IF paper_tray = empty THEN
C WAIT until CPU asks
D ENDIF
E ENDWHILE
Line C — The printer does not wait to be asked. A hardware device generates the interrupt itself when it needs attention. The line should be SEND interrupt TO CPU.
Question 3
A IF mouse_moved THEN
B signal ← software_interrupt
C SEND signal TO CPU
D ENDIF
Line B — Moving the mouse is an event from a hardware device, so it creates a hardware interrupt, not a software interrupt. It should be hardware_interrupt.
Question 4
A START data_transfer
B CPU does other tasks
C WHEN transfer_done
D CPU SENDS interrupt
Line D — The device that finished the data transfer sends the hardware interrupt to the CPU. The CPU does not send it. It should be device SENDS interrupt.
Question 5
A WHEN mouse_clicked
B mouse SENDS interrupt
C CPU runs the keyboard ISR
D CPU resumes previous task
Line C — The CPU must run the interrupt service routine for the device that raised the interrupt. A mouse click needs the mouse ISR, not the keyboard ISR.

Student with a class code? Join your class →