NAND  by ArhanChaudhary

Logic simulator suite made from NAND gates, emulated on the web

created 2 years ago
573 stars

Top 57.1% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

NAND is a web-based, Turing-complete 16-bit computer built entirely from emulated NAND gates, designed to teach computer architecture and low-level programming. It offers a full software stack including a CPU, custom programming language (Jack), compiler, assembler, and IDE, targeting students and enthusiasts interested in understanding computer fundamentals from the ground up.

How It Works

NAND emulates the Harvard architecture with a separate instruction and data memory. Its CPU is an accumulator machine, relying on registers for control flow. The system compiles programs written in the Jack language (similar to C/Java) into virtual machine code, which is then translated to the CPU's minimal instruction set. This approach allows for a deep dive into how hardware and software interact, abstracting complex logic into fundamental NAND operations.

Quick Start & Requirements

  • Access via web browser at https://nand.arnav.tech/.
  • No specific hardware or software prerequisites beyond a modern web browser.
  • Setup is instantaneous upon visiting the URL.

Highlighted Details

  • Features a custom object-oriented language, Jack, with weak typing and manual memory management.
  • Includes a suite of example programs demonstrating complex logic like Pong, 2048, and genetic algorithms.
  • The IDE, while functional, is noted as finicky due to its reliance on contenteditable and custom cursor logic.
  • Explores potential vulnerabilities like stack smashing and integer overflow due to the 16-bit architecture and language design.

Maintenance & Community

  • The project is based on the Nand to Tetris course and book.
  • The primary developer is Arhan Chaudhary.
  • Community interaction points are not explicitly listed in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. The project's nature as an educational tool based on Nand to Tetris suggests a non-commercial or educational use focus, but this requires verification.

Limitations & Caveats

  • The 16-bit architecture imposes significant limitations on memory (4 KiB RAM) and integer range (-32768 to 32767), leading to potential overflows and precision issues.
  • The Jack language has quirks like lack of operator precedence and specific behaviors for comparison operators that can lead to unexpected results.
  • The IDE is described as slow and buggy.
Health Check
Last commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
13 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.