CS 240 Lab

  • Instructor: Peter Mawhorter
  • Office: SCI-L130
  • Email: pmawhort@wellesley.edu
  • Student Hours: Check this calendar for details. Normally they are:
    • TBD

Introduction

In CS 240 Laboratory, students learn about the foundations of computer systems by experimenting with software and hardware. Lab material coordinates with lecture topics, and will often introduce the student to strategies and tools required for class assignments.

Jean Herbst (just now retired) taught this class for 20+ years. I am teaching it for the second time. I’ve learned a lot from my first run-through, but I’m sure there will still be things we’re learning together this time around :)

Schedule

Lab is held in L037 in the science center. Section L01 meets Tuesday, 12:45 p.m. - 3:45 p.m. Section L02 meets Wednesday, 8:30 a.m. - 11:30 a.m. Section L03 meets Wednesday, 2:30 p.m. - 5:30 p.m.

Classroom Policies

Because statistically, it’s fairly likely that at least one of us will have an asymptomatic case of COVID-19 this semester (so that nobody, including them, will know they have it), is is prudent for us to wear masks at all times in the classroom, including during student hours. See this calculator page for a model of the probabilities involved. Feel free to adjust the numbers there and see how they play out. Even at just 1 case per week across the whole campus, the probability across the entire semester is about 10%, if the cases/week goes up to 5, the whole-semester probability is ~40%.

Given vaccinations, many people are now treating COVID-19 like just another flu: something to be avoided, but not necessarily to take stringent precautions against. This attitude is sadly not supported by the data: COVID-19, unlike the flu, has a significant (likely greater than 1/1000, possibly as high as 1/10 or greater) risk of long-term, potentially-permanent complications (this meta-analysis from January this year has an overview, although some of its percentages may be somewhat pessimistic). In contrast, the risks of such complications from the flu are more like 1/100,000 or lower. Also, for immunocompromised people who cannot effectively be vaccinated (e.g., cancer patients undergoing chemotherapy), the risk of death from COVID-19 is still significant and is much greater than that from the flu. There may be immunocompromised students in our class, and in principle, I’d like to create a classroom where such students could be included (despite the risks inherent in an in-person setting, which we have already decided to move to given the significant drawbacks of remote learning). Because of this, as a basic gesture of inclusivity, and as something that will help limit the number of sick days we collectively have due to other airborne illnesses, we should all wear masks in the classroom & during student hours. The campus policy does not require this, and other professors may have different policies. Should you choose not to wear a mask, I’ll offer you one in case you simply forgot.

Because we are dealing with electronics in lab, food and drink are not permitted in the lab. The labs are long and you may get hungry or thirsty. If you’d like to have a snack or drink, please step outside the classroom. You’re welcome to do that at any time during the lab, but we will also have at least one 5-minute break in each lab (feel free to remind me if I forget to call the break).

Requirements

Each week (with some exceptions), you will have a pre-lab assignment to complete, to prepare you for the lab. These are due at the beginning of the lab period. In most cases, they will be either a Google doc that is shared with you, where you make a copy and share that back, or they will be on Gradescope.

In addition to pre-lab assignments, you will do work in lab that you will document via Google docs, which you update as you go through the lab. If you are in the lab and checking in with me regularly, I will not grade these in detail but will give you credit for the lab. If you’d like more detailed feedback on the questions in these notebooks, please ask questions during lab, but you may also ask later and I can give it.

Everyone may have to miss lab from time to time (e.g., when you’re sick). In these cases, which are hopefully rare, you are expected to: 1. Notify me as soon as feasible. 2. Complete the lab notebook on your own time, using a simulator instead of the physical lab equipment. 3. Turn in the completed notebook before the start of the next lab. Exceptional circumstances may call for some modification of these requirements, and I’m more than willing to figure out something else if you need it; just let me know.

In lab, you will work with an assigned partner, who will rotate every week. You are expected to collaborate respectfully, and to work through things as a team (you will not divide the work up and work separately). When programming, do pair programming: use a shared screen + keyboard and switch between driver and navigator roles every 5-15 minutes.

Grading

The lab activities count for 15% of your overall course grade. Each lab is weighted equally, and when there is a pre-lab assignment, that’s worth 30% of the points for that lab, with the other 70% coming from the lab notebook (otherwise, the lab notebook is 100% of the grade).


Lab 1: Transistors to Gates

Lab 2: Data as Bits

Lab 3: Combinational Logic & Arithmetic

Lab 4: ALU & Sequential Logic

  • The pre-lab assignment is on Gradescope. You should upload your submission before lab; if you bring a hard copy I’ll ask you to upload it afterwards. (Ask for solutions if you want them.)
  • Slides
  • Lab Notebook (solutions)

Lab 5: Processor Datapath

Lab 6: Pointers in C

Lab 7: Pointers in C (continued)

  • Pre-lab assignment is on Gradescope.
  • Slides
  • Lab Notebook: Open your lab notebook from last week (solutions link in last week’s entry)

Lab 8: x86 Assembly

Lab 9: x86 Stack

Lab 10: Data Structures in Memory

Lab 11: Buffer Overflows

Lab 12: Memory Allocation

Lab 13: Processes & Malloc Workshop