Skip to main content
\(\newcommand{\doubler}[1]{2#1} \newcommand{\binary}{\mathtt} \newcommand{\hex}{\mathtt} \newcommand{\octal}{\mathtt} \newcommand{\prog}{\mathtt} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section16.6Exercises

1

Using IEEE 754 32-bit format, what decimal number would the bit pattern \(\hex{00000000}_{16}\) represent, ignoring the special case of “zero value”.

Solution

  1. Compute \(s\text{,}\) \(e+127\text{,}\) and \(f\text{.}\)

    \begin{align*} s &= \binary{0}\\ e + 127 &= \binary{00000000}_{2}\\ e &= -127_{10}\\ f &= \binary{00000000000000000000000} \end{align*}
  2. Finally, plug these values into Equation (16.5.1). (Remember to add the hidden bit.)

    \begin{align*} (-1)^0 \times 1.00\dots 00 \times 2^{-127} &= \mbox{a very small number}\\ &\ne 0.0 \end{align*}

    so we do need the special case.

2

Convert the following decimal numbers to 32-bit IEEE 754 format by hand:

  1. \(1.0\)

  2. \(-0.1\)

  3. \(2016.0\)

  4. \(0.00390625\)

  5. \(-3125.3125\)

  6. \(0.33\)

  7. \(-0.67\)

  8. \(3.14\)

Answer

  1. \(\hex{3f80 0000}\)

  2. \(\hex{bdcc cccd}\)

  3. \(\hex{44fc 0000}\)

  4. \(\hex{3b80 0000}\)

  5. \(\hex{c543 5500}\)

  6. \(\hex{3ea8 f5c3}\)

  7. \(\hex{3f2b 851f}\)

  8. \(\hex{4048 f5c3}\)

3

Convert the following hexadecimal numbers to decimal by hand using the 32-bit IEEE 754 format:

  1. \(\hex{4000 0000}\)

  2. \(\hex{bf80 0000}\)

  3. \(\hex{3d80 0000}\)

  4. \(\hex{c180 4000}\)

  5. \(\hex{42c8 1000}\)

  6. \(\hex{3f99 999a}\)

  7. \(\hex{42f6 e666}\)

  8. \(\hex{c259 48b4}\)

Answer

  1. \(+2.0\)

  2. \(-1.0\)

  3. \(+0.0625\)

  4. \(-16.03125\)

  5. \(100.03125\)

  6. \(1.2\)

  7. \(123.449997\)

  8. \(-54.320999\)