Exercises 16.6 Exercises
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”.
-
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*} -
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:
\(\displaystyle 1.0\)
\(\displaystyle -0.1\)
\(\displaystyle 2016.0\)
\(\displaystyle 0.00390625\)
\(\displaystyle -3125.3125\)
\(\displaystyle 0.33\)
\(\displaystyle -0.67\)
\(\displaystyle 3.14\)
\(\displaystyle \hex{3f80 0000}\)
\(\displaystyle \hex{bdcc cccd}\)
\(\displaystyle \hex{44fc 0000}\)
\(\displaystyle \hex{3b80 0000}\)
\(\displaystyle \hex{c543 5500}\)
\(\displaystyle \hex{3ea8 f5c3}\)
\(\displaystyle \hex{bf2b 851f}\)
\(\displaystyle \hex{4048 f5c3}\)
3.
Convert the following hexadecimal numbers to decimal by hand using the 32-bit IEEE 754 format:
\(\displaystyle \hex{4000 0000}\)
\(\displaystyle \hex{bf80 0000}\)
\(\displaystyle \hex{3d80 0000}\)
\(\displaystyle \hex{c180 4000}\)
\(\displaystyle \hex{42c8 1000}\)
\(\displaystyle \hex{3f99 999a}\)
\(\displaystyle \hex{42f6 e666}\)
\(\displaystyle \hex{c259 48b4}\)
\(\displaystyle +2.0\)
\(\displaystyle -1.0\)
\(\displaystyle +0.0625\)
\(\displaystyle -16.03125\)
\(\displaystyle 100.03125\)
\(\displaystyle 1.2\)
\(\displaystyle 123.449997\)
\(\displaystyle -54.320999\)