Decimal to Binary Floating-Point Conversion

This Demonstration shows the conversion of a decimal number (base 10) to a floating-point binary format.

SNAPSHOTS

  • [Snapshot]
  • [Snapshot]
  • [Snapshot]

DETAILS

The total number of bits used for the representation is equal to



As an example, how would 54.75 be represented when four bits are used for the mantissa and three bits are used for the exponent?
Both the number and the exponent are positive.
As the number is normalized to lie between 1 and 2 (the interval being half-closed at the bottom and half-open at the top), the leading binary digit is always 1. So we do not actually use it in the representation of the mantissa. Hence the mantissa bits are 1011. Moreover the exponent bits are 101, the sign of the number bit is 0, and the sign of the exponent bit is 0.
Therefore the representation is .
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.