Question

In: Computer Science

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

Solutions

Expert Solution

a.  Zero
0 is stored as all 0's
Answer: 00000000

b.  -2.0
-2.0
Converting 2.0 to binary
   Convert decimal part first, then the fractional part
   > First convert 2 to binary
   Divide 2 successively by 2 until the quotient is 0
      > 2/2 = 1, remainder is 0
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 10
   So, 2 of decimal is 10 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, 2.0 in binary is 00000010.0
-2.0 in simple binary => 10.0
so, -2.0 in normal binary is 10.0 => 1. * 2^1

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

so, -2.0 in single-precision format is 1 10000000 00000000000000000000000
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 11000000000000000000000000000000 to hexadecimal
1100 => C
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 11000000000000000000000000000000 is 0xC0000000

in hexadecimal it is 0xC0000000
Answer: C0000000

c.
256.0078125
Converting 256.0078125 to binary
   Convert decimal part first, then the fractional part
   > First convert 256 to binary
   Divide 256 successively by 2 until the quotient is 0
      > 256/2 = 128, remainder is 0
      > 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 100000000
   So, 256 of decimal is 100000000 in binary
   > Now, Convert 0.00781250 to binary
      > Multiply 0.00781250 with 2.  Since 0.01562500 is < 1. then add 0 to result
      > Multiply 0.01562500 with 2.  Since 0.03125000 is < 1. then add 0 to result
      > Multiply 0.03125000 with 2.  Since 0.06250000 is < 1. then add 0 to result
      > Multiply 0.06250000 with 2.  Since 0.12500000 is < 1. then add 0 to result
      > Multiply 0.12500000 with 2.  Since 0.25000000 is < 1. then add 0 to result
      > 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.0078125 of decimal is .0000001 in binary
   so, 256.0078125 in binary is 10000000.0000001
256.0078125 in simple binary => 100000000.0000001
so, 256.0078125 in normal binary is 100000000.0000001 => 1.000000000000001 * 2^8

single precision:
--------------------
sign bit is 0(+ve)
exponent bits are (127+8=135) => 10000111
   Divide 135 successively by 2 until the quotient is 0
      > 135/2 = 67, remainder is 1
      > 67/2 = 33, remainder is 1
      > 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 10000111
   So, 135 of decimal is 10000111 in binary
frac/significant bits are 00000000000000100000000

so, 256.0078125 in single-precision format is 0 10000111 00000000000000100000000
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 01000011100000000000000100000000 to hexadecimal
0100 => 4
0011 => 3
1000 => 8
0000 => 0
0000 => 0
0001 => 1
0000 => 0
0000 => 0
So, in hexadecimal 01000011100000000000000100000000 is 0x43800100

in hexadecimal it is 0x43800100
Answer: 43800100

d)
Negative infinity
sign bit = 1
exponent bits = 11111111
fractional bits = 00000000000000000000000

let's convert 1 11111111 00000000000000000000000 to hexadecimal
Converting 11111111100000000000000000000000 to hexadecimal
1111 => F
1111 => F
1000 => 8
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 11111111100000000000000000000000 is 0xFF800000
Answer: FF800000



Related Solutions

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 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.
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 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.
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
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.
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.  
a newer version of IEEE 754 defines a half precision floating point format that is only...
a newer version of IEEE 754 defines a half precision floating point format that is only 16 bits wide. the left most bit is still the sign bit. the exponent is 5 bits wide and has a bias of 15, and the fraction is 10 bits long. A hidden 1 is assumed similar to single and double precision formats. what is the bit pattern to represent -0.5 using this format?
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
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT