2 pointsby teotexe16 hours ago1 comment
  • teotexe16 hours ago
    Hi HN,

    I built Sappu (Simple As Possible Processing Unit) to teach myself low-level C programming and computer architecture simultaneously.

    It’s a simulation of the SAP-1 architecture (popularized by Malvino and Ben Eater). Instead of emulating high-level behavior, I modeled the hardware explicitly. In fact, the entire CPU - registers, ALU, and Control Unit - is built on top of just these two C functions:

    wire NOT(wire a){ return !a; }

    wire NAND(wire a, wire b){ return !(a && b); }

    From there, I built the derived gates (AND, OR, XOR), then flip-flops, then the bus interactions.

    It includes a custom assembler and a CLI visualization to watch the control signals fire in real-time. The goal was to understand exactly how instructions physically move through a bus.

    I’d love any feedback on the C implementation or the architecture logic!

    Repo: https://github.com/teotexe/Sappu