Computer Design and architecture
1 Answer

Interrupt: An interrupt is an asynchronous input to the synchronous system. It is one of the methodologies of getting the CPU's attention. If the processor is triggered with an interrupt then the processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler to deal with the event.

The interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities.

There are two types of interrupts:

  1. Hardware interrupts: These are used by the devices to communicate with the processor that they require attention from the operating system. Hardware interrupts are implemented using electronic signals that are sent to the processor.
  2. Software interrupts: These are triggered within the processor itself. For instance, when any process is utilizing the CPU for so long then the software interrupt is triggered to give the other processes chance to avoid starvation.

Each interrupt has its own interrupt handler.

We know that the instruction cycle consists of fetch, decode, execute and read/write functions. After every instruction cycle, the processor will check for interrupts to be processed if there is no interrupt is present in the system it will go for the next instruction cycle which is given by the instruction register.

If there is no interrupt present it will trigger the interrupt handler, the handler will stop the present instruction which is processing and save its configuration in a register and load the program counter of the interrupt from a location which is given by the interrupt vector table. After processing the interrupt by the processor interrupt handler will load the instruction and its configuration from the saved register, process will start its processing where it's left. This saving the old instruction processing configuration and loading the new interrupt configuration is also called as context switching.

Please log in to add an answer.