CS 240 Spring 2017
Foundations of Computer Systems
(formerly Introduction to Machine Organization, Introduction to Computer Systems)
- Monday/Thursday 11:10am - 12:20pm, SCI 364, Ben Wood
- Monday/Thursday 1:30pm - 2:40pm, SCI E111, Ashley DeFlumere
Lab Meetings, SCI microfocus, Jean Herbst:
- Tuesday 9:20am - 12:20pm
- Tuesday 1:30pm - 4:30pm
- Wednesday 2:15pm - 5:15pm
- Wednesday 5:30pm - 8:30pm
- 8:00-9:00pm Tuesday SCI E211
- 8:00-9:00pm Thursday SCI E211
|Name||Contact||Locale||Drop-in Hours (?)
Google Calendar, iCal
|Instructor||Ashley DeFlumere||adeflume||SCI S145||Monday 2:40-4:00pm, Tuesday 11:00-12:30, Friday 1:30-3:00pm, and by appointment|
|Instructor||Ben Wood||benjamin.wood||SCI E128, Microfocus||Monday 4:00-5:00pm, Wednesday 3:00-4:30, Thursday 4:00-5:30pm, and by appointment|
|Lab Instructor||Jean Herbst||jherbst||SCI E129, Microfocus||Monday 4:30-6:00pm, Tuesday 4:30-6:00pm, Friday 2:50-4:00pm, and by appointment|
|SI Leader||Valerie Zhao||Google Group||Various||
8:00-9:00pm Tuesday SCI E211, 8:00-9:00pm Thursday SCI E211
Drop-in hours Sunday 8:00-9:00pm
|Tutors||Andrea Jackson, Ella Chao, Kim Asenbeck, Madeleine Barowsky||Google Group||SCI Microfocus||Sunday 7:00-9:00, Monday 6:00-9:00pm, Thursday 5:30-7:30pm|
|Classmates||CS 240 Spring 2017||Google Group||SCI Microfocus, around campus||by appointment|
- What is CS 240?
- When Should You Take CS 240?
- Course Work
- Honor Code
- Electronic Devices
- The CS 240 Compact
- Academic Support
- Accommodations and Feedback
- How to Succeed
What is CS 240?
CS 240 examines how computers run programs, introducing key software and hardware abstractions and implementations between programming languages and transistors. Course goals include:
- To understand how programs are executed by computers.
- To understand the roles of key software and hardware abstractions, their implementations, and their relation through translation and representation, including: digital logic, microarchitecture, instruction set architecture, basics of programming language implementations, and operating system abstractions.
- To understand when and how computer system implementation impacts correctness or performance of arbitrary high-level programs.
- To become proficient in structured reasoning about the execution of programs on well-defined models, including the use of assertions and debugging tools to inspect program invariants and execution state.
- To develop foundations for further study of programming language implementation, security, computer architecture, operating systems, networks, concurrent and distributed systems, or other systems/implementation topics in computer science.
- To develop skills for independent learning, critical thinking, and problem-solving as a self-reliant computer scientist.
We explore computer systems in 3 parts. The course home page hosts the working schedule.
Computer hardware implementation (4-5 weeks): from transistors to a simple computer processor architecture
- 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, call stack
- 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
When Should You Take CS 240?
Prerequisite: One of CS 111, CS 112, or permission of the instructor is required to enroll in CS 240. CS 230 is recommended.
Recommendations: We advise taking CS 230 before CS 240. This is the smoothest path into the core CS curriculum and offers more time to develop independence. Nonetheless, CS 240 is accessible to motivated students who have succeeded in CS 111 or CS 112. CS 240 requires a large time commitment and workload, even among CS courses. We advise against taking CS 240 as part of a 5-course load. Talk to us if you have heavy external time commitments, intend to elect credit/non grading, or have any questions.
At least one copy of each text is available in the microfocus for use within the CS department area. Please do not remove them from the lab areas. Return them to the shelf when you are done.
We use one primary textbook that you should acquire:
- CSAPP 3e: microfocus has 2 copies
Computer Systems: A Programmer’s Perspective, 3/E. (3rd edition, significant changes since 2nd)
Bryant and O’Hallaron, Pearson, 2016. ISBN-13: 9780134092669.
You need the 3rd edition. See the errata.
“Global” 3rd editions mostly work, but have some additional errors (not listed on that page).
We provide and use other textbooks mainly during the first 1/3 of the course:
- DDCA: microfocus has 3 copies, plus ebooks through the library linked here
Digital Design and Computer Architecture. (alt. ebook)
Harris and Harris, Morgan Kaufmann, 2007.
- SCO: microfocus has 8 copies
Structured Computer Organization, any edition.
Tanenbaum, Prentice Hall, various.
- Additional material on the course website.
We recommend a good reference on the C programming language. There are many online resources of various quality. One classic book is:
- K&R: microfocus has 1 copy, more in library
The C Programming Language, 2nd edition.
Kernighan and Ritchie, Prentice Hall, 1988. ISBN-13: 978-0131103627, ISBN-10: 0131103628.
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 topic on the course schedule includes reading to try before class and review after class. Class meetings and group exercises assume cursory familiarity with basic ideas from assigned readings, but not deep understanding. Effective technical reading is an acquired skill. The first reading assignment includes tips on how to read.
Reading quizzes (2%): Brief reading quizzes to help motivate preparation are posted alongside relevant reading lists at least 24 hours ahead of class. Not every class or topic has a reading quiz. Half of reading quiz credit is awarded simply for completing the reading quiz. The remaining half is based on correctness. We will drop at least your lowest reading quiz grade.
Lab (15%): Weekly 3-hour lab meetings apply concepts in the course and start or prepare for code assignments. Attendance is required at all lab meetings. The lab experience is key to the course. Full lab policies are listed on the lab page. Lab work includes:
- Short pre-lab assignments to prepare for each lab meeting, posted on the lab web page 1 or 2 days before lab.
- Lab reports, built as you work through exercises in lab.
Assignments (50%): The heart of CS 240 is a series of challenging assignments that apply computer systems concepts in hardware and software.
- 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.
- take-home exam March 2-6, covering the computer hardware implementation part of the course
- take-home exam April 20-24, covering the hardware-software interface part of the course, plus memory hierarchy and cache topic from the abstractions for practical systems part of the course.
|≥ 90.0||≥ A-|
|> 86.6||≥ B+|
|> 83.3||≥ B|
|≥ 80.0||≥ B-|
|> 76.6||≥ C+|
|> 73.3||≥ C|
|≥ 70.0||≥ C-|
|≥ 60.0||≥ D|
Course grades are computed by the weights above and 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.
Recall that the minimum grade to earn credit under credit/no credit grading is C. The minimum grade to pass and earn credit under normal letter grading is D.
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 unadjusted grades meeting this standard.
Late Policy: Each student is allotted 4 × 24-hour late passes to use during the semester. Each pass may be redeemed to delay one assignment deadline for one student by exactly 24 hours within the semester. (e.g., turning in an assignment 1 hour late or 23.5 hours late both cost exactly one late pass.) Partners must each redeem a late pass to delay a pair assignment deadline. After the late pass budget is exhausted, additional late days cost 10% of the grade. Any number of available passes may be applied to any assignment deadline. Late passes may not extend any deadline past the end of final exam period. Passes are non-transferable and are void on exams. Consult the instructor and your class dean for alternative arrangements in case of severe extenuating circumstances.
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 are ungraded and allow unrestricted use of resources, assistance, and collaboration. Reading quizzes must be completed individually.
Assignments 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.
exam Exams: Your work must be strictly your own, using only the resources explicitly allowed by the exam. Specific exam rules will be discussed in advance of each exam and listed on the exam cover.
Please silence and stow computing devices (phone, laptop, tablet), during class meetings. Eliminating electronic distractions helps you and your peers focus on learning how those devices work. (This also applies to phones in drop-in hours – please focus your attention when working with the course staff.) Taking physical, handwritten notes also tends to help students distill the key ideas and remember them better. If you need or strongly prefer to use a laptop or tablet for taking notes, please speak to the instructor to arrange an exception. In lab meetings, we may suggest using your laptop for extra screen space – feel free to do that in lab.
The CS 240 Compact
Time Commitment: CS 240 requires a large time commitment and workload, even among CS courses. Expect to spend more time outside of class and lab than in them. Talk to your instructors early if you are concerned about the feasibility of investing significant time each week due to commitments such as a heavy employment schedule, care for a family member, etc. We are happy to work with you to streamline your time in CS 240 so you can do your best in the course.
Challenging Assignments: We study core systems design and implementation concepts and apply them in assignments that often require extensive hands-on work with real computer systems rather than simply solving sets of cute toy problems. CS 240 labs and preparatory exercises familiarize you with relevant concepts and tools at a small scale, but completing an assignment requires deeper investment in learning, thinking, and the time for both. Powering through assignments on the due date does not work.
Real computer systems are often large and complicated. Likewise, CS 240 assignments rarely come with formulaic problem-solving recipes or step-by-step instructions to complete a task. Mindlessly following someone else’s exhaustive instructions is a job for computers. The job of a computer scientist is to think critically and learn how to construct or apply new ideas and tools. The solutions themselves are never as important as the insights you gain in the process of finding solutions and understanding their context. CS 240 code assignments require you to read and reason about specifications, apply concepts from class, learn something new beyond what was covered in class, consult documentation, think critically about design choices, synthesize plans for implementation, implement your designs, evaluate or debug the results, and explain your approach. It might be messy; it is all important.
Independence and Self-Reliance: A core goal of CS 240 is to develop independence, confidence, and self-reliance as a learner, critical thinker, and computer scientist. We expect you to take charge of your learning and embrace an exploratory, self-reliant approach to learn strategies and accomplish tasks. We push you to accomplish a lot and experience the reward of doing so under your own power. Our instructors and tutors often answer your questions by asking you more questions to help you construct solutions yourself. Our staff is not here to step you through a task or lead you to a solution. Rather, we help you learn how to solve problems on your own and, on a deeper level, we help you learn how to figure out for yourself how to solve problems. Enthusiasm, determination, careful preparation, and a “can do, figure it out” attitude on your part are rewarded with enthusiastic support from us for learning the rest of the skills you need to grow into the role of independent, self-reliant computer scientist.
There are several types of academic support available outside of regular class and lab meetings:
- Regular Supplemental Instruction (SI) sessions meet twice weekly for structured activities reviewing concepts from class or preparing for assignments as well as tips about problem-solving strategies, working incrementally, and using software tools. These optional sessions are led by a trained alum of the course.
- Regular drop-in hours with tutors support questions on assignments or concepts.
- Regular drop-in hours or scheduled appointments with instructors support questions on assignments, concepts, course logistics, or anything else. (Email or catch us after class to schedule an appointment outside drop-in hours.)
- Peer Mentor Group meetings between your trained mentor and your cohort will happen throughout the semester and offer you support, guidance in how to succeed, and discussion of solutions to past assignments.
- Questions, studying, or group work with your classmates, subject to the honor code.
- Individual tutoring through the PLTC.
Expectations: In general, we expect you to make a genuine effort to answer your own question before asking for help on an assignment. It is rarely wise to spend hours stumped on a single issue before asking for help, but at least a few minutes of common sense exploration often nets effective results. Compiler error message? Try looking it up in the assignment or associated tool documentation to understand the error. Crashing program? Try to employ debugging strategies and tools listed in the assignment.
Preparation is your ticket to assistance: Each code assignment includes a required preparatory exercise to help understand foundations for the assignment. Weekly lab activities and SI sessions often spend time on these exercises. To promote independence and to help make the best use of everyone’s time, we require that you complete this preparation before asking instructors or tutors for assistance with the main assignment tasks. We are happy to answer questions about the preparation itself, but we will defer questions on core assignment tasks until the preparation is complete.
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 we can make the course more accessible to you. We will do our 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 firstname.lastname@example.org), 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.
Students whose religious observances conflict with scheduled course events (e.g., labs, exams, etc.) should contact the instructors in advance to discuss alternative arrangements.
How to Succeed
A compilation of tips from CS 240 staff and students. Have more? Let us know.
- Embrace the CS 240 compact.
- Read before class. It is 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.
- Do not worry 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. We have more opportunity to learn if asking questions you cannot necessarily answer easily. Better to share a wrong answer and fix it together than to keep that wrong answer to yourself for use on an exam. We will make mistakes at least a few times in class (only occasionally on purpose). Join us – it’s fun! (Third, we do not tolerate students criticizing other students for being wrong in class.)
- Take notes in class. The slides can be useful, but they are just a prop. The most useful and interesting insights happen in exercises and other discussion. Writing down your solutions (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 is 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 or build any circuit. 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. 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?
- Read specifications carefully and think critically about how best to implement them.
- Consult documentation to learn about relevant tools and library functions.
- Experiment to try out potential ideas.
- 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 do not think so, then let us know! (Oh, and lab counts toward your grade.)
- Work in the microfocus. Tackling challenging assignments next to your classmates builds camaraderie, reminds you that everyone has to work hard on these assignments, eases sharing of tips and techniques, and affords opportunities for collaborative silliness.
- General tips from PLTC Academic Peer Tutoring
Parts of this course draw 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.