ninjahawk

ninjahawk / VirtualPC

Public

8-bit computer from one NAND gate, a live-evolving neural net, and virtual CPU

19
1
100% credibility
Found May 18, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Python
AI Summary

VirtualPC is an educational project that lets you build and run a complete 8-bit computer entirely in Python. Starting from a single NAND logic gate, it constructs an Arithmetic Logic Unit, a CPU, an assembler, and a virtual machine that can run programs you write in a custom assembly language. The project includes an AI Pong game where a neural network opponent learns while you play, plus an experimental system called FluxOS where you describe what you want (like 'learn XOR') and gradient descent discovers the underlying logic gates from examples you provide. Everything runs in pure Python with no extra dependencies, and the entire machine fits in your head.

How It Works

1
🔍 You discover a computer that builds itself

You find a project where someone built an entire working computer from scratch, starting with just one tiny logic gate.

2
💻 You run your first program

You launch the virtual machine and run simple programs like 'hello world' or a number guessing game, all running on a computer you can see and understand.

3
🏓 You play Pong against a learning opponent

You open the Pong game and discover the AI paddle learns while you play. Score against it, and it gets worse. Let it score, and it gets better.

4
You explore two different paths
⚙️
Write your own programs

You write assembly code to make the virtual CPU calculate Fibonacci numbers, draw patterns, or run games. Everything traces back to those original logic gates.

🧠
Teach the computer by example

In FluxOS, you type 'learn XOR' and then show it examples: '0+0=0, 0+1=1, 1+0=1, 1+1=0'. The machine figures out the logic on its own through training.

5
👁️ You watch the computer teach itself

In FluxOS, you see the machine discover XOR, AND, and OR gates purely from examples. You can watch a live display where the circuit draws itself as it learns.

🎉 You understand how computers really work

You've experienced building a computer from the ground up, watched an AI learn in real-time, and discovered that programming can mean teaching by example instead of writing instructions.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 19 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is VirtualPC?

VirtualPC is a complete 8-bit computer simulator written in Python that builds everything from a single NAND gate. You get a working virtual CPU with a custom assembly language, a two-pass assembler, file-backed memory that persists between runs, and a REPL where you can write and execute programs directly. The project includes a Pong game where a neural network opponent runs inference entirely in custom assembly on the virtual CPU, plus an experimental layer called FluxOS where you describe desired behavior and gradient descent builds the actual logic gates.

Why is it gaining traction?

The hook is the educational depth: every operation traces back to a single NAND gate with no shortcuts, so the entire machine fits in your head. Unlike simulators that abstract away the hardware, this one makes you feel the stack. FluxOS adds a genuinely novel angle where programs are trained rather than written. The live evolutionary Pong training is a compelling demo that shows the neural net improving in real-time while you play.

Who should use this?

Computer science students learning how CPUs actually work will get more from this than from reading a textbook. Embedded systems developers who want to understand assembly from the ground up. Anyone curious about differentiable computing or neural network inference on custom hardware. The Pong game makes it accessible for newcomers, while the NAND-to-CPU architecture satisfies more advanced readers.

Verdict

This is a well-documented, creative project with a clear educational mission and working test suites. At 19 stars with a 1.0% credibility score, it is early-stage and unproven at scale. The code is clean and the ideas are solid, but the community is tiny. Treat it as a learning resource rather than production tooling.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.