Keyboard to binary
When you press a key, the computer does not get a letter. It gets a code made of 1s and 0s. Press a key and follow it from the keyboard to the monitor.
Input · ආදාන
Processing · සැකසීම
Output · ප්රතිදාන
Keyboard
යතුරු පුවරුව
Press a key…
Main memory
ප්රධාන මතකය
Bytes stored: 0
- Empty
Processor
සකසනය
Waiting for a byte…
Monitor
සංදර්ශකය
Click here to type
Press a key and follow its byte from the keyboard to the monitor.
What is happening?
Every letter, digit and symbol has a number, called its ASCII code. When you press a key, that number travels through the computer in binary, in four steps:
- The keyboard (input) turns the key press into eight electrical signals, each one ON or OFF, and sends them along a wire.
- The main memory stores those eight bits as one byte.
- The processor reads the byte and identifies which character it stands for.
- The monitor (output) shows that character.
For example, the capital letter A is code 65, which is 01000001 in binary. Each 0 or 1 is called a bit, and 8 bits make one byte. So every letter you type uses one byte.
Things to try
- Type your name. How many bytes does it use?
- Type
aand thenA. Which bit changes? - Press Space and Enter. They have codes too, even though you can’t see them.
- Type the digit
1. Is its binary code the same as the number one? - Choose Step by step, press one key, then use the right arrow key to move its byte from one part to the next.