In: Computer Science
Convert the decimal floating point value 8.125 to a 12 bit binary floating point value. Use a sign bit, 3 bits (excess 3) for the exponent and an 8 bit significand. Enter just a 12 digit binary value ( e.g. 0 000 11110000 ) spaces ignored.
Converting 8.125 to binary Convert decimal part first, then the fractional part > First convert 8 to binary Divide 8 successively by 2 until the quotient 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 1000 So, 8 of decimal is 1000 in binary > Now, Convert 0.125 to binary > Multiply 0.125 with 2. Since 0.25 is < 1. then add 0 to result > Multiply 0.25 with 2. Since 0.5 is < 1. then add 0 to result > Multiply 0.5 with 2. Since 1.0 is >= 1. then add 1 to result > This is equal to 1, so, stop calculating 0.125 of decimal is .001 in binary so, 8.125 in binary is 1000.001 8.125 in simple binary => 1000.001 so, 8.125 in normal binary is 1000.001 => 1.000001 * 2^3 12-bit format: ---------------- sign bit is 0(+ve) exp bits are (3+3=6) => 110 frac bits are 00000100 so, 8.125 in 12-bit format format is 0 110 00000100 Answer: 0 110 00000100