Question

In: Computer Science

Convert the following decimal numbers into their 32-bit floating point representation (IEEE single precision). You may...

Convert the following decimal numbers into their 32-bit floating point representation (IEEE single precision). You may use a calculator to do the required multiplications, but you must show your work, not just the solution.

1. -59.75 (ANSW: 11000010011011110000000000000000)

2. 0.3 (ANSW: 00111110100110011001100110011010 (rounded)
00111110100110011001100110011001 (truncated; either answer is fine))

Please show all work

Solutions

Expert Solution

1)
Converting 59.75 to binary
   Convert decimal part first, then the fractional part
   > First convert 59 to binary
   Divide 59 successively by 2 until the quotient is 0
      > 59/2 = 29, remainder is 1
      > 29/2 = 14, remainder is 1
      > 14/2 = 7, remainder is 0
      > 7/2 = 3, remainder is 1
      > 3/2 = 1, remainder is 1
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 111011
   So, 59 of decimal is 111011 in binary
   > Now, Convert 0.75 to binary
      > Multiply 0.75 with 2.    Since 1.5 is >= 1. then add 1 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.75 of decimal is .11 in binary
   so, 59.75 in binary is 111011.11
-59.75 in simple binary => 111011.11
so, -59.75 in normal binary is 111011.11 => 1.1101111 * 2^5

single precision:
--------------------
sign bit is 1(-ve)
exp bits are (127+5=132) => 10000100
   Divide 132 successively by 2 until the quotient is 0
      > 132/2 = 66, remainder is 0
      > 66/2 = 33, remainder is 0
      > 33/2 = 16, remainder is 1
      > 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 10000100
   So, 132 of decimal is 10000100 in binary
frac bits are 11011110000000000000000

so, -59.75 in single-precision format is 1 10000100 11011110000000000000000
in hexadecimal it is 0xC26F0000

