Question

In: Computer Science

2. a) Represent the decimal value 47.375 as a single precision IEEE floating point number. Give...

2. a) Represent the decimal value 47.375 as a single precision IEEE floating point number. Give your answer in hexadecimal and show your work.

b) Represent the decimal value 47.375 as a double precision IEEE floating point number. Give your answer in hexadecimal and show your work.

Solutions

Expert Solution


a)
47.375
Converting 47.375 to binary
   Convert decimal part first, then the fractional part
   > First convert 47 to binary
   Divide 47 successively by 2 until the quotient is 0
      > 47/2 = 23, remainder is 1
      > 23/2 = 11, remainder is 1
      > 11/2 = 5, remainder is 1
      > 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 101111
   So, 47 of decimal is 101111 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, 47.375 in binary is 00101111.011
47.375 in simple binary => 101111.011
so, 47.375 in normal binary is 101111.011 => 1.01111011 * 2^5

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

so, 47.375 in single-precision format is 0 10000100 01111011000000000000000
Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from binary to hexadecimal
Converting 01000010001111011000000000000000 to hexadecimal
0100 => 4
0010 => 2
0011 => 3
1101 => D
1000 => 8
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 01000010001111011000000000000000 is 0x423D8000

in hexadecimal it is 0x423D8000

b)
47.375
Converting 47.375 to binary
   Convert decimal part first, then the fractional part
   > First convert 47 to binary
   Divide 47 successively by 2 until the quotient is 0
      > 47/2 = 23, remainder is 1
      > 23/2 = 11, remainder is 1
      > 11/2 = 5, remainder is 1
      > 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 101111
   So, 47 of decimal is 101111 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, 47.375 in binary is 00101111.011
47.375 in simple binary => 101111.011
so, 47.375 in normal binary is 101111.011 => 1.01111011 * 2^5

64-bit format:
--------------------
sign bit is 0(+ve)
exponent bits are (1023+5=1028) => 10000000100
   Divide 1028 successively by 2 until the quotient is 0
      > 1028/2 = 514, remainder is 0
      > 514/2 = 257, remainder is 0
      > 257/2 = 128, remainder is 1
      > 128/2 = 64, remainder is 0
      > 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 10000000100
   So, 1028 of decimal is 10000000100 in binary
frac/significant bits are 0111101100000000000000000000000000000000000000000000

so, 47.375 in 64-bit format is 0 10000000100 0111101100000000000000000000000000000000000000000000
Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from binary to hexadecimal
Converting 0100000001000111101100000000000000000000000000000000000000000000 to hexadecimal
0100 => 4
0000 => 0
0100 => 4
0111 => 7
1011 => B
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 0100000001000111101100000000000000000000000000000000000000000000 is 0x4047B00000000000

in hexadecimal it is 0x4047B00000000000


Related Solutions

6 – Assuming single precision IEEE 754 format, what decimal number is represent by the following...
6 – Assuming single precision IEEE 754 format, what decimal number is represent by the following 32-bit binary word? 1 10001000 10010000000000000000000
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.
Convert 1101.11011101 x 223 to IEEE Standard 754 for single-precision floating-point binary format. Convert the IEEE...
Convert 1101.11011101 x 223 to IEEE Standard 754 for single-precision floating-point binary format. Convert the IEEE Standard 754 number 11001010100011010101000000000000 to its decimal equivalent.
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
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
6a) (6 pts. each) Find the decimal represented by the 32-bit single precision floating point number...
6a) (6 pts. each) Find the decimal represented by the 32-bit single precision floating point number for the hexadecimal value C47CD000.
Represent the following numbers in IEEE half-precision floating point. Indicate problems where you run into them....
Represent the following numbers in IEEE half-precision floating point. Indicate problems where you run into them. 1 -10 55595472 -π (PI) The speed of light in meters per second
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754...
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754 standard is
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
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT