Binary numbers are the foundation of computer systems and digital electronics. They use base-2, consisting of only two digits: 0 and 1.
Why Binary?
- Computers use binary because electrical circuits have two states: on (1) and off (0).
- Binary representation is simple and efficient for electronic hardware.
Binary vs. Decimal
| Decimal (Base 10) | Binary (Base 2) |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
| 8 | 1000 |
| 9 | 1001 |
Converting Between Binary and Decimal
Binary to Decimal
Each binary digit represents a power of 2, from right to left.
Example: Convert 1011 to decimal:1×23+0×22+1×21+1×20=8+0+2+1=111 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0 = 8 + 0 + 2 + 1 = 111×23+0×22+1×21+1×20=8+0+2+1=11
Decimal to Binary (Division Method)
Keep dividing by 2 and record the remainder until the quotient is 0.
Example: Convert 13 to binary:
- 13 ÷ 2 = 6, remainder = 1
- 6 ÷ 2 = 3, remainder = 0
- 3 ÷ 2 = 1, remainder = 1
- 1 ÷ 2 = 0, remainder = 1
Binary: 1101
Binary Arithmetic
Addition
| Binary | Result |
|---|---|
| 0 + 0 | 0 |
| 0 + 1 | 1 |
| 1 + 0 | 1 |
| 1 + 1 | 10 (carry 1) |
Example: 101 + 11
markdownCopyEdit 101
+ 011
------
1000
Subtraction (using borrowing rules)
Multiplication (like decimal multiplication)
Division (similar to long division in decimal)
Applications of Binary Numbers
- Computer Memory: Data storage and processing.
- Networking: IP addressing in binary.
- Digital Electronics: Designing logic circuits.
- Encoding: Images, audio, and text.