2)
Converting 0.3 to binary
   Convert decimal part first, then the fractional part
   > First convert 0 to binary
   Divide 0 successively by 2 until the quotient is 0
   Read remainders from the bottom to top as 
   So, 0 of decimal is  in binary
   > Now, Convert 0.3 to binary
      > Multiply 0.3 with 2.     Since 0.6 is < 1. then add 0 to result
      > Multiply 0.6 with 2.     Since 1.2 is >= 1. then add 1 to result
      > Multiply 0.19999999999999996 with 2.     Since 0.3999999999999999 is < 1. then add 0 to result
      > Multiply 0.3999999999999999 with 2.  Since 0.7999999999999998 is < 1. then add 0 to result
      > Multiply 0.7999999999999998 with 2.  Since 1.5999999999999996 is >= 1. then add 1 to result
      > Multiply 0.5999999999999996 with 2.  Since 1.1999999999999993 is >= 1. then add 1 to result
      > Multiply 0.1999999999999993 with 2.  Since 0.3999999999999986 is < 1. then add 0 to result
      > Multiply 0.3999999999999986 with 2.  Since 0.7999999999999972 is < 1. then add 0 to result
      > Multiply 0.7999999999999972 with 2.  Since 1.5999999999999943 is >= 1. then add 1 to result
      > Multiply 0.5999999999999943 with 2.  Since 1.1999999999999886 is >= 1. then add 1 to result
      > Multiply 0.19999999999998863 with 2.     Since 0.39999999999997726 is < 1. then add 0 to result
      > Multiply 0.39999999999997726 with 2.     Since 0.7999999999999545 is < 1. then add 0 to result
      > Multiply 0.7999999999999545 with 2.  Since 1.599999999999909 is >= 1. then add 1 to result
      > Multiply 0.599999999999909 with 2.   Since 1.199999999999818 is >= 1. then add 1 to result
      > Multiply 0.1999999999998181 with 2.  Since 0.3999999999996362 is < 1. then add 0 to result
      > Multiply 0.3999999999996362 with 2.  Since 0.7999999999992724 is < 1. then add 0 to result
      > Multiply 0.7999999999992724 with 2.  Since 1.5999999999985448 is >= 1. then add 1 to result
      > Multiply 0.5999999999985448 with 2.  Since 1.1999999999970896 is >= 1. then add 1 to result
      > Multiply 0.19999999999708962 with 2.     Since 0.39999999999417923 is < 1. then add 0 to result
      > Multiply 0.39999999999417923 with 2.     Since 0.7999999999883585 is < 1. then add 0 to result
      > Multiply 0.7999999999883585 with 2.  Since 1.599999999976717 is >= 1. then add 1 to result
      > Multiply 0.5999999999767169 with 2.  Since 1.1999999999534339 is >= 1. then add 1 to result
      > Multiply 0.19999999995343387 with 2.     Since 0.39999999990686774 is < 1. then add 0 to result
      > Multiply 0.39999999990686774 with 2.     Since 0.7999999998137355 is < 1. then add 0 to result
      > Multiply 0.7999999998137355 with 2.  Since 1.599999999627471 is >= 1. then add 1 to result
      > Multiply 0.599999999627471 with 2.   Since 1.199999999254942 is >= 1. then add 1 to result
      > Multiply 0.19999999925494194 with 2.     Since 0.3999999985098839 is < 1. then add 0 to result
      > Multiply 0.3999999985098839 with 2.  Since 0.7999999970197678 is < 1. then add 0 to result
      > Multiply 0.7999999970197678 with 2.  Since 1.5999999940395355 is >= 1. then add 1 to result
      > Multiply 0.5999999940395355 with 2.  Since 1.199999988079071 is >= 1. then add 1 to result
      > Multiply 0.19999998807907104 with 2.     Since 0.3999999761581421 is < 1. then add 0 to result
      > Multiply 0.3999999761581421 with 2.  Since 0.7999999523162842 is < 1. then add 0 to result
      > Multiply 0.7999999523162842 with 2.  Since 1.5999999046325684 is >= 1. then add 1 to result
      > Multiply 0.5999999046325684 with 2.  Since 1.1999998092651367 is >= 1. then add 1 to result
      > Multiply 0.19999980926513672 with 2.     Since 0.39999961853027344 is < 1. then add 0 to result
      > Multiply 0.39999961853027344 with 2.     Since 0.7999992370605469 is < 1. then add 0 to result
      > Multiply 0.7999992370605469 with 2.  Since 1.5999984741210938 is >= 1. then add 1 to result
      > Multiply 0.5999984741210938 with 2.  Since 1.1999969482421875 is >= 1. then add 1 to result
      > Multiply 0.1999969482421875 with 2.  Since 0.399993896484375 is < 1. then add 0 to result
      > Multiply 0.399993896484375 with 2.   Since 0.79998779296875 is < 1. then add 0 to result
      > Multiply 0.79998779296875 with 2.    Since 1.5999755859375 is >= 1. then add 1 to result
      > Multiply 0.5999755859375 with 2.     Since 1.199951171875 is >= 1. then add 1 to result
      > Multiply 0.199951171875 with 2.  Since 0.39990234375 is < 1. then add 0 to result
      > Multiply 0.39990234375 with 2.   Since 0.7998046875 is < 1. then add 0 to result
      > Multiply 0.7998046875 with 2.    Since 1.599609375 is >= 1. then add 1 to result
      > Multiply 0.599609375 with 2.     Since 1.19921875 is >= 1. then add 1 to result
      > Multiply 0.19921875 with 2.  Since 0.3984375 is < 1. then add 0 to result
      > Multiply 0.3984375 with 2.   Since 0.796875 is < 1. then add 0 to result
      > Multiply 0.796875 with 2.    Since 1.59375 is >= 1. then add 1 to result
      > Multiply 0.59375 with 2.     Since 1.1875 is >= 1. then add 1 to result
      > Multiply 0.1875 with 2.  Since 0.375 is < 1. then add 0 to result
      > Multiply 0.375 with 2.   Since 0.75 is < 1. then add 0 to result
      > Multiply 0.75 with 2.    Since 1.5 is >= 1. then add 1 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.3 of decimal is .010011001100110011001100110011001100110011001100110011 in binary
   so, 0.3 in binary is .010011001100110011001100110011001100110011001100110011
0.3 in simple binary => .010011001100110011001100110011001100110011001100110011
so, 0.3 in normal binary is .010011001100110011001100110011001100110011001100110011 => 1.00110011001100110011001 * 2^-2

single precision:
--------------------
sign bit is 0(+ve)
exp bits are (127-2=125) => 01111101
   Divide 125 successively by 2 until the quotient is 0
      > 125/2 = 62, remainder is 1
      > 62/2 = 31, remainder is 0
      > 31/2 = 15, remainder is 1
      > 15/2 = 7, remainder is 1
      > 7/2 = 3, remainder is 1
      > 3/2 = 1, remainder is 1
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 1111101
   So, 125 of decimal is 1111101 in binary
