On and off: bits and bytes
A bit is one on/off switch, a byte is eight bits, and binary is counting with them. How ASCII turns letters and everything else into 0s and 1s.
Try it
- Bit switches – Flip eight switches and watch the number, and its ASCII letter, change.
- Binary converter – Type a number to see it in binary, or type binary to see the number.
- Text to ASCII – Type some text and see each character's ASCII number and its 8 bits.
Transcript
A computer only understands two things: on and off. One tiny switch that is either on or off is called a bit.
Off means zero, and on means one. So a bit is always a zero or a one.
Line up eight bits, and you get a byte.
Eight switches can make two hundred and fifty six different patterns. That's plenty to give every letter, number and symbol its own pattern.
Binary is counting with switches. Each switch is worth double the one next to it: one, two, four, eight.
To make the number five, switch on the four and the one. In binary, five is zero, one, zero, one.
But which pattern means which letter? Everyone agreed to use one table. It is called ask-ee.
Ask-ee gives every character a number. A is sixty five. B is sixty six. Lowercase a is ninety seven. Even the space has a number: thirty two.
The computer stores that number in binary. So the letter A, sixty five, is zero, one, zero, zero, zero, zero, zero, one.
Photos, music and games work the same way. Everything on a computer is made of bits.
Remember: a bit is one switch, a byte is eight bits, binary is counting with them, and ask-ee is the table that turns letters into numbers.
More in this series
1:521Inside a computer
The CPU is the brain, the RAM is the desk and the disk is the filing cabinet: what each part does and how they work together.
1:383What an operating system does
The OS is the manager of the computer: it shares the CPU and RAM between apps, organises files on the disk and talks to your devices.
1:184Your first terminal commands
Talk to the computer by typing: pwd, ls, cd, cat and mkdir, and how to find your way around folders.