COMP 40 presents the hardware foundation on which software is built.
- Machine structure shows how data is represented at the machine level.
- Assembly language is how code is represented at the machine level.
- The construction of very high-level abstractions and programming languages on top of very low-level hardware is one of the great intellectual achievements of computer science, and every computer scientist should know about it.
- The data and code model of any particular machine, called
its instruction-set architecture, represents a
contractual agreement between hardware designers and systems
programmers that allows a collection of programs to run on
any hardware which conforms to the instruction-set
architecture. The exploitation of instruction-set architecture to
enable both hardware and software to be changed independently and
reused with each other is one of the great engineering
achievements of computer science, and every computer scientist
should know about it.
(Some of the fruits of this exploitation include operating systems that will run on any x86-compliant hardware; the ability to buy new, more advanced CPUs without having to replace your software; and the ability to create and use “virtualization environments” such as VMware, QEMU, Xen, and so on.) - A programmer may understand a high-level program's outputs and interactions by understanding only the model of computation presented by the programming language. But to understand how a program performs, one needs a working knowledge of computation at the machine level.
- When something goes wrong in a software system, diagnosing the fault often requires the ability to break the abstraction barriers presented by programming languages and to inspect the state and behavior of the machine at its own level, not the level of programs' source code.
- Much software that is critical to the world's computing infrastructure is written in the languages C and C++, and to understand how this “systems software” works, one must understand machine-level computation.
- You will be able to understand and improve the real performance of programs written in high-level languages.
- You will be able to diagnose and fix bugs that can't be explained without appealing to the underlying machine model. Many important bugs in C and C++ programs fall into this class.
- You will have started learning how to exploit the underlying hardware in ways that are not possible using high-level languages alone.
Norman's prerequisites
You must grasp basic algorithms, data structures, and good programming practice. Moderate proficiency in either C or C++ is required. In particular,- You should have experience with implementation and use of binary search trees, hash tables, and linked lists.
- You should be comfortable working with stacks and queues.
- You should be able to write a recursive function (or procedure or method) and explain why it terminates.
- You should have mastered the ability to write, organize, and document a 250-line program in C or C++.
- You should have some practice writing, organizing, and documenting a 500-line program in C or C++.
- You should have written programs that use
newanddelete(C++) ormallocandfree(C).
You need some Unix experience.
You must understand the basics of files, directories, creating and
editing files, printing, and compiling programs.
You will be much, much happier if you also can write a simple shell
script (sh, ksh, or bash) and use Awk and
grep effectively.
Kernighan and Pike cover these
topics at the appropriate level; the book is on reserve at the library.
This course uses the 64-bit instruction-set architecture of Intel Core 2 Duo, which may be the most complicated architecture money can buy. To avoid spending many, many hours thrashing out written assignments, you must have or develop the ability to identify relevant information buried in a sea of irrelevant detail. Your course staff will help as we are able.
The most important prerequisites for this course cannot be taught. To do well in this or any other systems course, develop these habits:
- Think carefully about a problem before you begin to write code.
- When having difficulty writing code, stand up, walk away from your computer, and think about the difficulty.
- Never be satisfied with a ``working program,'' but strive for the simplest, clearest, most elegant implementation.
How can I find out more?
Course admin and course materials
Thanks to Chloe Lopez, you can send an anonymous comment on lecture (or anything else) at any time.
Back to Norman Ramsey's home page