Converting Decimal Numbers to Hexadecimal

Sep 16, 2024

Converting Decimal to Hexadecimal

Overview

  • Decimal number system is base 10 (digits 0-9).
  • Hexadecimal number system is base 16 (digits 0-9 and letters A-F).

Hexadecimal Correspondences

  • Decimal to Hexadecimal conversions:
    • 0 = 0
    • 1 = 1
    • 2 = 2
    • 3 = 3
    • 4 = 4
    • 5 = 5
    • 6 = 6
    • 7 = 7
    • 8 = 8
    • 9 = 9
    • 10 = A
    • 11 = B
    • 12 = C
    • 13 = D
    • 14 = E
    • 15 = F

Conversion Process

Using a Calculator

  1. Example 1: Convert 479

    • Divide 479 by 16 → 29.9375
    • Integer part: 29, Remainder: 15 (F)
    • Divide 29 by 16 → 1.8125
    • Integer part: 1, Remainder: 13 (D)
    • Divide 1 by 16 → 0.0625
    • Integer part: 0, Remainder: 1
    • Result: 479 = 1DF (base 16)
  2. Example 2: Convert 894

    • Divide 894 by 16 → 55.875
    • Remainder: 14 (E)
    • Divide 55 by 16 → 3.4375
    • Remainder: 7
    • Divide 3 by 16 → 0.1875
    • Remainder: 3
    • Result: 894 = 37E (base 16)

Without a Calculator (Long Division)

  1. Example 3: Convert 3284

    • 3284 ÷ 16 → 205 remainder 4
    • 205 ÷ 16 → 12 remainder 13 (D)
    • 12 ÷ 16 → 0 remainder 12 (C)
    • Result: 3284 = CD4 (base 16)
  2. Example 4: Convert 7956

    • 7956 ÷ 16 → 497 remainder 4
    • 497 ÷ 16 → 31 remainder 1
    • 31 ÷ 16 → 1 remainder 15 (F)
    • 1 ÷ 16 → 0 remainder 1
    • Result: 7956 = 1F14 (base 16)
  3. Example 5: Convert 14259

    • Using calculator:
      • 14259 ÷ 16 → 891 remainder 3
      • 891 ÷ 16 → 55 remainder 11 (B)
      • 55 ÷ 16 → 3 remainder 7
      • 3 ÷ 16 → 0 remainder 3
      • Result: 14259 = 37B3 (base 16)
    • Without calculator:
      • 14259 ÷ 16 → 891 remainder 3
      • 891 ÷ 16 → 55 remainder 11 (B)
      • 55 ÷ 16 → 3 remainder 7
      • 3 ÷ 16 → 0 remainder 3
      • Result: 14259 = 37B3 (base 16)

Conclusion

  • Understanding both methods of conversion is essential for handling decimal to hexadecimal transformations efficiently.