In: Computer Science
Convert 1.67e14 to the 32-bit IEEE 754 Floating Point Standard, with the following layout: first bit is sign bit, next 8 bits is exponent field, and remaining 23 bits is mantissa field; result is to be in hexadecimal and not to be rounded up.
answer choices
5717E27B
57172EB7
5717E2B7
C717E2B7
5771E2B7
Answer: -------- c) 5717E2B7 Explanation: ------------- Converting 167000000000000.0 to binary Convert decimal part first, then the fractional part > First convert 167000000000000 to binary Divide 167000000000000 successively by 2 until the quotient is 0 > 167000000000000/2 = 83500000000000, remainder is 0 > 83500000000000/2 = 41750000000000, remainder is 0 > 41750000000000/2 = 20875000000000, remainder is 0 > 20875000000000/2 = 10437500000000, remainder is 0 > 10437500000000/2 = 5218750000000, remainder is 0 > 5218750000000/2 = 2609375000000, remainder is 0 > 2609375000000/2 = 1304687500000, remainder is 0 > 1304687500000/2 = 652343750000, remainder is 0 > 652343750000/2 = 326171875000, remainder is 0 > 326171875000/2 = 163085937500, remainder is 0 > 163085937500/2 = 81542968750, remainder is 0 > 81542968750/2 = 40771484375, remainder is 0 > 40771484375/2 = 20385742187, remainder is 1 > 20385742187/2 = 10192871093, remainder is 1 > 10192871093/2 = 5096435546, remainder is 1 > 5096435546/2 = 2548217773, remainder is 0 > 2548217773/2 = 1274108886, remainder is 1 > 1274108886/2 = 637054443, remainder is 0 > 637054443/2 = 318527221, remainder is 1 > 318527221/2 = 159263610, remainder is 1 > 159263610/2 = 79631805, remainder is 0 > 79631805/2 = 39815902, remainder is 1 > 39815902/2 = 19907951, remainder is 0 > 19907951/2 = 9953975, remainder is 1 > 9953975/2 = 4976987, remainder is 1 > 4976987/2 = 2488493, remainder is 1 > 2488493/2 = 1244246, remainder is 1 > 1244246/2 = 622123, remainder is 0 > 622123/2 = 311061, remainder is 1 > 311061/2 = 155530, remainder is 1 > 155530/2 = 77765, remainder is 0 > 77765/2 = 38882, remainder is 1 > 38882/2 = 19441, remainder is 0 > 19441/2 = 9720, remainder is 1 > 9720/2 = 4860, remainder is 0 > 4860/2 = 2430, remainder is 0 > 2430/2 = 1215, remainder is 0 > 1215/2 = 607, remainder is 1 > 607/2 = 303, remainder is 1 > 303/2 = 151, remainder is 1 > 151/2 = 75, remainder is 1 > 75/2 = 37, remainder is 1 > 37/2 = 18, remainder is 1 > 18/2 = 9, remainder is 0 > 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 100101111110001010110111101011010111000000000000 So, 167000000000000 of decimal is 100101111110001010110111101011010111000000000000 in binary > Now, Convert 0.00000000 to binary > Multiply 0.00000000 with 2. Since 0.00000000 is < 1. then add 0 to result > This is equal to 1, so, stop calculating 0.0 of decimal is .0 in binary so, 167000000000000.0 in binary is 100101111110001010110111101011010111000000000000.0 167000000000000.0 in simple binary => 100101111110001010110111101011010111000000000000.0 so, 167000000000000.0 in normal binary is 100101111110001010110111101011010111000000000000.0 => 1.00101111110001010110111 * 2^47 single precision: -------------------- sign bit is 0(+ve) exp bits are (127+47=174) => 10101110 Divide 174 successively by 2 until the quotient is 0 > 174/2 = 87, remainder is 0 > 87/2 = 43, remainder is 1 > 43/2 = 21, remainder is 1 > 21/2 = 10, remainder is 1 > 10/2 = 5, remainder 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 10101110 So, 174 of decimal is 10101110 in binary frac bits are 00101111110001010110111 so, 167000000000000.0 in single-precision format is 0 10101110 00101111110001010110111 in hexadecimal it is 0x5717E2B7