Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1Pressing the 'A' key on the keyboard | AHardware interrupt, because the signal comes from a hardware device (the keyboard) | |
| 2result = 10 / 0 | BA key press is signalled by the keyboard device, so it is a hardware interrupt. The program that later uses the key does not create the signal. | |
| 3Moving the mouse sends a signal from a device, so it is a hardware interrupt | CSoftware interrupt, because the signal comes from a running program causing a runtime error | |
| 4Two processes writing to the same memory location is a software interrupt because a running program causes the clash | DDivide by zero is caused by a running program, so it is a software interrupt. Being handled by the CPU does not make it a hardware interrupt. | |
| 5Divide by zero = hardware interrupt, because it happens inside the CPU | Esource = "mouse" # hardware interrupt | |
| 6Pressing a key = software interrupt, because the user typed it in a program | Fwrite(addr, A) + write(addr, B) # software interrupt |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
interrupt source — The origin of the signal. From a device, like a key press or mouse move, it is a hardware interrupt. From a running program, like divide by zero or a memory clash, it is a software interrupt.IF source = "key press" THEN
type ← "hardware"
ENDIFIF source = "divide by zero" THEN
type ← "software"
ENDIFIF source = "mouse move" THEN
type ← "hardware"
ENDIFIF source = "memory clash" THEN
type ← "software"
ENDIFreason ← "a device sent the signal"
OUTPUT "Hardware, because " + reason