This course explores the inner workings of computers, focusing on how they execute programs. Students gain an in-depth understanding of software and hardware abstractions, ranging from programming languages to transistors. Key areas covered include computational building blocks, hardware-software interfaces, data representation, and practical system abstractions. The course also emphasizes structured reasoning about program execution and promotes skills for independent learning, critical thinking, and problem-solving in computer science.
CS 240 examines how computers run programs, introducing key abstractions and implementations in software and hardware between programming languages and transistors.
Prerequisites
When Should You Take CS 240?
Prerequisite: CS 230 or permission of the instructor is required to enroll in CS 240.
Recommendations:
Consider your courseload carefully. CS 240 is a 1.25-credit lab course that requires a larger time commitment and workload than most 1-credit courses.
Take CS 240 early after finishing the CS 111 / CS 230 introductory sequence. CS 240 should boost your independence, give valuable context for how things work as you approach further computing studies, and open doors to a wide range of courses and areas in CS.
Please talk to the instructors if you have any questions or concerns. We are happy to work with you to make your time in CS 240 most effective and rewarding for you.
Learning objectives
Goals
Course goals include:
To understand how computers execute programs.
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, the memory hierarchy, 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.
The course home page hosts the working schedule. +Optional extensions are prefixed in the schedule with a plus sign. We may visit these if there is time. They are always available for your own exploration in further depth.
Computational Building Blocks:
Hardware computation building blocks:
Transistors, digital logic gates
Combinational and arithmetic logic
Sequential (stateful) logic
Overview of computer processor architecture
Data representation fundamentals:
Data representation with bits, bit-level computation
Number representation, arithmetic
The memory model, pointers, and arrays in the C language
Assertions, debugging
Hardware-Software Interface:
The instruction set architecture model, machine code, assembly language, x86
Basic program translation
Control flow
Procedures, call stack
Data layout, security implications
Abstractions for Practical Systems:
The memory hierarchy, caches
Memory allocation
Operating system basics:
Exception control flow
The process model
Virtual memory
Compilers, run-time systems, programming tools
Beyond 240
Textbooks and other notes
Texts
Electronic options are available for all required sources. At least one physical copy of each text is also available in the physical SCI L037 CS Systems Lab **for use within the CS department area.**Please use them in the data lab area and return them to the shelf when you are done.
Unfortunately, the library is not able to acquire an electronic version, but there are several options to access the book, including, but not limited to:
If you prefer physical books, paperback copies are available for much less than the hardcover version. “Global” 3rd editions mostly work, but have some additional errors (not listed on the errata page).