Interrupts (CIE IGCSE Computer Science)

Revision Note

Test Yourself
Brett Murphy

Expertise

Computer Science

Interrupts

  • We know that computers use the fetch-decode execute cycle within the CPU to run instructions over and over. However, while this is occurring other devices may need to signal to the CPU to tell it to stop temporarily (interrupt) so that it can do the dedicated specific task 
  • E.g. a user has initiated ctrl alt delete to run task manager or a user wants a document printing
  • Interrupts will need to ensure that the CPU can stop executing its current program to run code for the overall interruption. Interrupts need to be added to an area called the interrupt service routine
  • Two types of interrupt:
    • Hardware Interrupt - this is caused by a hardware device such as a hardware failure e.g.
      • pressing a key on the keyboard
      • moving the mouse
    • Software Interrupt - this occurs when an application stops or requests services from the OS e.g. 
      • a program is not responding
      • division by zero
      • two processes trying to access the same memory location
  • However, the CPU currently contains registers that are holding data currently being handled: These include:
    • Program Counter - The location of the next instruction which will need to be fetched
    • Current Instruction Register - holds  the current instruction being executed
    • Memory Address Register - stores the location of where the data is being stored in RAM or where in RAM the data will be sent
    • Memory Data Register - stores the actual data from the location in the RAM or that will be sent to RAM
  • The interrupt service routine is simply added to a particular area where a certain set of instructions are sent that will need to be fetched, decoded and executed to complete the commands of the interrupt
  • As a result, it’s clear that the current registers will need to be changed at this point to accommodate the interrupt
  • The interrupt will be executed instead of the original instructions
  • When the interrupt is received the current values that were held in the registers are copied back to the RAM in an area known as a stack
  • These values are pushed onto the stack and are added to the top of the stack frame, which will save them for later retrieval when the interrupt is complete
  • There is a possibility that an interrupt can also be interrupted which is known as a division by zero. Due to the system in RAM with stack frames, the current interrupt would be moved to the bottom of the stack frame to complete the main interrupt initially

Exam Tip

  • Focus on the interrupt service routine and its importance with sending the instructions to a stack frame to process the interrupted instruction, the previous instructions can be accessed at the top of the stack frame to continue processing afterwards.

There are common interrupt priorities for different categories, these are:

  • Hardware
    • Power supply may have failed
    • Power button may have been pressed
  • User
    • Moving the mouse
    • Clicking an icon to open a new program
    • Keyboard presses e.g. ctrl, alt, delete
  • Software
    • Illegal instruction encountered
    • Overflow 
    • Login request
    • Crashing
  • Timer
    • Data logging programs which reads sensors continuously
    • Screen recording applications
  • Input/output devices
    • Signaling of data transfer been completed
    • Printer ink supply notifications
    • Input devices not responding

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?

Brett Murphy

Author: Brett Murphy

Brett is a passionate Computer Science teacher of over 9 years, he has taught in a number of schools across the Staffordshire, Derbyshire and Leicestershire regions. His aim is to bridge gaps and allow learners to build confidence and thrive within the subject and believe in themselves to succeed. Brett has continued to improve on practice by continuing to develop and implement resources to support learners in understanding the core concepts to succeed in their exams.