Interrupts

Interrupt can be termed as signal send by the hardware to processor. The signal tells that hardware is ready. When an interrupt signal comes, the processor stops or suspend what it is doing and give attention to the signal.

Processor is the central unit of a computer. Computer consist number of devices, input/output devices. Every devices are controlled and monitored by CPU. This is done by checking the status of every devices attached. For instance, CPU checks the status of the keyboard, printer, monitor to see if it is ready or not. Ready means if the user is typing, keyboard is ready and CPU give attention to device and if the user wants to print some thing CPU checks the status of the printer. If it is ready then execute some routine to perform the printing task.But the typing and printing speed or speed of any hard devices very much low comparing to the processing speed of CPU. This means the CPU idle most time while the hardware work is in progress. And also if the devices is not ready CPU waits for the device to be ready. That is, if the user want to print something but the status of printer is not ready the CPU wait for that device to be ready. This means processor not performing any useful computation.

To get the most out of CPU just revers the above task. That is arrange the hardware(I/O) to signal CPU when they are ready. So when the printer, keyboard ready they send signal to processor. And make the processor to stop or suspend(or onterrupt) what is doing and process the signal.

As mentioned above when an interrupt signal comes processor executes some routine. For example, DATARD is a routine which is executed by processor when a keyboard interrupt comes or PRINT routine which is executed by processor when the printer send the interrupt signal.

No comments: