(This is the older material - click here - for current specification content)

3. What is an Interrupt?

The task of the CPU is to process data and follow instructions. It must be able to react to events as they occur, regardless of what it is doing at the time.

For instance, input - output devices need to be handled as and when they need attention

  • Hard disks
  • Optical drives
  • Mouse
  • Keyboard
  • Printers
  • Monitors
  • Other I/O hardware

pollingOne method of doing this is for the CPU to keep checking with the device to see if it needs attention. This method is called 'polling'.

Imagine the CPU as an annoying little child sitting in the back seat of the car. He keeps asking "Are we there yet, Are we there yet, Are we ..." You get the idea.

The child is 'polling' the Input-Output device (the parent). This works, but it is horribly inefficient and wastes a lot of time and effort.

A much better (and peaceful) method is for the child to issue an instruction "Please tell me when we have arrived, meanwhile I can play with my toys".

The parent / child is now using the 'interrupt' method. When they arrive a message (interrupt) is sent to the child (CPU) to inform him that the event has happened and needs to store his toys so that he can return to them later and prepare to leave the car (the new task).

So an interrupt is a signal for the CPU to stop what it is doing and instead carry out the interrupt task, once the task is complete, the CPU goes back to what it was doing.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: CPU Interrupt

 

Copyright © www.teach-ict.com