Decimal-to-hexadecimal conversion Convert the decimal number 5238 (base 10) to base 16 (hexadecimal). Provide the hex digits without any prefix.

Difficulty: Easy

Correct Answer: 1476

Explanation:


Introduction / Context:
Converting decimal integers to hexadecimal is common in embedded systems, debugging, and memory address representation. Repeated division by 16 yields the hex digits from least significant to most significant.


Given Data / Assumptions:

  • Decimal input N = 5238.
  • Target base is 16 (digits 0–9, A–F).
  • No fractional part is present; result will be an integer in hex.


Concept / Approach:
Use repeated division by 16. Each remainder (0–15) maps to one hex digit (0–9, A–F). Collect remainders bottom-up to form the final hexadecimal string.


Step-by-Step Solution:

1) 5238 / 16 = 327 remainder 6 → least significant hex digit = 6.2) 327 / 16 = 20 remainder 7 → next digit = 7.3) 20 / 16 = 1 remainder 4 → next digit = 4.4) 1 / 16 = 0 remainder 1 → most significant digit = 1.5) Read remainders in reverse: 1 4 7 6 → 1476₁₆.


Verification / Alternative check:
Expand back to decimal: 116^3 + 416^2 + 7*16 + 6 = 4096 + 1024 + 112 + 6 = 5238, confirming correctness.


Why Other Options Are Wrong:

  • 1388: common confusion from base-10 division steps; does not re-expand to 5238.
  • 327.375 and 12.166: include decimal points; input was an integer.


Common Pitfalls:
Listing remainders in the forward order (top-down) instead of reverse order; mis-mapping remainders above 9 to A–F.


Final Answer:
1476

More Questions from Number Systems and Codes

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion