CS 240: Introduction to Computer Systems, Spring 2016

Class: Tuesdays + Fridays 1:30pm - 2:40pm, SCI E111
Lab: Wednesdays 9:20am - 12:20pm or 2:15pm - 5:15pm, SCI microfocus

Instructor: Ben Wood (contact), SCI E128. Office hours: Mon 10:30-11:30 + 2:00-3:00, Thu 3:30-4:30, Fri 2:45-4:00, or by appointment (especially during other lab)
Lab Instructor: Jean Herbst (contact), SCI E129. Office hours: Mon 5-7, Tue 3-4, Wed 1-2 (lab assignment only), Fri 3-4, or by appointment
Tutors: Amy, Ella, Madeleine. Drop-in hours: Sun 6-8, Mon 7-9, Wed 5:15-6:15, Thu 7-8 in the Microfocus

Website: https://cs.wellesley.edu/~cs240/spring16/
Google Group: announcements, discussion, questions. Stay subscribed and check your email.

Syllabus Contents:


CS 240 examines how modern computer systems run programs, introducing key software and hardware abstractions between high-level programming languages and hardware circuits. The course traces themes of data representation and program translation, focusing on how each level of abstraction (and its implementation) in a computer system impacts the execution of high-level programs. Course goals include:

  • To understand how programs are executed by computers.
  • To understand key software and hardware abstractions, implementations, and representations that comprise modern computers.
  • To understand when and how computer system implementation impacts correctness or performance of arbitrary high-level programs.
  • To understand the role of operating system abstractions.
  • To design and implement small tools and systems at the C programming language level of abstraction.
  • To become proficient at reasoning about program execution by employing assertions and inspecting execution state with debugging tools.
  • To develop critical thinking skills.
  • To develop foundations for further study of compilers, security, computer architecture, operating systems, or other systems/implementation topics in computer science.

Prerequisite: One of CS 111, CS 112, or permission of the instructor. Taking CS 230 before CS 240 offers a gentler transition into core CS, but CS 240 is accessible to motivated CS 111/112 alumnae without CS 230.

Challenge: CS 240 is a challenging course that demands more independence than CS 111 or CS 230. We find that the best way to help you grow to be a strong, independent computer scientist is to treat you like one from the start. We will pose challenging assignments and push you to think critically about hows and whys of solutions yourself. We often answer your questions by asking you more questions to help you arrive at answers yourself. You may find that the environment in CS 240 takes some adjustment, but it will push you to accomplish a lot and know that you did so under your own power.


CS 240 is a 3-stage sprint surveying computer systems from transistors to operating systems. The course home page hosts the working schedule. Expect minor adjustments.

Computer hardware implementation (4-5 weeks): from transistors to a simple computer processor

  • Transistors, digital logic gates
  • Data representation with bits
  • Combinational logic, logic for arithmetic
  • Sequential (stateful) logic, memory implementation
  • A simple computer processor and instruction set architecture

Hardware-software interface (4-5 weeks): from C to instruction set architecture

  • Memory addressing, C language, pointers
  • Assertions, debugging
  • Machine code, assembly language, program translation, x86
  • Control flow
  • Procedures, stacks
  • Data layout, security, linking and loading

Abstractions for practical systems (4 weeks): from memory hierarchy to operating systems and beyond

  • Memory hierarchy, caches
  • Operating system support, processes
  • Virtual memory, memory management
  • Compilers, run-time systems, Java


We use one primary textbook (CSAPP), plus a range of supplementary material, mostly provided and used during the first third of the course (hardware focus).

Course Work

topic lab ex code exam

Course work for CS 240 consists of reading and class exercises, laboratory exercises, assignments, and exams.

Reading and class exercises: Each class topic includes reading to be completed before class, posted on the course schedule. Regular reading quizzes on basic concepts or mechanics help motivate you to be prepared and participate. We will drop the lowest 20% of your reading quiz grades. CS 240 moves quickly and covers a lot of ground. To make class time effective, class meetings and group exercises will assume cursory familiarity with basic ideas from assigned readings. Reading before class to learn basic mechanics frees up more time in class to apply or debug your understanding of these mechanics and to consider their deeper implications. Effective technical reading is an acquired skill. Your first reading assignment will include some tips on how to read.

Lab: Weekly 3-hour lab meetings apply concepts in the course. Attendance is required at all lab meetings. The lab experience is key to the course. Many labs focus on tools, concepts, and strategies that are key to larger assignments. Lab work includes:

  • Short pre-lab assignments to prepare for each lab meeting are posted on the lab web page 1 or 2 days before lab.
  • Lab reports built as you work through exercises in lab.

