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 | |
|---|---|---|
| 1IF interrupt_signal = TRUE THEN | AIF interrupt found THEN handle interrupt BEFORE next fetch | |
| 2ELSE fetch next instruction | BNo interrupt is present, so the CPU carries on as normal with the next fetch-decode-execute cycle | |
| 3The CPU only checks for an interrupt after the current instruction has finished, at the end of the cycle | Cfetch, decode, execute, THEN check interrupt | |
| 4If an interrupt is found during the check, the CPU switches to handling it before fetching the next instruction | DAt the end of a cycle, the CPU checks whether an interrupt has arrived and, if it has, switches to handling it | |
| 5check for interrupt, then fetch, decode, execute | EThe interrupt check is placed at the start of the cycle. The CPU checks at the END of each cycle, after the current instruction has been executed. | |
| 6No interrupt found, so the CPU stops and waits | FIf there is no interrupt, the CPU does not stop. It carries on as normal and fetches the next instruction. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
interrupt check — At the end of each fetch-decode-execute cycle the CPU checks for an interrupt signal. If none, it fetches the next instruction; if one, it switches to handling it first.execute()
IF interrupt = TRUE THEN
handle_interrupt()execute()
IF interrupt = TRUE THEN
handle_interrupt()IF interrupt = FALSE THEN
fetch_next_instruction()
ENDIFdecode()
execute()
check_interrupt()IF interrupt THEN handle()
ELSE
fetch()