Review: input/output devices
|
I will discuss one commonly used input device and output device and show you how they work.
Most commonly used input device:
Most commonly used output device:
A keyboard allows human users to enter English characters (represented by the ASCII code) into the computer memory:
|
A keyboard provides this interface function in a humanly-friendly way by showing the symbols A, B, C, ... etc on the key pad
When the user presses a key (e.g.: H):
the keyboard will transmit the corresponding binary ASCII code to the computer system
Note: the keyboard inputs are stored in the memory (in Java: in a String typed variable)
The computer sends an ASCII code (stored in its memory) to the terminal (device):
When the terminal receives the ASCII code (e.g.: 01001000), the terminal circuitry will draw the symbol (character) that corresponds to the ASCII code (H)
Very important fact that you need to remember about the keyboard:
|
When you type true on the keyboard, the computer system will store the following 4 ASCII codes in memory:
In contrast: recall that the Boolean value for true is represented by the 00000001 !!
When you type the number 15 on the keyboard, the computer system will store the following 2 ASCII codes in memory:
In contrast: recall that the byte value for 15 is represented by the 00001111 (in 8 bits) !!
Type a true or a number and see what is stored in computer memory:
|
Try: true, false, 15, -15