Question

In: Computer Science

Represent the following decimal numbers using IEEE-754 floating point representation. A. -0.375 B. -Infinity C. 17...

Represent the following decimal numbers using IEEE-754 floating point representation.

A. -0.375

B. -Infinity

C. 17

D. 5.25

Solutions

Expert Solution

a) -0.375
-0.375
Converting 0.375 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.37500000 to binary
      > Multiply 0.37500000 with 2.  Since 0.75000000 is < 1. then add 0 to result
      > 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.375 of decimal is .011 in binary
   so, 0.375 in binary is 00000000.011
-0.375 in simple binary => .011
so, -0.375 in normal binary is .011 => 1.1 * 2^-2

single precision:
--------------------
sign bit is 1(-ve)
exponent 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/significant bits are 10000000000000000000000

so, -0.375 in single-precision format is 1 01111101 10000000000000000000000
in hexadecimal it is 0xBEC00000
Answer: 1 01111101 10000000000000000000000

b) -Infinity
Sign bit = 1
exponent bits = 11111111
mantissa bits = 00000000000000000000000
Answer: 1 11111111 00000000000000000000000

c) 17
17
Converting 17.0 to binary
   Convert decimal part first, then the fractional part
   > First convert 17 to binary
   Divide 17 successively by 2 until the quotient is 0
      > 17/2 = 8, remainder is 1
      > 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 10001
   So, 17 of decimal is 10001 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, 17.0 in binary is 00010001.0
17.0 in simple binary => 10001.0
so, 17.0 in normal binary is 10001.0 => 1.0001 * 2^4

single precision:
--------------------
sign bit is 0(+ve)
exponent bits are (127+4=131) => 10000011
   Divide 131 successively by 2 until the quotient is 0
      > 131/2 = 65, remainder is 1
      > 65/2 = 32, remainder is 1
      > 32/2 = 16, remainder is 0
      > 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 10000011
   So, 131 of decimal is 10000011 in binary
frac/significant bits are 00010000000000000000000

so, 17.0 in single-precision format is 0 10000011 00010000000000000000000
in hexadecimal it is 0x41880000
Answer: 0 10000011 00010000000000000000000

d) 5.25
5.25
Converting 5.25 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.25000000 to binary
      > Multiply 0.25000000 with 2.  Since 0.50000000 is < 1. then add 0 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.25 of decimal is .01 in binary
   so, 5.25 in binary is 00000101.01
5.25 in simple binary => 101.01
so, 5.25 in normal binary is 101.01 => 1.0101 * 2^2

single precision:
--------------------
sign bit is 0(+ve)
exponent bits are (127+2=129) => 10000001
   Divide 129 successively by 2 until the quotient is 0
      > 129/2 = 64, remainder is 1
      > 64/2 = 32, remainder is 0
      > 32/2 = 16, remainder is 0
      > 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 10000001
   So, 129 of decimal is 10000001 in binary
frac/significant bits are 01010000000000000000000

so, 5.25 in single-precision format is 0 10000001 01010000000000000000000
in hexadecimal it is 0x40A80000
Answer: 0 10000001 01010000000000000000000



Related Solutions

Using IEEE 754 single precision floating point, write the hexadecimal representation for each of the following:...
Using IEEE 754 single precision floating point, write the hexadecimal representation for each of the following: a. Zero b. -2.0 (base 10) c. 256. 0078125 (base 10) d. Negative infinity
Convert the following number into 32bit IEEE 754 floating point representation. 0.000101
Convert the following number into 32bit IEEE 754 floating point representation. 0.000101
For IEEE 754 single-precision floating point, what is the hexadecimal representation of 27.101562? A. 35CCD001 B....
For IEEE 754 single-precision floating point, what is the hexadecimal representation of 27.101562? A. 35CCD001 B. 2F5C10D0 C. 41D8D000 D. 7DCA1111 E. None of the above
Determine the IEEE single and double floating point representation of the following numbers: a) -26.25 b)...
Determine the IEEE single and double floating point representation of the following numbers: a) -26.25 b) 15/2
Describe how zero, infinity, and NaN are stored in IEEE 754 floating point formats
Describe how zero, infinity, and NaN are stored in IEEE 754 floating point formats
Determine the representation for the following decimal numbers in single-precision IEEE 754 format. Give them in...
Determine the representation for the following decimal numbers in single-precision IEEE 754 format. Give them in 32-bit binary and show the calculation. -10^(−8)
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a...
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a 32 bit floating point number. i) A digital camera processes the images images in the real-world and stores them in binary form. Using the principles of digital signal processing, practically explain how this phenomenon occurs.
Express the following two base 10 numbers in binary using the IEEE 754 single-precision floating point...
Express the following two base 10 numbers in binary using the IEEE 754 single-precision floating point format (i.e., 32 bits). Express your final answer in hexadecimal (e.g., 32’h????????). a) 68.3125 b) -19.675
Convert the following floating-point number (stored using IEEE floating-point standard 754) to a binary number in...
Convert the following floating-point number (stored using IEEE floating-point standard 754) to a binary number in non-standard form. 0100_0001_1110_0010_1000_0000_0000_0000
Determine the IEEE single and double floating point representation of the following numbers: a) (15/2) x...
Determine the IEEE single and double floating point representation of the following numbers: a) (15/2) x 2^50 b) - (15/2) x 2^-50 c) 1/5
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT