Understand how and why computers use binary to represent all forms of data
📚 Data Representation
Computers store everything as numbers. The simplest numbers are 0 and 1, called bits. A group of 8 bits is called a byte and can represent 256 different values (from 0 to 255). All data—text, images, audio, video—gets broken down into these tiny on/off signals.
💡 Why Binary?
Think of a light switch: it’s either off (0) or on (1). Binary uses the same idea. It’s simple, reliable, and fits perfectly with electronic circuits that can easily detect two distinct voltage levels.
🔢 Binary Numbers
Each bit can be 0 or 1. The value of a binary number is calculated by adding powers of 2 for each bit that is 1. For example:
| Binary | Decimal |
|---|---|
| 0000 | 0 |
| 0001 | 1 |
| 0010 | 2 |
| 0011 | 3 |
| 0100 | 4 |
| 0101 | 5 |
| 0110 | 6 |
| 0111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
📝 Representing Text: ASCII
ASCII (American Standard Code for Information Interchange) assigns a decimal number to each character. For example, 'A' = 65, 'a' = 97. Here’s a quick reference:
| Character | Decimal | Binary |
|---|---|---|
| A | 65 | 01000001 |
| a | 97 | 01100001 |
| 0 | 48 | 00110000 |
| 9 | 57 | 00111001 |
| Space | 32 | 00100000 |
📷 Images, Audio & Video
All media is stored as numbers too:
- 📷 Images – a grid of pixels. Each pixel can be 8‑bit grayscale (0–255) or 24‑bit colour (8 bits each for Red, Green, Blue).
- 🎧 Audio – a sequence of samples. CD audio uses 16‑bit samples at 44.1 kHz.
- 📹 Video – frames of images plus audio, all encoded as binary data.
📝 Exam Tips
Tip 1: 1 bit = 2 states, 8 bits = 256 values. Use $2^n$ to find the range for any number of bits.
Tip 2: When converting decimal to binary, repeatedly divide by 2 and write down the remainders (bottom‑up).
Tip 3: For ASCII, remember common ranges: 65–90 for A–Z, 97–122 for a–z, 48–57 for 0–9, 32 for space.
Tip 4: Show step‑by‑step conversions in exam answers; this demonstrates understanding.
Tip 5: Practice converting between binary, decimal, and hexadecimal (base‑16) – many questions involve hex.
Revision
Log in to practice.