Show HN: I made a programmable computer from NAND gates

ArchAndStarch | 419 points

Wow that is a great side-project, and a great README to boot. I've been meaning on working through Nand to Tetris after playing around some with Ben Eater's 6502 Computer (https://eater.net/)

rpmw | 10 days ago

I could make a few college classes out of this. Well done material.

kristopolous | 10 days ago

Great work! You have seen the levels of abstraction that most programmers won't throughout their careers.

farhanhubble | 9 days ago

Fantastic work. NAND to Tetris helped me land my first job out of college.

2OEH8eoCRo0 | 10 days ago

Doing a design for this (specifically, design a microcoded, pipelined RISC processor, from the bottom up, with nothing but NAND gates) was the main problem on the Computer Hardware quals exam at UC Berkeley in the early 1990s. We didn't have to physically build it, though, just produce the detailed design on paper.

not2b | 9 days ago

This is amazing work. I wanted to build something similar (virtual) while I was taking the Nand2Tetris course. I'm so impressed that you actually did it. You must have a really good understanding of how computers work now.

ryeguy_24 | 10 days ago

This is excellent work! I recently started Nand2Tetris myself, and hope to finish part 1 (the HW part of the course) sometime in the next few months. I blogged about my progress here: https://gurudas.dev/blog/2024/04/13/nand-to-tetris-2024-proj...

bhasi | 8 days ago

Liar. You used NAND gates and a clock.

IncreasePosts | 9 days ago

Awesome work! Bookmarked for in-depth perusal later. As a fan of NAND-to-Tetris, but never made it all the way through, I look forward to poking around in your project.

mikestew | 10 days ago

Curious, how many NAND gates are there in total?

gmiller123456 | 10 days ago

Thank you. First principles FTW!

apienx | 10 days ago

Seymour Cray would have loved this. Some of his computers were all NAND gates.

Animats | 10 days ago

The readme is so detailed. God job.

BooleanMaestro | 6 days ago

Can anybody recommend challenges similar to this one?

greenavocado | 9 days ago
alanjay | 9 days ago

Incredible achievement! Good job.

greenavocado | 9 days ago

On one hand cool project, on the other - e-waste, unless made of recycled ics.

SomeoneFromCA | 8 days ago

Nice job. Now we should program it in subleq2[0] :D

[0] https://en.wikipedia.org/wiki/One-instruction_set_computer

theanonymousone | 9 days ago

this is fantastic! great work...

fire_ball | 10 days ago

NAND is popular probably because of nand2tetris, but it's worth mentioning that NOR is also a universal gate; and many early computers like the https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#Logic... were entirely made of NOR gates.

userbinator | 9 days ago

Turing Complete[0] is a fun game similar to this where you create your own computer from NAND gates, including your own assembly language.

[0] https://store.steampowered.com/app/1444480/Turing_Complete/

bramhaag | 10 days ago

Wow, seriously impressive. And the fact that this is the work of basically a high-schooler.

I fear for the kind of competition my kids will have just to make it to college.

elevatedastalt | 9 days ago

Ground up projects like this are fascinating!

It’s also neat how “ground” has been deepening. It used to mean building mainframe from source. Then building a compiler. Now building from logic gates.

How much deeper can you get? Building a mainframe out of Gödel numbers?

pyuser583 | 9 days ago

[flagged]

m3kw9 | 10 days ago

Cool project. It reminds me of a theoretical issue. As the project page says, this system is clearly Turing equivalent. Since it runs software, it even implements a _universal_ Turing machine. But the design uses only (synchronic) sequential logic [1] and Wikipedia seems to suggest that automata theory considers sequential logic only equivalent to finite state machines. Not Turing machines. Isn't that clearly a major bug in automata theory?

My guess is that automata theory consideres it critically important that a "Turing machine" has an infinite tape, while intuitively it instead seems relevant that it has something like a tape at all, some sort of random access memory, even if it is finite. I think such a memory system can't be implemented with classical finite state machines, at least not with comparable time complexity for read and write, but can be realized with sequential logic.

[1] https://en.wikipedia.org/wiki/Sequential_logic

cubefox | 10 days ago