Is this class for me? You should have good procedural programming skills and be able to write simple programs. If you are a successful CSC 402 student, you should have this under control. Some familiarity with Java might be helpful. What is most helpful is to be a programming nut.
You should be curious about this question: What is the connection between a program and the machine it runs on? This is what the course is all about.
In addition to programming skill, prerequisite to being successful in this course are tenacity, a sense of adventure, a willingness to share what you have learned, and the courage to be a guinea pig in what promies to be a fun, frightening and sometimes frustrating enterprise. A course similar to this one has been taught at Taco Bell and at The Efi Arizi School of Computer Science in Israel. Rumor has it it has also been taught at Harvard and at the Lock Company.
Software Particulars You wll be using the TECS Software Suite. Your machine must be java-enabled to use this software. My TAs can help you with that. Get it done right when you arrive at NCSSM, if not before. The page linked here has a complete guide to the software, and all modules have detailed tutorials. You will want to view these as the course progresses. If you are really hard-core, you can get the source code and compile it yourself in Java. For this you will need to have a Java SDK. You installed this if you took CSC 404.
I recommend doing this in a Linux environment. You should do a Windoze install of Ubuntu and operate out of that for this class. There is information on how to do this on the Prepare your Lappy Page
Course Objective You will build a virtual computer starting from the base level of abstraction of the NAND (not and) gate and going up to the Jack language, a simple object-oriented programming language. You will progress through all of the layers of abstraction and see how the hardware supports the software. You will write some simple programs in Jack.
Course Goal You will become aware of the layers of abstraction between software the the NAND chip and you will be able to understand their relationships.
Course Outline This class is orthogonal to the usual run of undergraduate computer science courses and cuts across several areas including
- Algorithms
- Computer Architecture
- Operating Systems
- Compilers
- Software Engineering
The class falls into three major components.
Part 1, Boolean Algebra and Logic Gates We begin with the NAND gate and learn how to implement boolean functions in the Hardware Simulator. All of these features are stateless. They remember nothing.
Part 2, The Hardware Layer We begin the study of sequential logic and study the creation of RAM. We can then hold machine language programs in memory. We will learn about Hack, the machine architecture of our virtual machine. We will need to build an ALU (arithmetic-logic unit) for our machine.
Part 3, The Software Layer Now comes assembly language, a (somewhat) human-readable language for programming our virtual machine. We create an assembler to convert assembly language into machine code. Then stack arithmetic and program control are integrated to create the compiler for Jack, our programming language. The compiler will need a lexer and parser to generate assembly code. Finally, we create the operating system.
Stanford's Outline
Depending on what youall tolerate, we will proceed somewhat like this. Our route may deviate somewhat from this plan, but this is a pretty good ballpark estimate.
The course consists of ten modules. Each module comprises a lecture, a book chapter, a key hardware or software abstraction, and an implementation project. The computer platform is built gradually, one project at a time. Executable solutions are supplied where necessary.
1. Hello, World Below: Demonstration of interactive games (like Pong, Tetris, Sokoban) running on the computer built in the course, tracing their execution from the object-oriented language level down to the Nand level; The abstraction / implementation paradigm and its role in systems design; Overview of the Hardware Description Language (HDL) used in the course; Designing a set of elementary logic gates from primitive Nand gates; Implementing the gates in HDL.
2. Combinational logic: using the previously built logic gates to design and implement a family of binary adders, culminating in the construction of a simple ALU (Arithmetic-Logic Unit). Sequential logic: building a memory hierarchy, from elementary flip-flop gates to registers and RAM units of arbitrary sizes.
3. Machine language: introducing an instruction set, in both binary and assembly (symbolic) versions; writing some low-level programs in the assembly language and running them on a supplied CPU emulator. Computer architecture: Integrating the chip-sets built in weeks 1-2 into a computer platform capable of running programs written in the machine language. Said otherwise – building a hardware platform that realizes the machine language abstraction.
4. Assembler: Basic language translation techniques (parsing, symbol table, macro-assembly); Building an assembler for the assembly language presented in week 3.
5. Virtual machine: The role of virtual machines in modern software architectures like Java and .NET; Introduction of a typical stack-based VM language: arithmetic commands, flow-of-control and subroutine call-and-return commands; Implementing a VM translator that translates from the VM language into the assembly language presented in week 3.
6. High Level Language: Introducing a simple high-level object-based language with a Java-like syntax; Discussing various trade-offs related to the language design and implementation; Writing a simple interactive game and running it on the computer built in weeks 1-5. This project makes use of the compiler and operating systems built in the remainder of the course.
7. Compiler I: Context-free grammars and recursive parsing algorithms; Building a syntax analyzer (tokenizer and parser) for the high-level language presented in week 6; The syntax analyzer will generate XML code reflecting the structure of the translated program.
8. Compiler II: Code generation, low-level handling of arrays and objects; Morphing the design of the syntax analyzer built in week 7 into a full-scale compiler; This is done by replacing the routines that write passive XML with routines that generate executable VM code for the stack machine presented in week 5.
9. Operating system: Discussion of OS/hardware and OS/software design trade-offs, and time/space efficiency considerations; Design and implementation of some classical arithmetic and geometric algorithms that come to play in the implementation of the OS’s Math and Graphics libraries, as well as classical mathematical, memory management, string processing, and I/O handling algorithms, needed for completing the OS implementation.
10. More fun to go: Discussing how the computer system (hardware and software) built in the course can be improved along two dimensions: optimization, and functional extensions; Proposed directions for further explorations on the soft site (e.g. building an HTTP server) and on the hard side (e.g. possible FPGA implementations).
Class Organization This class consists of one giant project broken into several layers of abstraction. We are going to implement a virtual computer in memory. You will turn in pieces of the project as you go along. The final project will consist of writing a project in Jack on this computer. As we progress, specs will be developed for each layer. You must keep building the computer so you can keep things running.
Grading Your grade is based the your average of the projects you write. All projects will be scored on the The Five Point Scale. When you visit this link, you will see all of the classroom policy documents linked on the left. Read them; you are responsible for being aware of their contents. If you have questions ask.
Academic Honesty in this Class: See the departmental statement on academic honesty.