To convert a decimal number to IEEE floating-point representation:

  1. Find binary representation of the decimal number.
  2. Multiply by so that we now have (just like scientific notation, except the base is 2).
  3. Try to put number in the form 1.m (m = mantissa; base-2 scientific notation) by increasing or decreasing the exponent field and moving the decimal (binary?) point accordingly.
  4. The floating-point exponent field is the current exponent (on ) but plus 127. We need to do this since in IEEE representation, 2 is raised to the power of .
  5. Zero-pad the mantissa on the right if its length is fewer than 23 bits.
  6. Set the sign bit to 1 if original number is negative.
  7. Concatenate sign, exponent, and mantissa bits to get your floating-point representation of the decimal number.