Number System in Computers
A number system is a way to represent numbers using digits or symbols in a consistent manner. In computers, data is represented using different number systems, most importantly the binary system. Below are the commonly used number systems in computing:
1. Binary Number System (Base-2)
- Digits used:
0, 1
- Base: 2
- Use: All data in computers (text, images, audio) is ultimately stored and processed in binary.
- Example:
Decimal5
= Binary101
2. Decimal Number System (Base-10)
- Digits used:
0 to 9
- Base: 10
- Use: This is the number system used by humans in everyday life.
- Example:
Decimal123
means:
(1×10²) + (2×10¹) + (3×10⁰) = 100 + 20 + 3
3. Octal Number System (Base-8)
- Digits used:
0 to 7
- Base: 8
- Use: Sometimes used in older computer systems and shorthand for binary.
- Example:
Binary101110
= Octal56
4. Hexadecimal Number System (Base-16)
- Digits used:
0 to 9
andA to F
(where A=10, B=11,...F=15) - Base: 16
- Use: Compact representation of binary numbers, widely used in programming and digital electronics.
- Example:
Binary11111111
= HexadecimalFF
Conversion Example:
Let’s convert Decimal 25
to Binary:
- Divide by 2 repeatedly and record the remainders:
25 ÷ 2 = 12 remainder 1 12 ÷ 2 = 6 remainder 0 6 ÷ 2 = 3 remainder 0 3 ÷ 2 = 1 remainder 1 1 ÷ 2 = 0 remainder 1
- Binary =
11001
Summary Table:
Number System | Base | Digits Used | Example (Decimal 15) |
---|---|---|---|
Binary | 2 | 0, 1 | 1111 |
Decimal | 10 | 0–9 | 15 |
Octal | 8 | 0–7 | 17 |
Hexadecimal | 16 | 0–9, A–F | F |
No comments:
Post a Comment