Assignments: The heart of CS 240 is a set of challenging assignments that apply computer systems concepts to design and implement hardware and software systems.

  • ex Moderate written exercises explore concepts in the small or in the abstract.
  • code Large applied assignments run 1-3 weeks and involve significant effort on programming, reverse engineering, and debugging.


  1. In-class exam: Tuesday 1 March, covering data representation, digital logic, and microarchitecture.
  2. Take-home exam: week of 19-22 April, covering instruction set architecture, machine programming, memory hierarchy.
Percentage Letter
> 93.3 A
≥ 90.0 ≥ A-
> 86.6 ≥ B+
> 83.3 ≥ B
≥ 80.0 ≥ B-
> 76.6 ≥ C+
> 73.3 ≥ C
≥ 70.0 ≥ C-
≥ 60.0 ≥ D
< 60.0 F

Grading: The final (coarse) course grade weights course work as follows:

  •   5% topic reading exercises/quizzes and class participation
  • 15% lab
  • 50% ex + code assignments
  • 30% exam + exam

Grades are converted from percentages to letters as shown in the accompanying table. The minimum percentage required to achieve a given letter grade may be adjusted downward (to students’ benefit), but never upward. If your percentage grade satisfies the constraint in the left column, then your letter grade will satisfy the constraint in the right column of the same row.

