In: Computer Science
A) Convert 1101.11011101 x 223 to IEEE Standard 754 for single precision floating-point binary format.
B) Convert the IEEE Standard 754 number 11001010100011010101000000000000 to its decimal equivalent.
A) 01001100110111011101000000000000 B) -4630528.0 Explanation: ------------- 1) 1101.11011101 * 2^23 = 1.10111011101 * 2^26 single precision: -------------------- sign bit is 0(+ve) exponent bits are (127+26=153) => 10011001 Divide 153 successively by 2 until the quotient is 0 > 153/2 = 76, remainder is 1 > 76/2 = 38, remainder is 0 > 38/2 = 19, remainder is 0 > 19/2 = 9, remainder is 1 > 9/2 = 4, remainder is 1 > 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 10011001 So, 153 of decimal is 10011001 in binary frac/significant bits are 10111011101000000000000 Answer: 0 10011001 10111011101000000000000 2) 1 10010101 00011010101000000000000 sign bit is 1(-ve) exp bits are 10010101 Converting 10010101 to decimal 10010101 => 1x2^7+0x2^6+0x2^5+1x2^4+0x2^3+1x2^2+0x2^1+1x2^0 => 1x128+0x64+0x32+1x16+0x8+1x4+0x2+1x1 => 128+0+0+16+0+4+0+1 => 149 in decimal it is 149 so, exponent/bias is 149-127 = 22 frac bits are 00011010101 IEEE-754 Decimal value is 1.frac * 2^exponent IEEE-754 Decimal value is 1.00011010101 * 2^22 1.00011010101 in decimal is 1.10400390625 => 1.00011010101 => 1x2^0+0x2^-1+0x2^-2+0x2^-3+1x2^-4+1x2^-5+0x2^-6+1x2^-7+0x2^-8+1x2^-9+0x2^-10+1x2^-11 => 1x1+0x0.5+0x0.25+0x0.125+1x0.0625+1x0.03125+0x0.015625+1x0.0078125+0x0.00390625+1x0.001953125+0x0.0009765625+1x0.00048828125 => 1+0.0+0.0+0.0+0.0625+0.03125+0.0+0.0078125+0.0+0.001953125+0.0+0.00048828125 => 1.10400390625 so, 1.10400390625 * 2^22 in decimal is 4630528.0 so, 11001010100011010101000000000000 in IEEE-754 single precision format is -4630528.0 Answer: -4630528.0