Last visit was: Thu Nov 12, 2026 9:33 pm
It is currently Thu Nov 12, 2026 9:33 pm



 [ 4 posts ] 
 Gate Singular - build a computer from NAND logic gates only 
Author Message

Joined: Tue Nov 03, 2026 8:56 am
Posts: 2
Hi all. We're the team behind Gate Singular a logic gate simulator game.

We wanted a logic sim we could play with friends and build anything in, from a single latch up to a whole computer. The games we tried weren't realistic enough or fast enough for what we had in mind, so we wrote our own.

In this game, NAND is the only logic gate. NOT, XOR, latches, adders, RAM and the CPU are all build directly from NANDs. The simulator has no gate delay, so whole circuit settles within half of the clock, (including even complext feedback loops).

The biggest thing we've built in it so far is a 16-bit computer.

Image

Specs:
- 16-bit CPU with 24-bit instructions (8-bit opcode + 16-bit data)
- 24-bit instructions: a 3-bit field picks the sources and the destination (A, B, an immediate, memory at an address, or memory pointed to by A or B), a 5-bit field picks the operation, and the last 16 bits are the operand. Implemented 30 instructions (206 including 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.
- One instruction is executed per clock. Instruction in read while the clock is low, and executed when it goes high
- Program ROM: rows of switches, filled with binary code using hex editor

It runs OS that 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. Commands include ls, ed, cat, rm, asm, run and others. Below is Hello World after it's been written in ed and assembled into executable:

Image

Happy to answer anything about the CPU, the simulator, anything. If you want to try the simulator yourselves, the game is here: https://store.steampowered.com/app/5402 ... ce=anycpu1


Sun Nov 08, 2026 2:22 pm

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1900
Division in a single clock? That's extraordinary!


Sun Nov 08, 2026 8:22 pm

Joined: Tue Nov 03, 2026 8:56 am
Posts: 2
BigEd wrote:
Division in a single clock? That's extraordinary!

Image

We basically unwrapped a loop in the algorithm, and made 16 cascades of subtractions/shifts/etc stacked sequentially on top of each other.
Since the game guarantee all gate logic to settle within one clock level (even in case of feedback loops), there is no problem with gate HW physical delay here. In reality that would mean slow enough CLK to ensure all gates to settle.


Mon Nov 09, 2026 1:03 am

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1900
Thanks - that makes sense - in this world rather in the physical world! Normally that would be far too expensive in clock speed and chip area.


Mon Nov 09, 2026 7:44 am
 [ 4 posts ] 

Who is online

Users browsing this forum: Chrome-11x-bots, claudebot, SemrushBot and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software