Input Devices


Input devices let you enter informationinto a PC. 

The keyboard, mouse and touch-screen display areexamples of input devices.

Input devices get information into the computer by interrupting the CPU fromit's main program, in much the same way that you are interrupted in your dailylife. 

If you are home preparing dinner or watching TV andthe door bell rings you have to stop what you are doing, go to the door, seewho it is, see what they want, take any appropriate action, say good bye andthen go back and pick up where you left off, right? 

When you press a key on the keyboard the same thing happens. An interrupthandler (software routine) says 'Hey CPU, stop whatyou're doing, go over to the keyboard port, read the value of the key theoperator just pushed and store this value in memory location X.' 

The CPU stops, reads the key, stores the key value in location X, and then goesback to doing what it was doing before the interrupt.This is a simple example.Often an interrupt will cause a PC to run a very complex, time consumingroutine to service the interrupt. 

The difference is that you probably get interrupted infrequently compared to aPC, unless you have a really busy job, like a switchboard operator, where itcould be a few times every minute. A CPU can be interrupted hundreds, eventhousands of times per second depending on the environment it is running in.