CS 61C (Fall 2007)

Quiz 15

Three questions, submit as "quiz15".  Due 2:45pm before lecture 10/3/2007.


1.

Suppose there was a 16-bit IEEE 754 floating point format with 5 exponent bits. What would be the likely range of numbers it could represent?
  1. 1.0000 0000 00 * 20 to 1.1111 1111 11 * 231, 0
  2. ±1.0000 0000 0 * 2-14 to ±1.1111 1111 1 * 215, ±0, ±infinity, NaN
  3. ±1.0000 0000 00 * 2-14 to ±1.1111 1111 11 * 215, ±0, ±infinity, NaN
  4. ±1.0000 0000 00 * 2-15 to ±1.1111 1111 11 * 214, ±0, ±infinity, NaN
Explain your choice very very briefly.

2.

Does (x+y)+z == x+(y+z) for all values of x, y & z?
  1. Yes.
  2. No.
  3. Depends on the type of x, y & z.
Explain your choice very very briefly.

3.

True or False: We can always replace multiplication or division by a power of 2 with a shift. Why or why not?