\documentclass[twocolumn]{article}

\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.05in}
\setlength{\columnseprule}{0.3pt}

\setlength\columnsep{25pt}

\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}

\usepackage{listings}
\usepackage{amsmath}

\begin{document}

\lstset{xleftmargin=5mm,framexleftmargin=10mm,basicstyle=\footnotesize}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Directions: {\bf \Large Work only on this sheet} (on both sides, if
needed).  MAKE SURE TO COPY YOUR ANSWERS TO A SEPARATE SHEET FOR SENDING
ME AN ELECTRONIC COPY LATER.

{\bf 1.} (20) Fill in the blank:  The set of parallel wires connecting the
CPU to memory is called a \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.

{\bf 2.} Say we have a 5-bit word size.  In each part below, answer with
two bit strings, separated by a space, such as

\begin{lstlisting}
01010 11110
\end{lstlisting}

\begin{itemize}

\item [(a)] (10) Find the signed-magnitude and 2s complement representations
(in that order) of 5.

\item [(b)] (10) Find the signed-magnitude and 2s complement representations
(in that order) of -5.

\end{itemize}

{\bf 3.} (20) What is printed out?

\begin{lstlisting}
int x[3][4] {5,3,8,2,1,8,3,7,88,168,8,8888};
printf("%d",x[2][1]);
\end{lstlisting}

{\bf 4.} (20) Suppose we were to build a base-4 machine, i.e. 4 voltage
levels coding the numbers 0,1,2,3, with word size of 3 base-4 digits.
The decimal number 51, for instance, would be stored as 303, since 303
means $3 \cdot 16 + 0 \cdot 4 + 3 \cdot 1 = 51$.  The machine will use
using ``4s complement'' storage for signed integers, the base-4 analog
of 2s complement.  Show the coding for -5.

{\bf 5.} (20) Say we have a disk with a rotation speed of 9600 revolutions
per minute, 1000 tracks, a seek speed of $10^{-6}$ seconds per track,
and a sector size of 528 bytes.  Give the time in seconds for  a read 
request to start, measured from the start of the seek and the time
the first byte is read.  Give your answer as an R expression.  Assume
that at the time the seek begins: the read/write head is at the
innermost track; the desired sector is in the middle track; and
the start of the sector is a half revolution from the read/write head
when the seek completes.

{\bf Solutions:}

{\bf 1.} bus

{\bf 2a.} 00101 00101

{\bf 2b.} 10101 11011

{\bf 3.} 168

{\bf 4.} To find -5, ``wind backwards'' from 000 five times, yielding
333, 332, 331, 330, 323.  So 323 is the representation of -5.

{\bf 5.}

seek time:  \lstinline{0.5 * 1000 * 0.000001}

rotation time before read first byte:  \lstinline{0.5 * 1/(9600/60)}

total:  \lstinline{0.5 * 1000 * 0.000001 + 0.5 * 1/(9600/60}
 
\end{document}

