This page collects reading and class material by topic. Readings should be completed in preparation for the accompanying class meeting.

Contents:

Textbooks

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).

How to read for CS 240

CS 240 moves quickly and covers a lot of ground. To make class time effective, students should be ready to hit the ground running. Class meetings and group exercises will assume cursory familiarity with basic ideas from assigned readings posted on the course schedule. 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. Regular reading quizzes will help motivate you to be prepared to participate.

Bonus benefits of reading:

  • Class is more fun if come with a rough idea of where we’re going and what to watch out for along the way.
  • Spending x minutes on reading now often saves multiples times x minutes of puzzlement or debugging later while working on assignments.
  • We get to spend more time in class doing and less time listening to lectures.

Most topics on the course schedule have associated reading. Effective reading for computer science courses demands a staged approach. Aim for two types of reading:

Before class, do an initial reading of the assigned material and try simple exercises in preparation for class.

Do not worry about understanding every last detail.

Do aim to acquire:

  • A big-picture view of the pieces we will consider about this topic.
  • Some familiarity with basic mechanics of the ideas introduced.

To help distinguish core points from secondary concerns during initial reading, each reading is listed with one of two style directives:

  • Read means read for enough detail to do indicated reading exercises. If you do get stuck or confused by some details, do not worry. Make a note and move on. If we do not clear up your confusion in class, ask a question or come to office hours.
  • Skim means read for high-level ideas. Perhaps pick out a couple details that look interesting and accessible. Do not spend much time trying to understand all the details before moving on.

Learning how to identify essential vs. inessential details during a first reading is an important skill that takes time to develop. As the semester progresses, we will leave more of this to you.

Readings assignments may indicate specific exercises to try as you read before class. These are typically practice problems from the reading.

  • Try means work through enough of the exercise to see how the basics work. Do not feel obligated to finish every example. Do what is useful to you. (Do not submit anything.)

We typically highlight exercises that practice mechanics. Feel free to try other practice problems as well. They may require more time and critical thinking. We will explore such interesting examples in class.

Short reading quizzes (administered electronically before class or on paper in class) count toward your grade. They will be short and similar in style to reading exercises, focused on basic concepts and mechanics. Sometimes things are just too busy. We will drop the lowest 20% of your reading quiz grades.

After class, revisit readings in more depth and try more practice problems to work out details as needed.

More advice

Our main text (CSAPP) sometimes goes into more detail than we will cover, so learning to “read around” extra detail is a useful skill, especially in your pre-class reading.

When reading from CSAPP:

  • “Asides” are optional. If you read them, skim them.
  • “New to C?” blocks can be useful, but usually only if they are short.
  • Some sections (e.g., 2.2 - 2.4 on integer and floating point representations) can be too dense for our purposes. We try steer you around them, but if you find other things getting dense, flip to another reading or just make a note and jump ahead.
  • This book really shines with later material about machine/assembly language, caching, memory management, and other topics. We use it intermittently in the first section of the course, then extensively for the latter two.

Tia Newhall (Swarthmore College) has more good advice on reading computer science textbooks.

Material by Topic

topic the plan

← Tuesday, 26 January

In-class material (slides)

Preparation and reference:

  • Read: Syllabus
  • Skim: CSAPP 1.0 - 1.7, 1.9.2 - 1.10

Computer Hardware Implementation

topic digital logic

← Tuesday, 26 January - Friday, 29 January

In-class material (slides)

Preparation and reference:

By class on Friday, you should be familiar with at least the basics of logic gates, notation for Boolean expressions, and a little Boolean algebra.

Alternatives if DDCA is not your style:

topic data as bits

← Tuesday, 2 February

In-class material (slides)

Preparation and reference:

How to read

Binary and hexadecimal number systems

Information as bits + context

  • Read: CSAPP 2 - 2.1.2
  • Exercises: CSAPP practice problems 2.1 - 2.4. (Solutions at end of chapter.)
  • Skim: CSAPP 2.1.3, 2.1.5 - 2.1.6.

Bitwise Boolean algebra and bit manipulation

  • Read: CSAPP 2.1.7 - 2.1.10 (including the 2 Asides on pages 55-56.)
  • Exercises: CSAPP practice problems 2.8, 2.9, 2.14, 2.16
  • Optional: K&R 2.7, 2.9 for C reference

topic integer representation

← Friday, 5 February

In-class material (slides)

Preparation and reference:

  • Read: DDCA 1.4.5 (pages 15-19), alt. ebook, or on Google Books
  • Alternatives:
    • SCO A.4 - A.5
    • Mechanical approach: Two’s Complement
    • CSAPP’s treatment of number representation is more thorough, but some students find it too dense. Consider reading it if you understand the other material and want more insight.
      • Read: CSAPP 2.2 - 2.2.3.
      • Skim: CSAPP 2.2.4 - 2.2.8.
      • Read: CSAPP 2.3

topic combinational logic

← Tuesday, 9 February

In-class material (slides)

Preparation and reference:

Karnaugh Maps

Multiplexers and decoders

topic logic for arithmetic, ALU

← Tuesday, 9 February

In-class material (slides)

Preparation and reference:

