Announcements
- Most announcements will be on Piazza.
Class Info
Class: TTh 1:15–2:30, Science Center 199
Professor: Vasanta Chaganti
Piazza: Q&A Forum
GitHub: Swarthmore GitHub Enterprise
Office hours (Vasanta): SCI 252D, Mon: 3:00 - 4:30 PM, Thu: 2:30 - 4:00 PM
Office hours (Scout): SCI 262A, Thu: 11:15 - 12:15 PM, Fri: 3:00 - 4:00 PM
Office hours (Rich): SCI 251, Mon: 9:15 - 10:15 AM, Mon: 1:30 - 2:30 PM
Weekly Lab Sessions
|
Section A |
Rich Wicentowski |
Wednesdays 8:50—10:20 AM |
Science Center 240 |
Section B |
Scout Sinclair |
Wednesdays 1:15—2:45 PM |
Science Center 240 |
Section C |
Vasanta Chaganti |
Wednesdays 3:00—4:30 PM |
Science Center 240 |
Welcome to CS31!This course is a broad introduction to computer science that focuses on how a computer works and how programs run on computers. We examine the hardware and software components required to go from a program expressed in a high-level programming language like C or Python to the computer actually running the program. This course takes a bottom-up approach to discovering how a computer works, and introduces parallel and distributed computing with a specific focus on parallelism for multicore and other shared memory systems. Topics include theoretical models of computation, data representation, machine organization, assembly and machine code, memory, I/O, the stack, the operating system, compilers and interpreters, processes and threads, and synchronization. In addition to parallel programming, we will discuss parallel computers and system-level support for parallel computing. Prerequisite: Completion of CS21 or its equivalent.
The course is composed of the following:
-
Readings: The readings serve as a first exposure to new topics, where
students learn the basics of the material.
-
Class meetings: The classroom material will cover the difficult concepts
and facilitate student discussions.
-
Labs: There are several lab programming assignments (in C) that will
explore various aspects of systems programming.
-
Exams: There is a midterm exam and a final exam (both closed-book)
covering the material in the class meetings and labs.
Textbook & Clicker:
Rather than requiring a textbook, we're going to use readings from the web as our introduction to new material. The textbook we've used in the past for this course is: Computer Systems: A Programmer's Perspective by Bryant and O'Hallaron (Second edition: 2/E CS:APP2e). It's a great reference, and I recommend it as a supplemental source of information, if you're interested. I will list corresponding sections for this book, when applicable.
This course will use iClickers to facilitate
feedback and discussion during class. Clickers may be purchased at the college
bookstore or online. Please register your device as soon as you
get it. Registering allows me to give you credit for quizzes and class
participation. We will begin using clickers for credit at the start of week 2!
Goals for the course:
By the end of the course, we hope that you will have developed the
skills to:
- Implement programs in the C programming language.
- Organize and express data in a variety of formats (integers, strings, etc.).
- Characterize the execution of a program on the OS and underlying hardware.
- Translate between high-level language constructs and low-level assembly instructions.
- Analyse the systems-related costs associated with application performance.
- Evaluate OS abstractions and apply them in programs.
- Classify storage devices and their performance according to their role in the memory hierarchy.
- Debug and examine applications using GDB and Valgrind.
- Desing and implement parallel solutiosn to programming problems that require synchronization.
Schedule
This is a tentative schedule; it may change as we go. You should read the assigned sections
before class to prepare for the reading quiz. All readings refer to the Bryant and O'Hallaron textbook unless otherwise indicated (e.g., there's a link to some other source).
WEEK |
DATE |
ANNOUNCEMENTS |
TOPIC & READING |
ASSIGNMENTS |
1 | Jan 22 | Class Audio | Course Introduction No Readings. | No Lab |
Jan 23 | Lab Audio | Lab, Week 1 | Lab 1 |
Jan 24 | Class Audio | Data Representation Reading: Binary and Data Representation Read Sections: Introduction, Number Bases and Unsigned Integers, and Converting Between Bases The readings are password protected. Please find instructions to access the readings on Piazza. |
2 | Jan 29 | Class Audio | Binary Arithmetic Reading: Signed Binary Integers Binary Integer Arithmetic, Integer Overflow Textbook (supplemental): 2.1.8, 2.1.10, 2.2.3, 2.3-2.3.1, Types (Supplemental) Why the Negation Shortcut Works |
Jan 30 | Lab Audio | Lab, Week 2 | Lab 2 |
Jan 31 | Class Audio
Drop/Add ends (Feb 02) | Introduction to C Programming Reading: C for Python Programmers (Sections 1.5 - 2.5) |
3 | Feb 05 | No Audio | Digital Circuits Reading: Basic Logic Gates and Digital Circuits up to Storage Circuits Textbook (supplemental): 1.4.1, 4.2 - 4.2.4 |
Feb 06 | Lab Audio | Lab, Week 3 | Lab 3 |
Feb 07 | Class Audio | Digital Circuits, Cntd. Reading: Computer Architecture, Origins of Modern Computing and, Building a Processor. |
4 | Feb 12 | Class Audio | ISAs and Assembly Reading:Diving into Assembly, Sections 6, 6.1, 6.2, 6.3 Textbook (supplemental): 3.0, 3.2 |
Feb 13 | Lab Audio | Lab Week 4 |
Feb 14 | Class Audio | ISAs and Assembly, Cntd. Reading:Functions in Assembly, Conditional Control and Loops Textbook (supplemental): 3.4 - 3.4.2, 3.6 - 3.6.2. |
5 | Feb 19 | Class Audio | Pointers and Memory Reading: The 5-minute guide to C pointers, A Deeper Dive into C, Program Memory and Scope, C Pointer Variables |
Feb 20 | Lab Audio | Lab, Week 5 | Lab 4 |
Feb 21 | Class Audio | Pointers and Memory, Cntd. Reading: Pointer Arithmetic (skip "Two dimensional arrays" and "Pointer subtraction") and malloc & free. Textbook (supplemental): 3.5.1, 3.8.2, 9.9.1-9.9.2, 9.11 - 9.11.2, 9.11.7 - 9.11.10. |
6 | Feb 26 | Class Audio | Functions and the Stack Reading: Functions, Data Movement, and Functions in Assembly
|
Feb 27 | | Lab, Week 6 | Lab 5 |
Feb 28 | CLASS CANCELLED | CLASS CANCELLED |
7 | Mar 05 | Class Audio | Functions and the Stack, Cntd. Reading: From x86 Assembly Guide, read about the call and ret instructions and the subsequent "Calling Convention" section - scroll down a little to view. |
Mar 06 | | Midterm Q&A, Work on Maze Lab. |
Mar 07 | Midterm Exam |
| Mar 12 | Spring break |
Mar 13 |
Mar 14 |
8 | Mar 19 | Class Audio | Functions and the Stack, Cntd. Reading: From x86 Assembly Guide, read about the call and ret instructions and the subsequent "Calling Convention" section - scroll down a little to view. |
Mar 20 | Lab Audio | Lab, Week 8 | Lab 6 |
Mar 21 | Class Audio | Arrays, Structs, and Pointers. Reading: Arrays in C, The String Library, Structs. |
9 | Mar 26 | Class Audio | Arrays and Structs Contd. |
Mar 27 | | Lab, Week 9 | Lab 7 |
Mar 28 | Class Audio
CR/NC and Withdraw deadline (Mar 30) | Storage and the Memory Hierarchy Reading: Introduction, Storage Devices, Memory Hierarchy. |
10 | Apr 02 | Class Audio | Caching Reading: CPU Caches up to Set Associative Caches Textbook (supplemental): 6.3 - 6.4.4 |
Apr 03 | Lab Audio | Lab, Week 10 (Link to Lab Week08) | Lab 8 |
Apr 04 | Class Audio | Caching, Cntd. Reading: Set Associative Caches |
11 | Apr 09 | Class Audio | Operating Systems and Processes Reading: Operating Systems, How an OS works. |
Apr 10 | | Lab, Week 11 |
Apr 11 | Class Audio | Operating Systems and Processes cntd. Reading: Processes, up to the first exercise. |
12 | Apr 16 | Class Audio | Parallel Applications and Threading Reading: Shared Memory, Programming Multi-core systems, POSIX Threads |
Apr 17 | | Lab, Week 12 | Lab 9 |
Apr 18 | Class Audio | Parallel Applications and Threading Contd. Reading: Synchronizing Threads Textbook (supplemental): 12.7.4-12.7.5. # |
13 | Apr 23 | Class Audio | Race Conditions and Synchronization Reading: Mutual Exclusion, Semaphores, Barriers and Conditional Variables. |
Apr 24 | | Lab, Week 13 |
Apr 25 | Class Audio | Race-Conditions-and-Synchronization cntd. (Parallel applications with pthreads) Reading: No reading quiz. Review previous readings. |
14 | Apr 30 | Class Audio | Virtual Memory Reading: Virtual Memory (up to Virtual and Physical Addresses in Paged Systems). Textbook (supplemental): 9.0-9.2, 9.5, 9.6.0. |
May 01 | | Lab, Week 14 |
May 02 | Class Audio | Virtual Memory, Cntd. Reading: Virtual and Physical Addresses in Paged Systems, Paging Implementation, Memory Efficiency. |
| May 12 | Final Exam 9:00am-12:00pm SCI 199 |