Project 2

In this project we start constructing our computer. To keep with our goal of using nothing but NAND-gates, we first implement the basic logic gates using NAND-gates.

You will find template HDL files for the chips Not, And, Or, Xor, Mux, and DMux in the directory projects/01 of the Nand2Tetris software suite.

Your task is to implement these six chips using Nand-gates—but you can use the chips you have already implemented. For instance, if you first implement Not using Nand, then you are allowed to use Not when implementing the And gate (because that means that ultimately, everything is done using Nand-gates).

The directory contains a test script for each gate — use the HardwareSimulator to check that your gate satisfies the test script.

If you are not completely sure what each gate should do (in particular Mux and DMux may be new to you), check the description in Section 1.2.2 of our textbook.

You should upload each HDL file individually to our submission server.

Careful: All these chips are also built into the HardwareSimulator. For instance, you can build an And-gate out of a Nand-gate and a Not-gate, and it will just work, because the Not-gate is already built into the HardwareSimulator. However, if a Not.hdl file exists in the same directory as the And.hdl file, then the HardwareSimulator will load the Not.hdl file instead of using the built-in gate. Therefore an unimplemented or incorrect Not.hdl file in the same directory will break your And-gate. Make sure to implement things in the order in which they are used, or try everything in a separate directory.