Number systems are the foundation of all computing systems. Computers do not understand letters or words — everything is ultimately converted into numbers, specifically binary numbers. In this blog, you'll learn about four important number systems used in computer science and how to convert between them.
🔹 What is a Number System?
A number system is a way to represent numbers using a set of symbols (digits). Each system has a base (or radix) which determines how many digits it uses.
📊 Types of Number Systems
Number System | Base | Digits Used | Example |
---|---|---|---|
Binary | 2 | 0, 1 | 10112 |
Octal | 8 | 0–7 | 758 |
Decimal | 10 | 0–9 | 9310 |
Hexadecimal | 16 | 0–9, A–F | 3F16 |
🔄 Number System Conversions
➡️ Decimal to Binary
Method: Divide the number by 2 repeatedly and write down the remainders in reverse order.
Example: Convert 1310 to Binary
- 13 ÷ 2 = 6, remainder 1
- 6 ÷ 2 = 3, remainder 0
- 3 ÷ 2 = 1, remainder 1
- 1 ÷ 2 = 0, remainder 1
Binary: 11012
➡️ Binary to Decimal
Method: Multiply each bit by 2position from right to left, and add.
Example: Convert 10102 to Decimal
- 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10
➡️ Decimal to Octal
Method: Divide the number by 8 repeatedly and reverse the remainders.
Example: Convert 6510 to Octal
- 65 ÷ 8 = 8, remainder 1
- 8 ÷ 8 = 1, remainder 0
- 1 ÷ 8 = 0, remainder 1
Octal: 1018
➡️ Decimal to Hexadecimal
Method: Divide by 16 and convert remainders (10–15 → A–F).
Example: Convert 25410 to Hex
- 254 ÷ 16 = 15, remainder 14 → E
- 15 ÷ 16 = 0, remainder 15 → F
Hex: FE16
➡️ Binary to Octal & Hex
Group binary digits:
- To Octal: Group in 3 bits from right
- To Hex: Group in 4 bits from right
Example: Convert 11010112
- To Octal: 001 101 011 = 1 5 3 → 1538
- To Hex: 0110 1011 = 6 B → 6B16
📝 Summary
- Binary (Base-2), Octal (Base-8), Decimal (Base-10), and Hexadecimal (Base-16) are the key number systems.
- Conversions are crucial for understanding how data is processed and stored in computers.
- Practice is key! Use division and grouping methods for accuracy.
💡 Tip: Use scientific calculators or online tools to double-check your conversions. But don’t forget to practice manually for exams!
Numbers never lie — and in computers, they speak louder than words! 💻🔢