Interrupts (Cambridge (CIE) O Level Computer Science)

Revision Note

Robert Hampton

Expertise

Computer Science Content Creator

Interrupts

What is an interrupt?

  • An interrupt is a signal for the CPU so stop what it it currently doing and do something else as a higher priority

  • The CPU is in a continuous loop of carrying out the fetch-decode-execute cycle, however there are occasions when this needs to be interrupted

How is an interrupt generated?

  • An interrupt can be generated by hardware and software:

    • Hardware - this is caused by a hardware device such as a hardware failure

    • Software - this occurs when an application stops or requests services from the OS

  • Interrupts are added to an area called the interrupt service routine

  • The interrupt service routine holds instructions that will need to be fetched, decoded and executed to complete the commands of the interrupt

  • The contents of the registers within the CPU cannot be lost by an interrupt, so contents are copied to a reserved area in RAM called a stack

  • Contents are added to the top of the stack, which will save them for later retrieval when the interrupt is complete

  • The interrupt will be executed instead of the original instructions

What are examples of hardware interrupts?

  • Hardware

    • power button may have been pressed

    • moving the mouse

    • clicking an icon to open a new program

    • keyboard presses e.g. ctrl, alt, delete

What are examples of software interrupts?

  • Software

    • a program is not responding

    • division by zero

    • two processes trying to access the same memory location

Exam Tip

The main focus of interrupts is the importance of the interrupt service routine and the role it plays in moving current instructions to the stack so that they can be interrupted BUT continue again afterwards

Worked Example

Describe the purpose of an interrupt in a computer system

[4]

Answer

Four from:

  • Used to attend to certain tasks/issues

  • Used to make sure that vital tasks are dealt with immediately

  • The interrupt/signal tells the CPU/processor (that its attention is required)

  • A signal that can be sent from a device (attached to the computer)

  • A signal that can be sent from software (installed on the computer)

  • The interrupt will cause the OS/current process to pause

  • The OS/CPU/ISR will service/handle the interrupt

  • They have different levels of priority

  • After the interrupt is serviced, the (previous) process is continued

  • It enables multi-tasking to be carried out on a computer

  • A valid example of an interrupt e.g. ‘out of paper’ message for a printer

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Robert Hampton

Author: Robert Hampton

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.