CMSC 313 Project 3

Bit Manipulation

Assigned Monday, Oct 18
Program Due -- REVISED 11:59pm, Sunday, Oct 31
Points 75 points
see project handout

Completing this assignment should further your proficiency in:
  1. editing, compiling, testing, using makefiles, and debugging C programs under Unix
  2. writing C code to manipulate the bit representation of integers
  3. handling signed (twos-complement) and unsigned integers
Project Policy
This project may be a team project. You may work together with one other student from either section on this project. If you wish to work alone, that's fine too. If you do work with a partner, follow the directions in the project handout and in the bits.c file. Both students on the team will receive the same grade for the project. Please be sure to revisit the course project collaboration policy to determine if/how teams may help each other.
Project Description
In this project you will solve 15 puzzles that require you to write C code to manipulate bits and integers. The project handout describes the puzzles in more detail. More specific project directions can be found in the project's README and in the C source code file bits.c both of which are contained in the project's .tar file found in Mr. Frey's public directory. This project is also referred to as "the datalab". Tools are provided (dlc and btest) so that you can verify the correctness of your code while working on the project. You'll be able to calculate your grade before submitting your project.
Getting started
Read the project handout. Copy the file datalab-hendout.tar from Mr.Frey's public directory (/afs/ to your working directory for project 3. Unpack the file using the command tar xvf datalab-handout.tar. This command will deposit several files in your directory including a README file. Read the README file. The only file you will be changing is bits.c which contains directions in its comments. Read the comments in bits.c.
When you're done and ready to hand in your finished submission, don't forget to submit your work using the makefile provided. See the project handout for more details.
Beat the Prof Contest
Here's your chance to outwit your instructor and earn extra credit for doing so!

Once you have completed and submitted your project, you may enter your code into the "Beat the Prof" contest. See if you can complete the project puzzles using fewer operators than your instructor. Simply execute the command to enter the contest. You can compare your results with your instructor's results at If your team has a correct solution for all of the puzzles, then each member of your team will receive 1 point extra credit (up to a maximum of 10 points) for each puzzle you solved with fewer operators than your instructor. WARNING -- Entering the contest is not a substitute for submitting your project for grading.