How to Convert Binary to Floating Point

You must first convert the binary number to scientific notation before converting to a single, or double, precision floating point. A single precision floating point is composed of 32 bits, and a double precision is 64 bits. Each of these is broken up into three sections: single precision is one bit, eight bits and 23 bits; second precision is one bit, 11 bits and 52 bits. These sections are called the sign field, exponent field and mantissa, or "significand," field, respectively.

Instructions

    • 1

      Convert the binary number to scientific notation. This works the same way as converting a whole number, except, instead of a 10-based system, you are using a 2-based system. Example: the binary number 11001101 converts to 1.1001101 X 2 to the 7th.

    • 2

      Assign the single bit into the sign field. A "0" indicates the number is positive, and a "1" indicates a negative number. For the example, you will place a "0" in the sign field, because it is a positive number.

    • 3

      Add the binary number to represent the exponent in the exponent field. A value is added to the exponent to cover the full range of negative and positive numbers. A single precision floating point requires the addition of the number 127 to the exponent, while a double precision will add 1,023. In the example, the number to convert to binary is 127 + 7 = 134 for single, or 1,023 + 7 = 1,030 for double precision points. So, the binary number for a single precision point is 10000110, and for a double precision point is 10000000110.

    • 4

      Add the actual binary number into the mantissa field. There is one thing different about binary than any other number system: the first number is always a "1." No exception to this rule. So, the "1" at the beginning of the number is not added to the mantissa field; it is an already known value, without exception. You will add 10011010000000000000000 to the single precision floating point, and 1001101000000000000000000000000000000000000000000000 for a double precision. You add your number and add zeroes for the remaining number of bits in the mantissa field.

    • 5

      Place the numbers from the three fields together to create the floating point.

      Single: 0 10000110 10011010000000000000000

      Double: 0 10000000110 1001101000000000000000000000000000000000000000000000

Learnify Hub © www.0685.com All Rights Reserved