\documentclass[11pt]{article}
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\title{CMSI 284 Assignment 0204 Numeric Encoding}
\author{The Author}
\date{\today}

\begin{document}
\maketitle

\begin{enumerate}

\item Assuming a 16-bit storage word, complete the following table:

\begin{center}
\begin{tabular}{|r|r|r|r|}\hline
\multicolumn{1}{|c}{\textbf{Unsigned Decimal}} &
\multicolumn{1}{|c}{\textbf{Signed Decimal}} &
\multicolumn{1}{|c}{\textbf{Hexadecimal}} &
\multicolumn{1}{|c|}{\textbf{Binary}} \\\hline\hline

 &        % Unsigned decimal
--992 &   % Signed decimal
 &        % Hexadecimal
 \\\hline % Binary

 &
 &
ABCD &
 \\\hline

 &
 &
1101 &
 \\\hline

 &
 &
 &
0100100111010111 \\\hline

 &
 &
9009 &
 \\\hline

60324 &
 &
 &
 \\\hline

42 &
 &
 &
 \\\hline

 &
--42 &
 &
 \\\hline

 &
--8 &
 &
 \\\hline

 &
 &
 &
0000110110111110 \\\hline

 &
 &
B0DA &
 \\\hline
\end{tabular}
\end{center}

\item Assume 16-bit signed words \(x=\) 9000, \(y=\) AA0B, \(z=\) 3421, \(w=\) 00EF.  Compute:
\begin{center}
\begin{tabular}{rl}
\(-x =\) & ? \\
\(-y =\) & ? \\
\(-z =\) & ? \\
\(-w =\) & ? \\
\end{tabular}
\end{center}

\item Do the following 16-bit sums, assuming \emph{signed} arithmetic, for both saturated and modular addition.  Indicate for each whether the modular arithmetic produced a carry and/or an overflow.

\begin{center}
\begin{tabular}{|l|r|r|r|r|}\hline
 &
\multicolumn{1}{|c}{\textbf{Saturated}} &
\multicolumn{1}{|c}{\textbf{Modular}} &
\multicolumn{1}{|c}{\textbf{Carry?}} &
\multicolumn{1}{|c|}{\textbf{Overflow?}} \\\hline\hline

 3127 + ACDC &
 &
 &
 &
 \\\hline

 10AB + 239C &
 &
 &
 &
 \\\hline
 
 FFFF + 0002 &
 &
 &
 &
 \\\hline
 
 9182 + F00D &
 &
 &
 &
 \\\hline
 
 BAAA + 302E &
 &
 &
 &
 \\\hline

\end{tabular}
\end{center}

\item Complete the following equivalences:
\begin{center}
\begin{tabular}{rl}
2048 bytes = & ? kibibytes \\
1048576 bytes = & ? mebibytes \\
64 kibibytes = & ? bytes \\
512 kibibytes = & ? mebibytes \\
\(2^{32}\) bytes = & ? gibibytes \\
\end{tabular}
\end{center}

\item Assuming IEEE 754 single precision, complete the following table.  Express decimal values as accurately as you can.  If it is necessary to use scientific notation, do so with powers of two.

\begin{center}
\begin{tabular}{|l|r|r|}\hline
\multicolumn{1}{|c}{\textbf{Comment}} &
\multicolumn{1}{|c}{\textbf{Hex}} &
\multicolumn{1}{|c|}{\textbf{Decimal}} \\\hline\hline

 largest finite positive &
 &        % Hex
 \\\hline % Decimal

 smallest nonzero negative &
 &
 \\\hline
 
 largest nonzero negative &
 &
 \\\hline
 
 smallest finite negative &
 &
 \(-(2 - 2^{-23}) \times 2^{127}\) \\\hline
 
 --- &
 00000000 &
 \\\hline
 
 --- &
 C0000000 &
 \\\hline
 
 --- &
 42280000 &
 \\\hline
 
 --- &
 FE000000 &
 \\\hline
 
 --- &
 &
 \(2^{-120}\) \\\hline
 
 --- &
 &
 \(1.25 \times 2^{80}\) \\\hline
 
 --- &
 &
 16777216 \\\hline
 
 --- &
 &
 negative infinity \\\hline

\end{tabular}
\end{center}

\end{enumerate}

\end{document}