Building a computer from logic gates to a functioning CPU
This repository contains my project work for the NAND2Tetris: Elements of Computing Systems course, completed as part of the Elements of Computing curriculum in my B.Tech program.
NAND2Tetris is a bottom-up exploration of computer systems — constructing an entire computer from NAND gates to a working CPU, purely from first principles. This repository documents my implementations across multiple stages of that journey.
🚀 Completed Projects: 1, 2, 3, and 5 from the official NAND2Tetris project sequence.
Project 1 – Logic Gates
Implementation of fundamental and composite logic gates using only NAND gates in HDL.
Project 2 – Arithmetic Logic
Construction of arithmetic circuits including adders and the Arithmetic Logic Unit (ALU).
Project 3 – Sequential Logic
Design of flip-flops, registers, and RAM modules.
Project 5 – Computer Architecture
Complete implementation of the Hack CPU and memory system.
Each project folder contains HDL source files and official test scripts for verification using NAND2Tetris simulators.
/project1 → Logic gate implementations /project2 → Arithmetic circuits and ALU /project3 → Sequential circuits and memory /project5 → Hack CPU and memory architecture
🖥 Online Web IDE:
https://nand2tetris.github.io/web-ide
Steps:
- Open the Web IDE
- Upload the project files from this repository
- Run the provided
.tstscripts in the Hardware Simulator or CPU Emulator
Course Website: https://www.nand2tetris.org
Project Instructions: https://www.nand2tetris.org/course
This work was completed as part of the Elements of Computing semester course.
The course develops a deep understanding of computer systems by connecting:
- Digital logic design
- Computer architecture
- Memory organization
- Low-level system implementation
The emphasis is on learning by building, not theory alone.
- Hardware Description Language (HDL)
- Digital logic and gate-level design
- Arithmetic and sequential circuits
- Memory organization
- CPU architecture (Hack Computer)
Based on the curriculum and materials from:
NAND2Tetris – The Elements of Computing Systems
by Noam Nisan and Shimon Schocken
This project is licensed under the MIT License.
Copyright (c) 2026
Krish Singh (github.com/wasitkrish)