next up previous
Next: Problem 2: Nasturtiums are Up: quiz1-ans Previous: Annotated Answer Guide and

Problem 1: Roses are Right (15 pts)

  1. A C program will execute faster on a machine with a 1.2GHz clock than on a machine with an 800MHz clock.

    Answer: False. The problem is that you don't have enough information. It's not all about clock speed, but about other factors, such as how the program uses memory; how the memory is organized; if the program is CPU intensive, but one has floating point hardware and the other does floating point computations in software. You really can't tell-not ever-just by knowing the speed of the clock.

  2. The largest 8-bit SM (sign magnitude) integer has the same bit pattern as the most negative 8-bit TC (two's complement) integer.

    Answer: False. A positive SM integer has a sign bit of zero. A negative SM or TC integer has a sign bit of one. So, of course they are not the same.

  3. The number of unique bit patterns possible using k bits is $(2^{k}-1)$.

    Answer: False. There are $2^k$ bit patterns, ranging from $k$ zeros to $k$ ones. The tricky piece here is that $(2^{k}-1)$ is the value of the string of $k$ ones if it is interpreted as an unsigned binary number.

    Also, a counterexample would be fine. And, had I asked you to prove that this was false, you would have been required to give a counter example for full credit.

  4. If x and y are 32-bit unsigned binary numbers, then overflow has occurred in computing (x+y) if a 'one' is carried out of the most significant bit position.

    Answer: True. See the answer to Problem 2, question 4.

  5. Light travels approximately 1 meter in 1 nanosecond. (Note: The speed of light is $3 \times 10^{8}$ meters per second.)

    Answer: False. You could either remember what I said in class, or derive the answer given the speed of light-that is, assuming that you know that a nanosecond is $1 \times 10^{-9}$ seconds. Given the speed of computers today, you really should know this.


    \begin{displaymath}(3 \times 10^8 \; {\rm m/sec}) \times (10^{-9} \; {\rm sec} )\; =\; 3
\times 10^{-1}\; {\rm m}\; =\; .3m\end{displaymath}


next up previous
Next: Problem 2: Nasturtiums are Up: quiz1-ans Previous: Annotated Answer Guide and
MM Hugue 2006-02-16