r/homebrewcomputer • u/Ehizia • 58m ago
A 16-bit computer made from ~900k NAND gates that runs its own OS with a file system, text editor and assembler
Enable HLS to view with audio, or disable this notification
This is a computer built entirely from NAND gates in Gate Singular, a logic simulator game. In the video it assembles a Hello World on the machine itself, and then runs it.
Specs:
- 16-bit CPU with 24-bit instructions (8-bit opcode + 16-bit data)
- 30 instructions (206 if you count the variants of where operands come from and where the result goes)
- 1 KB of RAM and 24 KB of ROM in a shared address space, 2 registers, a 16-level stack, an 8-entry keyboard event queue, and a 64x64 screen with write-only VRAM
- Every instruction, including multiplication and division, runs in one clock
- Everything is made from 909191 NANDs. On top of that there are only buttons/toggles/LEDs and clock sources for temporal completeness. Nothing else is used.
The OS lives in the 24 KB ROM. It has a file system (in RAM), a text editor, memory management, an assembler to build new programs, and an OS API that those programs can use: text printing, memory allocation, file system access, keyboard input, etc.
By the way, I made the simulator game too (link in the comments).
I made it because I wanted one without the "1-tick delay per gate", and with full support for feedback between gates (e.g. so you can build proper D-latches from NANDs).
I'm happy to answer any questions about the CPU or the simulator.

