Commit things
[ipdf/sam.git] / chapters / Background / Floats / Visualisation.tex
1
2 Figure \ref{floats.pdf} shows the positive real numbers which can be represented exactly by an 8 bit floating point number encoded in the IEEE-754 format. We show two encodings using (1,2,5) and (1,3,4) bits to encode (sign, exponent, mantissa) respectively. For each distinct value of the exponent, the successive floating point representations lie on a straight line with constant slope. As the exponent increases, larger values are represented, but the distance between successive values increases; this can be seen in Figure\ref{}. The marked single point discontinuity at \verb/0x10/ and \verb/0x20/ occur when $e$ leaves the denormalised region and the encoding of $m$ changes. We have also plotted a fixed point representation for comparison; fixed point and integer representations appear on straight lines.
3
4 \begin{comment}
5 The earlier example $7.25$ would be converted to a (1,3,4) floating point representation as follows:
6 \begin{enumerate}
7         \item Determine the fixed point representation $7.25 = 111.01_2$
8         \item Determine the sign bit; in this case $s = 0$
9         \item Calculate the exponent by shifting the point $111.01_2 = 1.1101_2 \times 2^2 \implies e = 2 = 10_2$
10         \item Determine the exponent encoding; in IEEE-754 equal to the number of exponent bits is added so $e_{enc} = e+3 = 5 = 101_2$
11         \item Remove the implicit bit if the encoded exponent $\neq 0$; $1.1101_2 \to .1101_2$
12         \item Combine the three bit strings$0,101,1101$
13         \item The final encoding is $01011101 \equiv \text{0x5D}$
14 \end{enumerate}
15 This particular example can be encoded exactly; however as there are an infinite number of real values and only a finite number of floats, in general a value must be $7.26$ must be rounded or truncated at Step 3. 
16 \end{comment}
17
18 %\begin{figure}[H]
19 %       \centering
20 %\begin{minipage}[t]{0.45\textwidth}
21         \begin{figure}[H]
22                 \centering
23                 \includegraphics[width=0.8\textwidth]{figures/floats.pdf}\label{floats.pdf}
24                 \caption{Positive 8-Bit Number Representations}
25         \end{figure}
26 %\end{minipage}
27 %\begin{minipage}[t]{0.45\textwidth}
28         \begin{figure}[H]
29                 \centering
30                 \includegraphics[width=0.8\textwidth]{figures/floats_diff.pdf}\label{floats_diff.pdf}
31                 \caption{Difference between successive numbers}
32         \end{figure}
33 %\end{minipage}
34 %       \caption{8 bit float and fixed point representations a) As mapped to real values b) The distance between each representation}\label{floats.pdf}
35 %\end{figure}

UCC git Repository :: git.ucc.asn.au