This course complies with the Wellesley College grading policy (http://www.wellesley.edu/registrar/grading/gradingpolicyfaq). While that policy asks faculty to hold each 100- and 200-level course with 10 or more students to an average of no higher than 3.33 (B+), it does not require faculty to grade on a “curve.” There is no arbitrary limit on the number of A’s, B’s, C’s etc., and every student will be assigned the grade they earn and deserve according to the grading standards of the college. In past semesters, the challenge of this course has naturally yielded grades meeting this standard.

Late Policy: Deadlines are necessary to keep the course moving, but sometimes your schedule requires some flexibility. Each student is allotted 4 × 24-hour late passes to use during the semester. Each pass may be redeemed to delay one assignment deadline by exactly 24 hours for one student. (e.g., turning in an assignment 1 hour late or 23.5 hours late both cost exactly one 24-hour pass.) Partners must both redeem a late pass to delay a pair assignment deadline. A severe grade penalty is assessed for late work without passes. Any number of available passes may be applied to any assignment deadline up to the end of final exam period, after which no work is accepted. Passes are non-transferable and may not be applied to exams. Consult your instructor and class dean for alternative arrangements in case of severe extenuating circumstances.

Honor Code

The section describes how the Honor Code applies to CS 240 course work, defining standard acceptable resources, assistance, and collaboration. Specific assignments may explicitly override these rules or definitions. Violations of the guidelines below are considered violations of the Honor Code and handled accordingly. If in doubt, ask (permission, not forgiveness)!

Reading and class topic exercises allow unrestricted use of resources, assistance, and collaboration. Reading quizzes must be completed individually with no assistance and explicitly indicate allowed resources, if any.

Assignments lab ex code are subject to these rules:

  • Your submitted work must be your own, written by you alone.
  • You must cite all assistance, collaboration, and external resources (who and what) used to develop work you submit.
  • You may not view, share, or accept solutions or code even if you do not use the material in your own submitted work.

Resources: You may consult course material from this semester and external documentation of hardware or software tools or libraries required for the assignment. You may consult external reference material for general concepts and techniques. You may not consult solutions to the assignment or any similar assignment.

Collaboration: You are welcome and encouraged to discuss concepts, ideas, and strategies for assignments at a general level with other CS 240 students, subject to definitions below.

Pre-lab lab and written ex assignments: You are welcome to work through problems on pre-lab lab and written ex assignments with a small number of other CS 240 students, if collaborators contribute in similar measure. If you find notable imbalance of contributions, adjust your participation or seek different collaborators. You may not divide the assignment, have individuals complete separate parts, then combine the work. You may not write solutions together. You may not copy or photograph collaboratively developed solutions. Do take general notes on the approach, structure, or key steps of your collaborative solution. Then, later, write solutions on your own, referring to your notes only if needed. A good rule of thumb is to wait at least 30 minutes after collaborative work before writing your solutions. Then you know whether you actually understand the solutions (and their derivation) yourself. If this process is mainly copying your notes, your notes are too specific.

Applied code assignments: You are welcome to discuss concepts, ideas, and strategies for applied code assignments at a general level with other CS 240 students, but you may not develop detailed designs, algorithms, or code collaboratively. You may accept help from course staff to locate errors, interpret error messages, and correct errors of syntax. You may accept help from CS 240 students to interpret error messages. You may not, under any circumstances, examine other students’ code or show them your own. You may not accept assistance designing, implementing, or correcting errors of logic. You may reuse provided starter code in your solution without restriction. You may reuse code from other course materials only with prior written approval from the instructor and explicit attribution of the source. You may not reuse or adapt any other code.

Pair-programming assignments: Explicitly designated pair-programming assignments allow or require a pair of students to complete and submit one solution together. Partners must contribute in similar measure to the submitted work and complete at least 90% by working on each problem together in real time on one computer. Partners should take shifts at the keyboard. You may not divide the assignment into parts, have partners complete separate parts individually, then combine the work into a single solution. You may consider design or debugging separate from your partner. Implementation must be done together. If needed, you may consult course staff for assistance alone, without your partner. If it becomes necessary to split a pair, the partners must consult with the instructor and document what work was completed together.

Accommodations and Feedback

Please share suggestions and comments about the course at any time. Feel free to speak with me about concerns or suggestions about how I can make the course more accessible to you. I will do my best to help. An anonymous feedback form is available if you would prefer.

Students with disabilities who are taking this course and who need disability-related accommodations are encouraged to work with Jim Wice (781.283.2434 or jwice@wellesley.edu), the Director of Disability Services. Jim’s office is located in the Pforzheimer Learning & Teaching Center on the third floor of Clapp Library. If you have a physical disability or a learning disability, Jim is the person to see to arrange for accommodations. If your learning disability is undocumented or if you are uncertain as to whether you have a disability, Jim can arrange for you to be tested.


This course draws on material developed by the CSAPP authors at Carnegie Mellon University, adaptations of this material used in CSE 351 at the University of Washington, and material on digital logic and microarchitecture from earlier CS 240 iterations at Wellesley. Some parts of the Honor Code guidelines are adapted from the Williams College Computer Science Department Honor Code Guidelines.


A compilation of tips from CS 240 staff and students. Have more? Let me know.

  • Read before class. It’s fine if you do not understand all of the reading, but seeing it early lets you ask better questions in class and hit the ground running in class exercises.
  • Don’t care about being wrong in class. Students are often uncomfortable offering answers or suggestions in class for fear of peer judgment if they are wrong. First of all, there are fewer binary right/wrong questions in this course than students expect. Second, we are learning! Being wrong is normal and often more useful in class than being right. The best answer is a thoughtful answer, not a right answer. I intentionally set us up with questions whose answers you are unlikely to just know. (We learn little if I ask questions you can already answer.) Better to share a wrong answer and fix it together than to keep that wrong answer to yourself for use on an exam. I will make mistakes at least a few times in class (only occasionally on purpose). It’s fun! Try it! (Third, I have zero tolerance for students criticizing other students for being wrong in class.)
  • Take notes in class. The slides can be useful, but they are just a prop. They don’t speak for themselves. We do exercises in class too. Writing down your answers (and your approach!) is great reference for review later.
  • Ask questions in class, in office hours, in tutor hours, in lab, of your classmates or on the Google Group (but first, read the Honor Code definitions). The knowledge will not come to you. Go get it. We will often answer your questions with more questions.
  • Read the instructions on assignments and understand the specifications. There’s often good advice about how to approach the problem most effectively.
  • Work incrementally. As you work through an assignment (after you understand it), think and plan before you ever write any code. Writing code before planning and writing one big pile of code before testing are two sure routes to disaster. Plan carefully before you ever touch the keyboard. Write pseudocode and draw diagrams. When you are ready to write code, do it incrementally. Write a small piece. Write assertions to document your assumptions. Test it. Does it work? No? Repeat until it does. Now, commit it so you can get back to this point if things go wrong later. Then, write the next small piece, and so on. Step back occasionally and consider if you are still on track for your plan. Does it need adjustment?
  • Start assignments early and meet the checkpoints. (Really, early! Really early. Ask any CS 240 alum.) Before you can “just finish” the assignment, you will need time to absorb the task, understand how to approach it, plan, take a break when you get stuck (time away from a problem almost always helps me), debug, ask questions, and more. Some of the assignments are big or complicated. The checkpoints will help you keep on pace to finish comfortably.
  • Come to class and lab. One or the other leads directly into the next assignment. We do useful and fun things. If you don’t think so, then let me know! Oh, and, it counts toward your grade.