Hey everyone,
Most people build 8-bit computers to run Pong or Tetris. I wanted to see if I could push a custom 8-bit architecture to do something much harder: train a neural network from scratch.
I built VirtualPC, an open-source 8-bit computer system simulated from basic NAND gates up to a functional CPU that can train a small neural net from a folder on your computer.
Repository: https://github.com/ninjahawk/VirtualPC
› The ML Core
Instead of importing PyTorch, everything happens at the bare-metal assembly level:
Custom ISA: The Instruction Set Architecture was designed to handle the math needed for machine learning.
Low-Level Training: The CPU executes forward and backward passes directly through custom assembly code.
Matrix Math on 8-bit: Overcoming severe memory limits using disk-backed memory swapping to store weights.
› The Architecture
Python-Based VM: Runs the entire simulated hardware environment.
Custom Assembler: Translates raw assembly files into machine code binary.
Full Stack OS: Handles basic I/O and memory management from the ground up.
Building this taught me exactly how machine learning math translates into physical CPU cycles. The project is completely open-source and free to mess around with.
[link] [comments]