Investigating the keyboard interface
I'm sure you are familiar with computer keyboards as a user, but perhaps not how keyboards are physically implemented.
Keyboards consist of a matrix of switches. When you depress a key, you close a circuit. A keyboard controller activates one line at a time and checks to see which lines are connected, which will identify a unique key (assuming only one key is pressed). It will also detect when a key is released:
The keyboard controller will apply a voltage across each input one at a time. With the voltage applied, it will look at the outputs to identify whether any key is pressed. In Figure 10.1, when the controller scans input 2, and key K is depressed, output 2 will be active high.
When IBM introduced the PS/2 computer, they introduced a new keyboard and mouse standard. The keyboard pulled the matrix decoder into the keyboard and simplified the interface to two wires. The...