frac bits are 00110011001100110011001

so, 0.3 in single-precision format is 0 01111101 00110011001100110011001
in hexadecimal it is 0x3E999999

Related Solutions

Concert the following 32-bit floating point number (IEEE single precision) into their decimal representation. 1100 0101...
Concert the following 32-bit floating point number (IEEE single precision) into their decimal representation. 1100 0101 0001 1111 1000 0000 0000 0000 (ANSW: -2552.0) Please show all work
Convert the following decimal numbers to 32-bit IEEE floating point: 86.59375 -1.59729 Convert the following 32-bit...
Convert the following decimal numbers to 32-bit IEEE floating point: 86.59375 -1.59729 Convert the following 32-bit IEEE floating point numbers to decimal: 0100 1100 1110 0110 1111 1000 0000 0000 1011 0101 1110 0110 1010 0110 0000 0000
Q1.Convert C46C000016 into a 32-bit single-precision IEEE floating-point binary number.
Q1.Convert C46C000016 into a 32-bit single-precision IEEE floating-point binary number.
Given the following 32-bit binary sequences representing single precision IEEE 754 floating point numbers: a =...
Given the following 32-bit binary sequences representing single precision IEEE 754 floating point numbers: a = 0100 0000 1101 1000 0000 0000 0000 0000 b = 1011 1110 1110 0000 0000 0000 0000 0000 Perform the following arithmetic and show the results in both normalized binary format and IEEE 754 single-precision format. Show your steps. a)     a + b b)     a × b
3. IEEE Floating Point Representation What decimal number does the 32-bit IEEE floating point number 0xC27F0000...
3. IEEE Floating Point Representation What decimal number does the 32-bit IEEE floating point number 0xC27F0000 represent? Fill in the requested information in the blanks below. What is the sign of the number (say positive or negative): What is the exponent in decimal format: What is the significand in binary: What is the value of the stored decimal number in decimal (final answer): Credit will be given for your final answer in the blanks and the work shown below.
Convert the following 32-bit IEEE floating point numbers to decimal: 0100 1100 1110 0110 1111 1000...
Convert the following 32-bit IEEE floating point numbers to decimal: 0100 1100 1110 0110 1111 1000 0000 0000 1011 0101 1110 0110 1010 0110 0000 0000 Determine whether or not the following pairs are equivalent by constructing truth tables: [(wx'+y')(w'y+z)] and [(wx'z+y'z)] [(wz'+xy)] and [(wxz'+xy+x'z')] Using DeMorgan’s Law and Boolean algebra, convert the following expressions into simplest form: (a'd)' (w+y')' ((bd)(a + c'))' ((wy'+z)+(xz)')' Draw the circuit that implements each of the following equations: AB'+(C'+AD')+D XY'+WZ+Y' (AD'+BC+C'D)' ((W'X)'+(Y'+Z))'
Consider the following 32-bit floating point representation based on the IEEE floating point standard: There is...
Consider the following 32-bit floating point representation based on the IEEE floating point standard: There is a sign bit in the most significant bit. The next eight bits are the exponent, and the exponent bias is 28-1-1 = 127. The last 23 bits are the fraction bits. The representation encodes number of the form V = (-1)S x M x 2E, where S is the sign, M is the significand, and E is the biased exponent. The rules for the...
Convert the following binary floating point  to decimal IEEE 32-bit floating point format.   0 1000 0101 000...
Convert the following binary floating point  to decimal IEEE 32-bit floating point format.   0 1000 0101 000 0100 1101 0000 0000 0000
1. Represent following floating-point numbers in IEEE single-precision (32-bit) format: a. -0.1875, b. 0.46875 2. What...
1. Represent following floating-point numbers in IEEE single-precision (32-bit) format: a. -0.1875, b. 0.46875 2. What is the decimal value of the following IEEE single-precision (32-bit) floating-point numbers (which are shown in hexadecimal)? a. 3F400000, b. BE000000
Convert 0.875 to an IEEE 754 single-precision floating-point number. Show the sign bit, the exponent, and...
Convert 0.875 to an IEEE 754 single-precision floating-point number. Show the sign bit, the exponent, and the fraction. Convert -3.875 to an IEEE 754 double-precision floating-point number. Show the sign bit, the exponent, and the fraction Convert the IEEE 754 single-precision floating-point numbers 42E4800016 and 0080000016 to their corresponding decimal numbers.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT