
To assist with understanding the limitations of floating point representations, we have produced a plot of the positive real numbers which can be represented exactly by an 8 bit floating point number encoded in the IEEE-754 format. We could not find any similar visualisations in the literature.

In Figure \ref{floats.pdf} 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{floats_diff.pdf}. 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.

\begin{comment}
The earlier example $7.25$ would be converted to a (1,3,4) floating point representation as follows:
\begin{enumerate}
	\item Determine the fixed point representation $7.25 = 111.01_2$
	\item Determine the sign bit; in this case $s = 0$
	\item Calculate the exponent by shifting the point $111.01_2 = 1.1101_2 \times 2^2 \implies e = 2 = 10_2$
	\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$
	\item Remove the implicit bit if the encoded exponent $\neq 0$; $1.1101_2 \to .1101_2$
	\item Combine the three bit strings$0,101,1101$
	\item The final encoding is $01011101 \equiv \text{0x5D}$
\end{enumerate}
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. 
\end{comment}

\input{chapters/Background/Floats/Operations}
%\begin{figure}[H]
%	\centering
%\begin{minipage}[t]{0.45\textwidth}
	\begin{figure}[H]
		\centering
		\includegraphics[width=0.8\textwidth]{figures/floats.pdf} 
		\caption{Positive 8-Bit Number Representations} \label{floats.pdf}
	\end{figure}
%\end{minipage}
%\begin{minipage}[t]{0.45\textwidth}
	\begin{figure}[H]
		\centering
		\includegraphics[width=0.8\textwidth]{figures/floats_diff.pdf} 
		\caption{Difference between successive numbers} \label{floats_diff.pdf}
	\end{figure}
%\end{minipage}
%	\caption{8 bit float and fixed point representations a) As mapped to real values b) The distance between each representation}\label{floats.pdf}
%\end{figure}
