nowfound

Life & fun · December 30, 2024

WIP NandToTetris Emulator in pure C – logic gates to ALU to CPU to PC

* OPEN TO CONTRIBUTIONS * NandToTetris is a course which has you build a full computer from: Logic gates -> Chips -> RAM -> CPU -> Computer -> Assembler -> Compiler -> OS -> Tetris All this is done via software defined hardware emulation. I'm building an emulator for this entire stack in C. How is my approach different to other projects that build emulators? - No external dependencies (so far) - Start with a single software defined NAND gate in C - EVERYTHING is built from this base chip - Don't use certain programming utilities: boolean logic operators, bitwise logic operators etc Instead…

WIP NandToTetris Emulator in pure C – logic gates to ALU to CPU to PC launched on December 30, 2024 with 43 votes, #524 of 5,365 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 1 year on.

Visit github.com ↗Alternativestop 10% of December 2024

In plain words

This is a pure C emulator project for the Nand2Tetris course that builds a complete computer system from basic logic gates upward. Starting with a single software-defined NAND gate, the project constructs everything—chips, RAM, CPU, assembler, compiler, and operating system—without external dependencies. It's designed for educators and students learning computer architecture who want to understand how digital systems work from first principles, with the unusual constraint of avoiding built-in boolean and bitwise operators to force implementation from foundational gates.

written from the facts on this page · September 2026

From the sources

Partially emulated HACK PC from primitive logic gates (in C) - con-dog/hack-emulator-c

A really simple way to start contributing would be to write some truth table tests for the logic gates, then move up to more complex components. #include <stdio.h> #include "test-nand.h" #include "nand.h" #include "test-utils.h" void test_nand ( Test_Counter * counter ) { // Truth table for NAND: expected outputs const int expected [ 4 ] = { 1 , 1 , 1 , 0 }; // outputs for (0,0), (0,1), (1,0), (1,1) for ( int i = 0 ; i < 4 ; i ++ ) { Nand nand = { . input . a = ( i >> 1 ) & 1 , // Gets first bit (0011) . input . b = i & 1 , // Gets second bit (0101) }; nand_gate ( & nand ); test_assert ( nand . output . out == expected [ i ], counter , "NAND(%d,%d) should be %d" , nand . input . a , nand .…from github.com

In the maker’s words, at launch

* OPEN TO CONTRIBUTIONS * NandToTetris is a course which has you build a full computer from: Logic gates -> Chips -> RAM -> CPU -> Computer -> Assembler -> Compiler -> OS -> Tetris All this is done via software defined hardware emulation. I'm building an emulator for this entire stack in C. How is my approach…

Does a similar job

all alternatives →
  • I made a programmable computer from NAND gates2024 · github.com · ▲420

    I am proud to present my solo hobby project NAND. This year-long undertaking follows the completed Nand to Tetris course, but ported to the web with its own runtime, user interface, and IDE. Using the "Load example program" selector, you can try out some programs I wrote on NAND's emulated hardware such as 2048, a genetic algorithm, and a manual stack overflow to corrupt the screen. Check out NAND at https:&#x2F;&#x2F;nand.arhan.sh Additionally, I've authored an extensive writeup about the project. Read about it on the GitHub repository's readme.

  • My summer project - simulated CPU built from NAND gates2011 · github.com · ▲17

    A simulated CPU built using only NAND gates. Contribute to IsaacLewis/NAND-CPU development by creating an account on GitHub.

  • Using SQL's Turing completeness to build Tetris2024 · github.com · ▲338

    Using SQL's Turing Completeness to Build Tetris. Contribute to nuno-faria/tetris-sql development by creating an account on GitHub.

  • A new hobby OS from “scratch” in C#2017 · github.com · ▲310

    A multitasking monolithic Kernel based x86 targeting Operating System written in C# from scratch aiming for high-level implementation of drivers in managed environment. - amaneureka/AtomOS

  • We built an 8-bit CPU as 2nd year EE studentsJun 2026 · github.com · ▲108

    Hi! me and my friends together built an 8 bit CPU implemented in Logisim purely from scratch. The control unit of this system does not implement the generic microcode ROM or any kind of RAM. This was made purely from discrete logic gates and coded the system to run different programs. key features: Custom 16-instruction Harvard ISA, 8-bit fixed format, 4 general purpose registers Hardwired control unit built entirely from AND&#x2F;OR gate logic matrix Dual-phase clocking to eliminate race conditions Bootstrap Control Unit that cold-boots via ROM-to-RAM transfer Early-exit conditional…

  • TI
    Tetris Implemented in ClojureScript2019 · djblue.github.io · ▲135

More life & fun this month

the category →

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, December 2024

the whole month →
  • Remy AI▲2,170

    Anyone can sleep and recover better

    AI · 2024 · apps.apple.com

  • Remento▲1,681

    The AI biographer for loved ones

    AI · 2024 · remento.co

  • Aimfox▲1,213

    Built for LinkedIn outreach, made to close deals

    Growth · 2024 · aimfox.com

  • Stackfix▲1,112

    Compare software in seconds

    AI · 2024 · stackfix.com

  • Coval▲1,012

    Simulation & evals to ship delightful voice & chat AI agents

    AI · 2024 · coval.ai

  • VocAdapt▲961

    Master languages with AI-adapted authentic content

    Life & fun · 2024 · vocadapt.com