Adders

  • Read one of:
    • DDCA 5.1 - 5.2.1 (pages 233-234) up through Ripple Carry Adders (feel free to skim beyond if you are curious), alt. ebook (ignore Verilog and VHDL)
    • SCO 3.2.3 (Arithmetic Circuits)
    • Digital Circuits: Adders up until Carry Lookahead Adder (feel free to skim beyond if you are curious)

Arithmetic Logic Unit

  • Read one of these to understand the high-level organization of an ALU. We will look at details of a specific ALU design in class.

topic latches, flip-flops, registers

← Friday, 12 February - Tuesday, 16 February

In-class material (slides)

Preparation and reference:

topic memory devices

← Tuesday, 16 February

In-class material (slides)

Preparation and reference:

topic a simple processor

← Friday, 19 February - Tuesday, 23 February

In-class material (slides)

Preparation and reference:

Read for general organization and design points about instruction set architecture and microarchitecture. We will build our own toy architecture in class and lab.

  • Read: Central Processing Unit (Operation section)
  • Read: SCO 2.1 - 2.1.2, 2.2.2, 5.1 - 5.1.2 (stop at “Note that having separate address spaces for instructions and data”), skim 5.1.3 - 5.1.4
  • Alternatives:
    • Read: CSAPP 1.4.1, 2.1.0
    • DDCA 7.3-7.3.3 (alt. ebook) describes a similar microarchitecture for a similar 32-bit ISA, but relies on some detail from an extensive discussion of instruction set architecture in Chappter 6. Our coverage will be more cursory.

Hardware-Software Interface

topic programming with memory

← Friday, 26 February - Friday, 4 March

In-class material (slides)

Preparation and reference:

General memory model:

  • Read: SCO 2.2.2 - 2.2.3, 5.1.2 (stop at “Note that having separate address spaces for instructions and data”)
  • Read: CSAPP 2.1.0, 2.1.4 - 2.1.6

Mix and match to learn about addresses and pointers in C:

topic reasoning about programs

← Friday, 4 March

In-class material (slides)

Preparation and reference:

For later:

topic x86 ISA, assembly

← Tuesday, 8 March

In-class material (slides)

Preparation and reference:

Background

  • Skim: CSAPP 3 - 3.2

Data Movement

  • Read: CSAPP 3.3 - 3.4 (including “New to C?” to help remember those pointers…)
  • Exercises: try CSAPP practice problems 3.1, 3.2. Take a look at practice problem 3.5, but don’t spend too long on it. We’ll try more like this in class.

Arithmetic

  • Read: CSAPP 3.5 - 3.5.4
  • Exercises: try CSAPP practice problems 3.7, 3.8. (Note x <<= 2; is the same as x = x << 2;.)
  • Skim: CSAPP 3.5.5

topic control flow

← Friday, 11 March - Tuesday, 15 March

In-class material (slides)

Preparation and reference:

Comparisons, Tests, and Jumps

  • Read: CSAPP 3.6 - 3.6.3
  • Exercises: Try CSAPP practice problems 3.13 - 3.14. Just consider what operator you’d put in place of COMP or TEST to match the assembly code. (Don’t worry about #define etc. if you don’t remember how macros work.)

Translating ifs and loops

  • Read: CSAPP 3.6.4 -3.6.5
  • Exercises: CSAPP practice problems 3.16, 3.20

Translating switch statements

  • Skim: CSAPP 3.6.7

topic procedures and stacks

← Friday, 18 March - Tuesday, 29 March

In-class material (slides)

Preparation and reference:

  • Read: CSAPP 3.7
  • Exercises:
    • CSAPP practice problem 3.30. This not how call is typically used, but it is a good test to check if you understand exactly what the call instruction does.
    • CSAPP practice problem 3.33.

topic buffer overrun exploits

← Friday, 1 April

In-class material (slides)

Preparation and reference:

  • Read: CSAPP 3.12
  • Exercises: CSAPP practice problem 3.43.

topic data structures

← Tuesday, 5 April

In-class material (slides)

Preparation and reference:

  • Read: CSAPP 3.8 - 3.10

Abstractions for Practical Systems

topic memory hierarchy and cache

← Friday, 8 April - Tuesday, 12 April

In-class material (slides)

Preparation and reference:

  • Read: CSAPP 1.5-1.6, 6.2-6.5

topic exceptional control flow

← Friday, 15 April

In-class material (slides)

Preparation and reference:

topic operating systems, process model

← Friday, 15 April

In-class material (slides)

Preparation and reference:

topic shells and signals

← Friday, 22 April

In-class material (slides)

Preparation and reference:

topic virtual memory

← Friday, 22 April - Tuesday, 26 April

In-class material (slides)

Preparation and reference:

topic dynamic memory allocation

← Friday, 29 April

In-class material (slides)

Preparation and reference:

topic garbage collection

← Tuesday, 3 May

In-class material (slides)

Preparation and reference:

topic compilers, runtime systems, Java

← Tuesday, 3 May

In-class material (slides)

Preparation and reference:

topic beyond 240

← Tuesday, 3 May

In-class material (slides)

Preparation and reference: