From Nand to Tetris in 12 steps
413 6 41520
Google Tech Talks
October 10, 2007
We describe a new approach and a course that aims to demystify the integrated function of computer systems, using a hands-on approach. The course presents many abstractions, algorithms, and data structures learned in CS courses, and makes them concrete by building a complete computer system from the ground up. In particular, we guide the students through a modular series of projects that gradually construct and unit-test a simple hardware platform and a modern software hierarchy, yielding a surprisingly powerful computer system.
The hardware projects are done in a simple hardware description language and a hardware simulator supplied by us. The software projects (assembler, VM, and a compiler for a simple object-based language) can be done in any language, using the APIs and test programs supplied by us. We also build a mini-OS. The result is a GameBoy-like computer, simulated on the student's PC. We start the course (and this talk) by demonstrating some video games running on this computer, e.g. Tetris and Pong.
Building a working computer from Nand gates alone is a thrilling intellectual exercise. It demonstrates the supreme power of recursive ascent, and teaches the students that building computer systems is -- more than anything else -- a triumph of human reasoning. We are able to squeeze all this into a single course since we deal with neither efficiency nor advanced features, leaving these subjects to other courses in the program. The resulting approach is completely self-contained, requiring only programming as a pre-requisite. Hence, courses based on the approach can be given at almost any stage in a CS program.
Speaker: Shimon Schocken
By anonymous 2017-09-20
There's a great textbook called The Elements of Computing Systems: Building a Modern Computer from First Principles by Noam Nisan and Shimon Schocken, which serves as the basis for a university course taught by the authors called Workshop In Computer Construction - From
NAND to Tetris in 12 Steps. This course is also taught at other universities under different names.
The official companion web site is http://nand2tetris.org/
Don't let the title "Computer Construction" fool you. By "computer", the author does not just mean the rectangular plastic box on your desk, he means the entire computing system, from the individual logic gates up to highest-level application programming.
The book/course teaches you
- how to create your own individual logic gates
- how to build your own logic circuits
- how to build your own CPU
- how to program in machine code directly
- how to program in your own assembler (which you wrote in machine code)
- how to write your own virtual machine
- how to design, implement and program in your own high-level language (which you wrote in assembler)
- how to write a bootloader
- how to write an operating system
- and ultimately how to write a simple game