In C and computer architecture contexts, what is the binary representation of the decimal number 5.375? Express the integer and fractional parts correctly in base-2 form.

Difficulty: Easy

Correct Answer: 101.011

Explanation:


Introduction:
Converting decimal fractions to binary requires handling the integer and fractional parts separately. This question evaluates understanding of binary conversion for a mixed number (integer plus fraction).


Given Data / Assumptions:

  • Decimal number: 5.375
  • Base required: 2 (binary)
  • No rounding; exact representation is expected.


Concept / Approach:
Split the number into integer and fractional parts. Convert the integer by repeated division by 2. Convert the fraction by repeated multiplication by 2, collecting integer bits in order. Then combine with a binary point.


Step-by-Step Solution:
1) Separate: 5.375 = 5 + 0.375.2) Integer 5 to binary: 5 / 2 = 2 remainder 1; 2 / 2 = 1 remainder 0; 1 / 2 = 0 remainder 1. Reading remainders upward gives 101.3) Fraction 0.375: multiply by 2 repeatedly.0.375 * 2 = 0.75 → bit 00.75 * 2 = 1.5 → bit 1, carry 1, keep fraction 0.50.5 * 2 = 1.0 → bit 1, fraction becomes 0 → stopThus fractional bits are 011.4) Combine: integer 101 and fraction 011 → 101.011.


Verification / Alternative check:
Convert back: 101.011 = 14 + 02 + 11 + 00.5 + 10.25 + 10.125 = 4 + 0 + 1 + 0 + 0.25 + 0.125 = 5.375, which matches exactly.


Why Other Options Are Wrong:
101.101110111: Incorrect fractional bits; evaluates to a different decimal value.101011: Lacks a binary point and mixes integer-only representation; equals 43 decimal.None of above: Incorrect because 101.011 is correct.


Common Pitfalls:
For fractions, do not divide by 2; instead multiply by 2 and record the integer parts in sequence. Avoid rounding when an exact finite binary exists, as with denominators that are powers of 2 (0.375 = 3/8).


Final Answer:
101.011

More Questions from Floating Point Issues

Discussion & Comments

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