[ The PC Guide | Systems and Components Reference Guide | Motherboard and System Devices | System Resources | Interrupts (IRQs) | Interrupt Function and Operation ] Why Interrupts Are Used to Process Information The processor is a highly-tuned machine that is designed to (basically) do one thing at a time. However, we use our computers in a way that requires the processor to at least appear to do many things at once. If you've ever used a multitasking operating system like Windows 95, you've done this; you may have been editing a document while downloading information on your modem and listening to a CD simultaneously. The processor is able to do this by sharing its time among the various programs it is running and the different devices that need its attention. It only appears that the processor is doing many things at once because of the blindingly high speed that it is able to switch between tasks. Most of the different parts of the PC need to send information to and from the processor, and they expect to be able to get the processor's attention when they need to do this. The processor has to balance the information transfers it gets from various parts of the machine and make sure they are handled in an organized fashion. There are two basic ways that the processor could do this:
It may seem like an inefficient way to run a computer, having it be interrupted all the time. I'm sure it must remind you of a day at the office, where the phone kept ringing every 5 minutes and you couldn't get anything done. However, without the ringer on the phone, the alternative would be to keep picking up the phone every 30 seconds to see if someone was trying to call you, which even the most ardent telephone-hater would have to admit is much worse. :^) It's also interesting to put into perspective just how fast the modern processor is compared to many of the devices that transfer information to it. Let's imagine a very fast typist; say, 120 words per minute. At an average of 5 letters per word, this is 600 characters per minute on the keyboard. You might be fascinated to realize that if you type at this rate, a 200 MHz computer will process 20,000,000 instructions between each keystroke you make! You can see why having the processor spend a lot of time asking the keyboard if it needs anything would be wasteful, especially since at any time you might stop for a minute or two to review your writing, or do something else. Even while handling a full-bandwidth transfer from a 28,800 Kb/sec modem, which of course moves data much faster than your fingers, the processor has over 60,000 instruction cycles between bytes it needs to process. In addition to the well-known hardware interrupts that we discuss in this section, there are also software interrupts. These are used by various software programs in response to different events that occur as the operating system and applications run. In essence, these represent the processor interrupting itself! This is part of how the processor is able to do many things at once. The other thing that software interrupts do is allow one program to access another one (usually an application or DOS accessing to the BIOS) without having to know where it resides in memory.
|