Keyboard to binary
When you press a key, the computer does not get a letter. It gets a code made of 1s and 0s. Type something and watch both screens.
You press a keyComputer gets binaryScreen shows the letter
Binary (what the computer sees)
- Waiting for a key…
Type a letter to see how capital and small letters differ in binary.
What is happening?
Every key on the keyboard has a number, called its ASCII code. When you press a key, the keyboard sends that number to the computer in binary. The computer then looks up the code and draws the matching letter on the screen.
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?