This repository contains my implementation of the projects from The Elements of Computing Systems, also known as Nand2Tetris. The projects build a computer system from first principles, starting with basic logic gates and working up through hardware and architecture to an operating system.
The repository is organized into chapters matching the book structure. Currently implemented chapters include:
- Chapter 1: Boolean Logic - Implementation of basic logic gates
- Chapter 2: Boolean Arithmetic - ALU and arithmetic chips
- Chapter 3: Sequential Logic - Registers, memory, and program counter
- Chapter 4: Machine Language - Assembly language programs
- Chapter 5: Computer Architecture - CPU and computer implementation
- Chapter 6: Assembler - Hack assembler implementation
- Chapter 7: Virtual Machine I - Stack arithmetic VM implementation
- Chapter 8: Virtual Machine II - Program control VM implementation
- Chapter 9: High Level Language - Implementation of Snake in Jack
- Chapter 10: Compiler I - Syntax Analysis
Future chapters to be implemented:
- Chapter 11: Compiler
- Chapter 12: Operating System
All implementations are tested using the web-based tools available at nand2tetris.github.io/web-ide/chip. This provides an integrated development and testing environment that works directly in the browser, requiring no local software installation.
The web IDE provides:
- Hardware simulator for testing
.hdl
files (Chapters 1-5) - CPU Emulator for testing assembly (
.asm
) programs (Chapter 4) - VM Emulator for testing VM (
.vm
) implementations (Chapters 7-8) - Jack Compiler for compiling Jack files (
.jack
) into VM files (.vm
) - Built-in test scripts and comparison files