Monday, September 7, 2015


Input devices let you enter information into a PC.

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

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

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

When you press a key on the keyboard the same thing happens. An interrupt handler (software routine) says 'Hey CPU, stop what you're doing, go over to the keyboard port, read the value of the key the operator 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 goes back 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 consuming routine to service the interrupt.

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


0 comments:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!