2.2 Binary Number System
Introduction to Binary
The binary number system is the foundation of all modern computing systems. It's a base-2 number system that uses only two digits: 0 and 1. Each digit in a binary number is called a bit (binary digit).
Why Binary?
Computers use binary because it's easier to create physical devices that can distinguish between two states (on/off, high/low voltage) rather than multiple states. This makes binary systems more reliable and easier to implement in hardware.
Understanding Binary Numbers
Binary Place Values
Just like in the decimal system, each position in a binary number represents a power of 2:
| Position (from right) | Power of 2 | Decimal Value |
|---|---|---|
| 1st | 20 | 1 |
| 2nd | 21 | 2 |
| 3rd | 22 | 4 |
| 4th | 23 | 8 |
| 5th | 24 | 16 |
| 6th | 25 | 32 |
| 7th | 26 | 64 |
| 8th | 27 | 128 |
Example: Converting Binary to Decimal
Let's convert the binary number 10112 to decimal:
1 0 1 1
│ │ │ └─ 1 × 20 = 1 × 1 = 1
│ │ └─── 1 × 21 = 1 × 2 = 2
│ └───── 0 × 22 = 0 × 4 = 0
└─────── 1 × 23 = 1 × 8 = 8
Total = 8 + 0 + 2 + 1 = 1110
Key Binary Concepts
Bytes and Nibbles
- Bit: A single binary digit (0 or 1)
- Nibble: 4 bits (e.g., 1010)
- Byte: 8 bits (e.g., 10101010)
- Word: Typically 16, 32, or 64 bits, depending on the computer architecture
Common Binary Prefixes
| Name | Symbol | Value (Bytes) |
|---|---|---|
| Kilobyte | KB | 1,024 |
| Megabyte | MB | 1,048,576 |
| Gigabyte | GB | 1,073,741,824 |
| Terabyte | TB | 1,099,511,627,776 |