Skip to main content

πŸ”’ Binary-Denary Conversion

πŸ”’ Converting Between Number Systems

Binary (base-2) and denary (base-10) are two different number systems used in computing. Understanding how to convert between these systems is fundamental to computer science and digital information processing.

Number Systems Overview​

πŸ”Ÿ Denary (Base-10)​

  • The number system we use daily
  • Uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Position values are powers of 10 (10^0, 10^1, 10^2, etc.)
  • Example: 425 = 4Γ—10^2 + 2Γ—10^1 + 5Γ—10^0 = 400 + 20 + 5

0️⃣1️⃣ Binary (Base-2)​

  • The number system used by computers
  • Uses only 2 digits: 0 and 1 (called bits)
  • Position values are powers of 2 (2^0, 2^1, 2^2, etc.)
  • Example: 1011 = 1Γ—2^3 + 0Γ—2^2 + 1Γ—2^1 + 1Γ—2^0 = 8 + 0 + 2 + 1 = 11

πŸ”„ Converting Binary to Denary​

To convert a binary number to denary:

  1. Identify the position value of each bit (powers of 2 from right to left)
  2. Multiply each bit by its position value
  3. Sum all the results

Example 1: Convert 1010β‚‚ to denary​

1    0    1    0
↓ ↓ ↓ ↓
2^3 2^2 2^1 2^0
8 4 2 1
↓ ↓ ↓ ↓
1Γ—8 0Γ—4 1Γ—2 0Γ—1
8 0 2 0

Sum: 8 + 0 + 2 + 0 = 10₁₀

Example 2: Convert 11001β‚‚ to denary​

1     1     0     0     1
↓ ↓ ↓ ↓ ↓
2^4 2^3 2^2 2^1 2^0
16 8 4 2 1
↓ ↓ ↓ ↓ ↓
1Γ—16 1Γ—8 0Γ—4 0Γ—2 1Γ—1
16 8 0 0 1

Sum: 16 + 8 + 0 + 0 + 1 = 25₁₀

πŸ”„ Converting Denary to Binary​

To convert a denary number to binary:

  1. Divide the number by 2
  2. Record the remainder (0 or 1)
  3. Continue dividing the quotient by 2 until the quotient becomes 0
  4. Read the remainders from bottom to top to get the binary number

Example 1: Convert 13₁₀ to binary​

Division    Quotient    Remainder
13 Γ· 2 6 1
6 Γ· 2 3 0
3 Γ· 2 1 1
1 Γ· 2 0 1

Reading remainders from bottom to top: 1101β‚‚

Example 2: Convert 42₁₀ to binary​

Division    Quotient    Remainder
42 Γ· 2 21 0
21 Γ· 2 10 1
10 Γ· 2 5 0
5 Γ· 2 2 1
2 Γ· 2 1 0
1 Γ· 2 0 1

Reading remainders from bottom to top: 101010β‚‚

πŸ’‘ Alternative Method: Powers of 2​

Another way to convert denary to binary is using powers of 2:

  1. Find the largest power of 2 less than or equal to the number
  2. Subtract this power of 2 from the number
  3. Continue with the remainder, finding the next largest power of 2
  4. Mark 1 for each power of 2 used, and 0 for those not used

Example: Convert 25₁₀ to binary​

  • Largest power of 2 ≀ 25 is 16 (2^4)
  • 25 - 16 = 9
  • Largest power of 2 ≀ 9 is 8 (2^3)
  • 9 - 8 = 1
  • Largest power of 2 ≀ 1 is 1 (2^0)
  • 1 - 1 = 0
  • Powers used: 2^4, 2^3, 2^0
  • Binary representation: 11001β‚‚

πŸ”Œ Practical Applications​

Understanding binary-denary conversion is essential for:

  • πŸ’Ύ Interpreting binary data in computers
  • 🧠 Understanding memory addresses and data storage
  • πŸ’» Programming at the machine level
  • ⚑ Working with digital logic and circuits
  • πŸ”§ Troubleshooting computer systems

These conversion skills form the foundation for more advanced topics in computer science and digital systems.