In: Computer Science
Assuming three-bit exponent field and four-bit significant, what is the bit pattern for 5.75
01010111 Explanation: ------------- 5.75 Converting 5.75 to binary Convert decimal part first, then the fractional part > First convert 5 to binary Divide 5 successively by 2 until the quotient is 0 > 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 101 So, 5 of decimal is 101 in binary > Now, Convert 0.75000000 to binary > 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.75 of decimal is .11 in binary so, 5.75 in binary is 00000101.11 5.75 in simple binary => 101.11 so, 5.75 in normal binary is 101.11 => 1.0111 * 2^2 8-bit format: -------------------- sign bit is 0(+ve) exponent bits are (3+2=5) => 101 Divide 5 successively by 2 until the quotient is 0 > 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 101 So, 5 of decimal is 101 in binary frac/significant bits are 0111 so, 5.75 in 8-bit format is 0 101 0111