In: Computer Science
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754 standard is
1 10000010 01101100000000000000000 Explanation: ------------- -11.375 Converting 11.375 to binary Convert decimal part first, then the fractional part > First convert 11 to binary Divide 11 successively by 2 until the quotient is 0 > 11/2 = 5, remainder is 1 > 5/2 = 2, remainder is 1 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 1011 So, 11 of decimal is 1011 in binary > Now, Convert 0.37500000 to binary > Multiply 0.37500000 with 2. Since 0.75000000 is < 1. then add 0 to result > Multiply 0.75000000 with 2. Since 1.50000000 is >= 1. then add 1 to result > Multiply 0.50000000 with 2. Since 1.00000000 is >= 1. then add 1 to result > This is equal to 1, so, stop calculating 0.375 of decimal is .011 in binary so, 11.375 in binary is 00001011.011 -11.375 in simple binary => 1011.011 so, -11.375 in normal binary is 1011.011 => 1.011011 * 2^3 single precision: -------------------- sign bit is 1(-ve) exponent bits are (127+3=130) => 10000010 Divide 130 successively by 2 until the quotient is 0 > 130/2 = 65, remainder is 0 > 65/2 = 32, remainder is 1 > 32/2 = 16, remainder is 0 > 16/2 = 8, remainder is 0 > 8/2 = 4, remainder is 0 > 4/2 = 2, remainder is 0 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 10000010 So, 130 of decimal is 10000010 in binary frac/significant bits are 01101100000000000000000 so, -11.375 in single-precision format is 1 10000010 01101100000000000000000