Bits and Bytes
Bits
- A bit is the atom of a computer
- It can store a 1 or 0
- A combination of bits can represent data
- Possible combinations increase by 2^numOfBits
| Number of bits |
Number of patterns |
| 1 bits |
2 |
| 2 bits |
4 |
| 3 bits |
8 |
| 4 bits |
16 |
| 5 bits |
32 |
| 6 bits |
64 |
| 7 bits |
128 |
| 8 bits (One Byte) |
256 |
Bytes
| Kilobyte |
1,000 bytes |
| Megabyte |
1,000,000 bytes |
| Gigabyte |
1,000,000,000 bytes |
| Terabyte |
1,000,000,000,000 bytes |
Bytes and Letters -> ASCII vs UNICODE
- ASCII (American Standard Code for Information Interchange) is an encoding representing each types letter by a number
- Each letter is stored in one byte
- ASCII has 256 character combinations so all characters can be represented in just 8 bits (one byte)
- Unicode is used with international characters so it can be represented in UTF-8 or UTF-16