Lab 1: Bits

Introduction

The purpose of this assignment is to become more familiar with bit-level representations of integers. You’ll do this by solving a series of programming “puzzles.” Many of these puzzles are quite artificial, but you’ll find yourself thinking much more about bits in working your way through them.

Like many of the lab assignments in this course, this assignment has:

(1) a writeup that gives detailed instructions as well as

(2) a starter code tarball (.tar) file: https://www.cs.hmc.edu/~beth/courses/cs105/labs/bits/bits-handout.tar

You will work on all lab assignments on the CS department machine called wilkes. If you have an account on knuth, you have one with the same user name and password on wilkes. Further, your home directory on knuth is cross-mounted on wilkes. But note, some of the lab assignments will not work on knuth; be sure to always work on wilkes.

The next section gives a brief overview of how logging into a machine via ssh, and using chmod to change file permissions. The section after that is a reminder of the due date and how to submit.


Getting started on wilkes

    1. On the lab machines log into using your knuth account username and password. Note that your knuth home directory is mounted on the lab macs when you login, so you'll be able to access your files on the lab macs.

    2. Using the Finder app (blue/grey square with a smiley face), make a directory for your CS 105 assignments inside Documents, or somewhere else you prefer.

    3. Open a terminal window (the terminal app looks like a black square with the command prompt ">").

    4. In the terminal window, first navigate to the directory containing your CS 105 directory using the change directory (cd) command. For example, if you placed your CS 105 lab directory called labDir inside Documents, you'd type:
      cd Documents

    5. Now you'll restrict the permissions on your CS 105 lab directory labDir so that only the owner (i.e., you) can access it:
      chmod 700 labDir

For each lab assignment, you can place your files inside your CS 105 lab directory.

Now follow the instructions in the lab writeup to get started on Lab 1!

Due Date and Submission

This assignment is due September 17th, 1:20pm.

As described in the handout, you can submit your work from the command line on wilkes in your lab assignment directory:

cs105submit -a 01 bits.c