Interrupt

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Interrupt

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement correctly describes an interrupt?
A A signal sent to the CPU asking it to pause its current task
B A program that permanently stops the CPU from working
2. What does the CPU normally do once an interrupt has been dealt with?
A It returns to the task it was doing before
B It shuts down and has to be restarted
3. A student presses a key while a program is running and the CPU briefly pauses to deal with it. What has happened?
A The computer has crashed
B An interrupt was sent to the CPU
4. Why does a computer use interrupts?
A So that the CPU can run more slowly to save power
B So that something more urgent can be dealt with straight away
5. Which is true about an interrupt?
A It stops the current task temporarily
B It deletes the current task from memory

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1interrupt AAn interrupt is a signal, not a program. The CPU may run a program (a routine) in response, but the interrupt itself is just the signal.
2resume original task BA signal sent to the CPU telling it to pause its current task so something more urgent can be dealt with
3An interrupt is a signal, not a program, that makes the CPU stop its current task temporarily CAn interrupt does not mean the computer has crashed. It is a normal signal, and the CPU returns to its original task afterwards.
4An interrupt does not mean the computer has crashed, because normal work continues afterwards DAfter the interrupt is dealt with, the CPU goes back to the task it was doing before
5An interrupt is a program that runs inside the CPU Einterrupt handled -> continue task
6interrupt received -> computer has crashed Fsignal -> CPU: STOP current task

Definitions

interrupt

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF interrupt = TRUE THEN _____ current_task ENDIF
2.
IF _________ = TRUE THEN PAUSE current_task ENDIF
3.
HANDLE interrupt ______ original_task
4.
interrupt ← TRUE crashed ← _____
5.
IF urgent = TRUE ____ PAUSE task ENDIF

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A interrupt = program run by CPU
B CPU pauses current task
C CPU deals with urgent event
D CPU returns to original task
Question 2
A WHILE computer is running
B CPU runs current task
C IF interrupt THEN crash
D ENDWHILE
Question 3
A Interrupt received: PC crashed
B CPU pauses current task
C CPU handles the interrupt
D CPU resumes original task
Question 4
A Printer needs paper: interrupt
B CPU pauses game, handles it
C CPU never returns to the game
Question 5
A task = 'edit document'
B CPU runs task
C interrupt = True
D IF interrupt THEN RESTART PC
E RESUME task after handling

Answer Key

Interrupt
Section A: Quick Questions
Q1
A — A signal sent to the CPU asking it to pause its current task
Q2
A — It returns to the task it was doing before
Q3
B — An interrupt was sent to the CPU
Q4
B — So that something more urgent can be dealt with straight away
Q5
A — It stops the current task temporarily
Section B: Match the Pairs
Q1
interrupt → A signal sent to the CPU telling it to pause its current task so something more urgent can be dealt with
Q2
resume original task → After the interrupt is dealt with, the CPU goes back to the task it was doing before
Q3
An interrupt is a signal, not a program, that makes the CPU stop its current task temporarily → signal -> CPU: STOP current task
Q4
An interrupt does not mean the computer has crashed, because normal work continues afterwards → interrupt handled -> continue task
Q5
An interrupt is a program that runs inside the CPU → An interrupt is a signal, not a program. The CPU may run a program (a routine) in response, but the interrupt itself is just the signal.
Q6
interrupt received -> computer has crashed → An interrupt does not mean the computer has crashed. It is a normal signal, and the CPU returns to its original task afterwards.
Section C: Definitions
Q1
interrupt — A signal sent to the CPU telling it to pause its current task so something more urgent can be dealt with. The CPU then returns to the original task. It is not a crash.
Section D: Fill in the Blanks
Q1
IF interrupt = TRUE THEN PAUSE current_task ENDIF
Q2
IF interrupt = TRUE THEN PAUSE current_task ENDIF
Q3
HANDLE interrupt RESUME original_task
Q4
interrupt ← TRUE crashed ← FALSE
Q5
IF urgent = TRUE THEN PAUSE task ENDIF
Section E: Spot the Error
Q1
A — An interrupt is a signal sent to the CPU, not a program. Line 1 should read: interrupt = signal to CPU.
Q2
C — An interrupt does not make the computer crash. The CPU pauses, handles the interrupt and carries on: IF interrupt THEN handle it.
Q3
A — Receiving an interrupt is normal behaviour and does not mean the computer has crashed. The PC is fine.
Q4
C — After dealing with the interrupt, the CPU goes back to the task it was doing. It should return to the game.
Q5
D — An interrupt makes the CPU pause the current task temporarily. It does not restart the computer. It should be IF interrupt THEN PAUSE task.