CS 213 Spring '01
Lab 1
Lab Assignment L1 (
L1.ps,
L1.pdf
)
Due: Wednesday, Jan. 31, 11:59PM
Revisions and Updates:
There were a few typos in the bits.c file and the handout.
These have been fixed, but you might have picked up the file before
the fix, so here are the changes.
- for
bitOr
, it used to say:
   x&y using only ~ and &
.
This has been fixed to:
   x|y using only ~ and &
.
- for
bitXor
in one place in the handout (the table was fine), it used to say:
   using only & and ^
.
This has been fixed to:
   using only & and ~
.
- for
firstBit
in bits.c, it used to say:
   int firstBit(void)
.
This has been fixed to:
   int firstBit(int x)
.
- the example for
isNegative
in bits.c was wrong.
- for
firstBit
in bits.c, it used to say:
   int firstBit(void)
.
This has been fixed to:
   int firstBit(int x)
.
- the location for
c2c
in the handout used to say:
   /afs/cs.cmu.edu/academic/class/15213-s01/L1/c2c
,
when it is actually in:
   /afs/cs.cmu.edu/academic/class/15213-s01/bin/c2c
.
Some people noted that tc2sm does not make much sense for TMIN, since
it cannot be represented in sign-magnitude. The original test code
actually generates TMIN as an input and assumes that tc2sm converts
this to -0. The logic behind this is that TMIN will create an
overflow in sign-magnitued which will wrap around to -0.
Since this was not clear in the document, however,
the test has been changed so that it does not generate TMIN.
If you want, you can pick up the new test (pick up decl.c).
If your code generates 0 anyway, don't worry.
Back to CS213 home page.