Question

In: Computer Science

1. Convert 5.5 to hexadecimal notation using IEEE 754 single precision. Please show your work and...

1. Convert 5.5 to hexadecimal notation using IEEE 754 single precision. Please show your
work and answer must be in hexadecimal notation.


2. (4 points) Convert -7.875 to hexadecimal notation using IEEE 754 single precision. Please show your
work and answer must be in hexadecimal notation.

Solutions

Expert Solution

1)
5.5
Converting 5.5 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.50000000 to binary
      > Multiply 0.50000000 with 2.  Since 1.00000000 is >= 1. then add 1 to result
      > This is equal to 1, so, stop calculating
   0.5 of decimal is .1 in binary
   so, 5.5 in binary is 00000101.1
5.5 in simple binary => 101.1
so, 5.5 in normal binary is 101.1 => 1.011 * 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 01100000000000000000000

so, 5.5 in single-precision format is 0 10000001 01100000000000000000000
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 01000000101100000000000000000000 to hexadecimal
0100 => 4
0000 => 0
1011 => B
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 01000000101100000000000000000000 is 0x40B00000

in hexadecimal it is 0x40B00000

2)
-7.875
Converting 7.875 to binary
   Convert decimal part first, then the fractional part
   > First convert 7 to binary
   Divide 7 successively by 2 until the quotient 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 111
   So, 7 of decimal is 111 in binary
   > Now, Convert 0.87500000 to binary
      > Multiply 0.87500000 with 2.  Since 1.75000000 is >= 1. then add 1 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.875 of decimal is .111 in binary
   so, 7.875 in binary is 00000111.111
-7.875 in simple binary => 111.111
so, -7.875 in normal binary is 111.111 => 1.11111 * 2^2

single precision:
--------------------
sign bit is 1(-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 11111000000000000000000

so, -7.875 in single-precision format is 1 10000001 11111000000000000000000
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 11000000111111000000000000000000 to hexadecimal
1100 => C
0000 => 0
1111 => F
1100 => C
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 11000000111111000000000000000000 is 0xC0FC0000

in hexadecimal it is 0xC0FC0000



Related Solutions

Convert 0xCD001234 from IEEE-754 hexadecimal to single-precision floating point format. Please show every single detail for...
Convert 0xCD001234 from IEEE-754 hexadecimal to single-precision floating point format. Please show every single detail for upvote. Please do not answer otherwise.
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 1.8125 to IEEE-754 representation. Show all your work.
Convert 1.8125 to IEEE-754 representation. Show all your work.
Convert 1.8125 to IEEE-754 representation. Show all your work.
Convert 1.8125 to IEEE-754 representation. Show all your work.
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
convert -549.675 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast...
convert -549.675 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast 1000 words)
convert -47.199 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast...
convert -47.199 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast 1000 words)
A) Convert 1101.11011101 x 223 to IEEE Standard 754 for single precision floating-point binary format. B)...
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.  
Show the IEEE 754 binary representation of the number -0.25(subscript)ten in single and double precision. List...
Show the IEEE 754 binary representation of the number -0.25(subscript)ten in single and double precision. List all the steps required to get the single and double precision.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT