Lab 1 - Manipulating bits
Lab 1 is available in directory
The assignment has now been graded. A few interesting things happened:
- We discovered our testing code wasn't very good. So we ran every
assignment using both the original tests plus a set of augmented
tests. Your grade was based on how you did on the original tests, but
the hardcopy version we return to you shows how you did on the
For your interest, an improved version of btest.c is available.
- DLC didn't check for all the rules we wanted to
enforce. In particular, it allowed you to use arrays. Many people
therefore used table lookup to solve bitCount. We allowed all
solutions that passed DLC.
Some people got very competitive, trying to minimize the number of operations.
For those of you who are interested, here are the results of the "best" solutions:
- Click here to see the minimum number
of operations for each function and which teams achieved this. This
list excludes solutions that used operations we intended to make
illegal (e.g., arrays).
- We created a composite solution showing optimal
implementations of each function.
The due date for the assignment has been shifted by 24 hours. It is now due 11:59pm, Thursday, Sept. 13, 2001.
A number of minor errors have been found, mostly in the comments or in
the writeup. The following is a log of changes that have been made to
the homework files. None of them affects the code you need to write:
- Added handin rule to Makefile.
- Created handin directory.
The writeup incorrectly listed logicalShift as counting 2
points. It counts 3.
Comments and code for getByte were
inconsistent in the name of the second argument. It should be n
- Comment added to getByte indicating allowed operations.
- Comment indicating number of allowed operations in bitNor set to 8.
- isGreater included in writeup.
Last modified: Sun Aug 26 16:07:33 EDT 2001