When an interrupt originates from an external device, it is referred to as a hardware interrupt. These signals are generated by external hardware to seek the attention of the processor on occurrence of a significant external event, for instance a key hit on the keyboard, a click on a mouse button, or moving the mouse trigger hardware interrupts through which the processor is notified about the availability of data to be read. Hardware interrupts occur asynchronously with respect to the processor clock (meaning they can occur at random times), and hence are also termed as asynchronous interrupts.
Interrupts triggered from within the CPU due to events generated by program instructions currently in execution are referred to as software interrupts. A software interruptis caused either by an exception triggered by program instructions currently in execution or on execution of a privileged instruction that raises an interrupt. For instance, when a program instruction...