Number System Conversions : Binary, Decimal, Octal, Hexadecimal
Number System Conversions (Binary, Decimal, Octal, Hexadecimal) – Complete Beginner Guide (Part 2)
In Part 1, you learned about the four major number systems—Binary, Decimal, Octal, and Hexadecimal—their bases, characteristics, and real-world applications. Now it's time to learn the most important topic: Number System Conversions.
Number conversions are widely used in Computer Science, Digital Electronics, Operating Systems, Computer Architecture, Networking, Programming, and Cybersecurity. They are also one of the most frequently asked topics in DSSSB, SSC, Banking, Railway, GATE, NIELIT, and university examinations.
In this section, we will cover every major conversion method with detailed explanations and solved examples.
Understanding Number System Conversion
A number system conversion is the process of changing a number from one base to another while preserving its value.
For example:
Binary → Decimal
Decimal → Binary
Binary → Octal
Binary → Hexadecimal
Octal → Decimal
Hexadecimal → Binary
Although the representation changes, the numerical value remains the same.
1. Binary to Decimal Conversion
Method
Multiply each binary digit by the corresponding power of 2, starting from the rightmost digit (2⁰), and add all the results.
Formula
Decimal Value = Σ (Binary Digit × 2^Position)
Example 1
Convert 101101₂ into decimal.
| Binary Digit | Power of 2 | Calculation |
|---|---|---|
| 1 | 2⁵ = 32 | 32 |
| 0 | 2⁴ = 16 | 0 |
| 1 | 2³ = 8 | 8 |
| 1 | 2² = 4 | 4 |
| 0 | 2¹ = 2 | 0 |
| 1 | 2⁰ = 1 | 1 |
Total = 32 + 8 + 4 + 1 = 45
Answer: 101101₂ = 45₁₀
Example 2
Convert 11010₂ into decimal.
16 + 8 + 0 + 2 + 0 = 26
Answer: 11010₂ = 26₁₀
2. Decimal to Binary Conversion
Method
Repeatedly divide the decimal number by 2 and record the remainder. Read the remainders from bottom to top.
Example
Convert 25₁₀ into binary.
| Division | Quotient | Remainder |
|---|---|---|
| 25 ÷ 2 | 12 | 1 |
| 12 ÷ 2 | 6 | 0 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Reading upward:
11001₂
Answer: 25₁₀ = 11001₂
Example
Convert 58₁₀ into binary.
Division by 2 produces:
58 → 29 R0
29 → 14 R1
14 → 7 R0
7 → 3 R1
3 → 1 R1
1 → 0 R1
Reading upward:
111010₂
3. Binary to Octal Conversion
Method
Group binary digits into sets of 3 bits starting from the right.
Convert each group into its octal equivalent.
Binary to Octal Table
| Binary | Octal |
|---|---|
| 000 | 0 |
| 001 | 1 |
| 010 | 2 |
| 011 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
Example
Convert 110101101₂ into octal.
Grouping:
110 101 101
Now convert:
110 = 6
101 = 5
101 = 5
Answer: 655₈
4. Octal to Binary Conversion
Replace every octal digit with its 3-bit binary equivalent.
Example
Convert 527₈ into binary.
5 → 101
2 → 010
7 → 111
Final Answer:
101010111₂
5. Binary to Hexadecimal Conversion
Method
Group binary digits into 4 bits from the right.
Replace each group using the hexadecimal table.
Binary to Hexadecimal Table
| Binary | Hex |
|---|---|
| 0000 | 0 |
| 0001 | 1 |
| 0010 | 2 |
| 0011 | 3 |
| 0100 | 4 |
| 0101 | 5 |
| 0110 | 6 |
| 0111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | A |
| 1011 | B |
| 1100 | C |
| 1101 | D |
| 1110 | E |
| 1111 | F |
Example
Convert
111010101111₂
Grouping:
1110 1010 1111
1110 = E
1010 = A
1111 = F
Answer: EAF₁₆
6. Hexadecimal to Binary Conversion
Replace each hexadecimal digit with its 4-bit binary equivalent.
Example
Convert
3AF₁₆
3 → 0011
A → 1010
F → 1111
Final Answer:
001110101111₂
7. Decimal to Octal Conversion
Method
Repeatedly divide the decimal number by 8.
Read the remainders from bottom to top.
Example
Convert
100₁₀
100 ÷ 8 = 12 R4
12 ÷ 8 = 1 R4
1 ÷ 8 = 0 R1
Answer:
144₈
8. Octal to Decimal Conversion
Multiply each digit by the corresponding power of 8.
Example
Convert
725₈
Calculation:
7 × 8² = 448
2 × 8¹ = 16
5 × 8⁰ = 5
Total = 469
Answer:
725₈ = 469₁₀
9. Decimal to Hexadecimal Conversion
Method
Repeatedly divide by 16.
Convert remainders greater than 9 into A–F.
Example
Convert
254₁₀
254 ÷16 =15 R14
15 ÷16 =0 R15
15 = F
14 = E
Answer:
FE₁₆
10. Hexadecimal to Decimal Conversion
Multiply each hexadecimal digit by powers of 16.
Example
Convert
2AF₁₆
2 ×16² =512
A =10 ×16¹ =160
F =15 ×16⁰ =15
Total:
512 +160 +15 = 687
Shortcut Conversion Techniques
Some conversions can be completed instantly.
Binary ↔ Octal
Group bits into 3s.
Binary ↔ Hexadecimal
Group bits into 4s.
These methods avoid lengthy calculations and are commonly used in competitive exams.
Complete Conversion Flow
Binary ↔ Decimal
Binary ↔ Octal
Binary ↔ Hexadecimal
Decimal ↔ Octal
Decimal ↔ Hexadecimal
Octal ↔ Binary
Hexadecimal ↔ Binary
Binary acts as the bridge between all major number systems.
Practical Example
Suppose a programmer receives the hexadecimal memory address:
0x2A
To understand its binary value:
2 = 0010
A = 1010
Binary:
00101010₂
Decimal:
42
This conversion helps programmers debug software and analyze memory efficiently.
Tips for Fast Exam Calculations
Learn powers of 2 up to 2¹⁶.
Memorise binary-octal equivalents.
Memorise binary-hexadecimal equivalents.
Practice repeated division methods.
Always verify the base before converting.
Group bits from the right-hand side.
Mini Summary
Number system conversions become easy once you understand the relationship between different bases. Binary acts as the foundation, while octal and hexadecimal provide shorter representations. Mastering these conversion techniques is essential for programming, networking, digital electronics, and competitive examinations.
Quick Revision Notes
Binary → Decimal → Multiply by powers of 2.
Decimal → Binary → Divide by 2 repeatedly.
Binary → Octal → Group into 3 bits.
Octal → Binary → Replace each digit with 3 bits.
Binary → Hexadecimal → Group into 4 bits.
Hexadecimal → Binary → Replace each digit with 4 bits.
Decimal → Octal → Divide by 8.
Octal → Decimal → Multiply by powers of 8.
Decimal → Hexadecimal → Divide by 16.
Hexadecimal → Decimal → Multiply by powers of 16.
Part 2 Conclusion
You have now learned all the essential number system conversion techniques, including Binary, Decimal, Octal, and Hexadecimal conversions, along with shortcut methods and solved examples. These concepts form the foundation of computer programming, digital electronics, networking, and computer architecture.
In Part 3, we will explore real-world applications of number systems, practical examples, advantages, limitations, best practices, common mistakes, interview questions, and competitive exam MCQs, helping you understand where these conversions are used in modern computing and technology.
Author Bio
About the Author
The author is a Computer Science and Cybersecurity content writer focused on creating beginner-friendly educational resources for students, networking professionals, cybersecurity enthusiasts, and competitive exam aspirants. Areas of expertise include Network Security, Cybersecurity Fundamentals, Operating Systems, DBMS, Computer Networks, and Emerging Security Technologies.
References
Recommended resources for further learning:
NIST Cybersecurity Framework
Cybersecurity and Infrastructure Security Agency (CISA)
RFC Security Standards
Cisco Security Documentation
Fortinet Security Guides
Palo Alto Networks Documentation
Comments
Post a Comment