mirror of
https://github.com/captn3m0/nand2tetris.git
synced 2024-09-17 01:40:29 +00:00
The Elements of Computing Systems, My Workbook for the NAND to Tetris course.
projects | ||
.gitignore | ||
NOTES.md | ||
README.md |
nand2tetris
Working my way through the Nand to Tetris Course
- Download the latest
nand2tetris.zip
from the book website, and overwrite everything in theprojects
andtools
directory. - Remember to run
chmod +X tools/*.sh
if you're on *nix.
Project 1: Boolean Logic
Build order as per the website. Cost for each gate in NAND in brackets.
Nand
(primitive)Not
(1)Or
(3)Xor
(6, Can be improved)And
(2)Mux
(8, Took me ages. Can be improved)DMux
(5, Super Fun)Not16
(16)And16
(32)Or16
(48)Mux16
(113)Or8Way
(21)Mux4Way16
(339)Mux8Way16
(791)DMux4Way
(37, Fun)DMux8Way
(101)
Project 2: Boolean Arithmetic
CHIPs/Gates used in brackets
HalfAdder
(Xor+And)FullAdder
(2 HalfAdder, 1 Or)Add16
(1 HalfAdder, 15 FullAdder)Inc16
(1 Add16)ALU
(6 Mux16, 3 Not16, 1 Add16, 1 And16, 2 Or8Way, 2 Or, 1 Not)
Project 3: Memory
Make sure you read through the Hardware Simulator Tutorial to understand the clock in the simulator.
DFF
(primitive)Bit
(1 Mux, 1DFF)Register
(16 Bits)RAM8
(8 Registers, 1 DMux8Way, 1 Mux8Way16) = 8 registersRAM64
(8 RAM8, 1 DMux8Way, 1 Mux8Way16) = 64 registersRAM512
(8 RAM64, 1 DMux8Way, 1 Mux8Way16) = 512 registersRAM4K
(8 RAM512, 1 DMux8Way, 1 Mux8Way16) = 4096 registersRAM16K
(4 RAM4K, 1 DMux4Way, 1 Mux4Way16) = 16384 registersPC
(1 Register, 1 Inc16, 1 Or8Way, 1 Mux8Way16)
Project 4: Machine Language Programming
Counting number of instructions by wc -l $file.hack
- Mult (18)
- Fill (98)
Project 5: Computer Architecture
Memory.hdl
(2xMux16, 2xNot, 3xAnd)CPU.hdl
Computer.hdl
Computer chip tests:
Add.hack
Max.hack
Rect.hack