Skip to content
tomato

The machine

A complete FPGA computer.
A discrete ALU on copper.

256 × 32-bit registers in current FPGA RTL — eight banks of 32, with r0 fixed to zero. Dual-LUT copper underneath — 10 billion Verilator vectors on the byte slice, 130 billion on the 32-bit ALU, SymbiYosys on the datapath. Register Upgrade

  • 32-bithomebrew CPU
  • 74xxdiscrete copper
  • 524,288ALU configurations
  • 256 FPGA registerscurrent RTL · eight banks
  • ISA512-row ROM
  • Tomato OS~2.3k asm lines

When I decided to build a discrete computer on my own architecture from the transistor level, the engineering unknowns were massive—but I decided to stay long enough to resolve every single one. Tomato is the evolution of my earlier 3,488-MOSFET ALU.

Hand-soldering 3,488 transistors sounded cool, but time constraints became real. To survive, the architecture pivoted from a conventional pipeline to a polymorphic Dual-LUT3 datapath where the opcode itself is the computational value.

It behaves like a coarse-grain FPGA fabric tuned to the lowest viable unit. It melts multi-cycle software bottlenecks into native hardware primitives, transforming a fixed ALU into a 32-bit machine that synthesizes Boolean logic on the fly. Think computing (A ∧ B) ⊕ (¬A ∧ C)—the SHA-256 Choose function—in a single clock cycle, an operation that burns 4 cycles on a conventional RISC-V core.

Why it wins

Without a multiplexer: planes per bit straight into the adder — no mux.

Two independent LUT3 planes per bit feed the adder. That is how A + (B AND C) or the SHA-256 Choose step becomes a native hardware step. We don't build software loops; we rewire the ALU's truth table every cycle to absorb the math.

Core equation

out = adder(mux(An, Bn, Cn), mux(An, Bn, Cn), mux(carry / flags))

Operation family

f(a, b, c) + g(a, b, c) + h(cin)

By design, Tomato resolves any Boolean of the family f(a, b, c) + g(a, b, c) + h(cin) in a single clock cycle. Fused mask-and-add: A + (B AND C). Cryptographic acceleration: A + ((A AND B) XOR (NOT A AND C))—SHA-256 Choose—in one cycle.

The rest of this paper is optional. The facts that do not move sit in the table below: 256 × 32-bit FPGA registers, parametric ISA, hardware opcode compiler, formal sign-off. The copper is lot 07. Tomato OS paints the desktop — each glyph a native opcode.

The question everyone asks

Earlier proposal: 32,768 registers

Current FPGA RTL exposes 256 × 32-bit registers in eight banks, with r0 hardwired to zero. The earlier discrete-board proposal below explored 32,768 locations because the selected SRAMs (AS6C62256-55PCN, 32K × 8) provide a full 15-bit address space.

The comparison is retained as design history. It does not describe the register file running in the current FPGA machine.

Proposal capacity only: half the 65,536 × 32-bit physical register file in a single NVIDIA Blackwell SM.

Latest dispatch · 29 August 2026

Register Upgrade

Current FPGA RTL: 256 × 32-bit registers in eight banks. The larger SRAM superbank proposal remains in the dated journal.

A dated discrete-board proposal uses the full AS6C62256 depth. It is not the current FPGA implementation, which has 256 × 32-bit registers and r0 fixed to zero.

Earlier: Tomato works beautifully!, One Press, One Key, and HDMI color bars. The vault has thirty-four dispatches now.

Why 32,768?

32,768 GPR

15-bit AS6C62256 depth · half a Blackwell SM

why

Fig. — Register windows SETBANK2 · AS6C62256

On the bench · Lot 07

Soldering is done.

Muxes, adders, and lamps are down — the slice is on the bench.

Fig. — IronPlacing · soldering

Fig. — BenchSoldering lights · board cutaways

Hands on the Dual-LUT sliceMore frames in the Gallery

What is Tomato

Quirk The machine
3-variable ALU Operands A, B, C. out = f(a,b,c) + g(a,b,c) + cin
Dual-LUT ALU Two independent LUT3 planes per bit
Without a multiplexer Planes per bit straight into the adder — no mux
Polymorphic ALU Dual 8-bit LUT programs. 524,288 configurations with carry-select
3R-1W register file Three reads, one write on execute
256 × 32-bit in current FPGA RTL 15-bit AS6C62256 depth. Half a Blackwell SM's 65,536×32 physical file — one context
Immediate box 16 encodings: imm8, imm12, imm13, imm16, LUI
Priority-encoder MUL Multiply in 16 cycles worst, best 0. ~4 amortized
Modular control Local EEPROMs, global 9-bit opcode, 512-row ROM
Quirk The machine
Overlay word Low bits: COND, jump mode, or immediate
8 flags Z, ~Z, N, C, V, LT, GT, GTE. cin from any
Barrel shifter LSL / LSR / ASR / ROR. Amount = B[4:0]
Parametric ISA Opcode configures muxes. ~37+ family maps
Multi-cycle Von Neumann Fetch + exec; three phases if memory waits
Dark silicon 512 burned rows. The plane knows more
Write-back mux 9 ns tri-state vs 52 ns cascading 151
Byte-lane memory Word / half / byte, signed or unsigned

The facts that do not moveThe argument

II. The Hardware Compiler

A compiler in hardware

I designed a custom finite-state machine (FSM) to autonomously sweep the opcode space. By evaluating inputs A, B, and C against an expected result, the FSM iterates until a matching configuration is identified. This effectively acts as a hardware-level compiler, mapping arbitrary boolean logic operations directly to a single native opcode.

When deployed to an Artix‑7 FPGA, the FSM swept the space until it locked a native opcode. Opcode compiler

III. The Build Philosophy

74xx now. Transistors someday.

The discrete build uses 74xx series logic chips—driven by manufacturability and time constraints. The complete working computer currently runs on FPGA; the soldered 74xx hardware is its 8-bit Dual-LUT ALU slice. Someday, I want to lay the design out as raw transistors. Across those implementations, Tomato has outgrown its ALU roots. It has taken on multiple shapes: 8‑bit, 32‑bit, even 40‑bit variants—it accommodates a banked 3‑Read‑1‑Write register-file design I explored for it and the very‑long instruction word (VLIW) architecture it somehow demands.

IV. Verification & Testing

10 billion on the byte. 130 billion on the word.

The dual-LUT ALU in hardware/fpga/core is the machine that runs Tomato OS. Verilator ran 10 billion vectors on the 8-bit slice and 130 billion on the full 32-bit ALU against a golden model — every mismatch aborts. SymbiYosys proved the same datapath at 1b, 8b, and 32b. Re-run it from verification/gauntlet: make formal, make core10b, make slice130b, or make claim for all three. ALU verification

Fig. — SimulationOpcode space sweep

Fig. — Artix‑7AND3 · 0x80

The hardware compiler on the wireSweep it in the playground

Where we stand

After more than 639 hours poured into a custom computer from absolute scratch, this is where we stand.

9bopcode 5brd 5brA 5brB 5brC 3bbank

The 32-bit wordLow bits overlay as COND, jump mode, or immediate

The first programs were hex I wrote by hand. Then an assembler cobbled together on the fly, FPGA tests on the Artix‑7, simulations that ran for days, and bugs hunted at 3 AM. Dual-LUT copper is inbound; the rest of the machine is still being laid.

Tomato is the little obsession, the evolved ALU, and the most rewarding migraine I’ve ever built.

Playground · 07_alu

Turn the board that left the screen.

Drag to orbit · pinch to zoom · Dual-LUT copper in the round

The slice in the round

Tourthe board

If you love computers because of how they are built, not just what they run, this journal is the entry point.

The Vault & Journal · docs/log on paper

Source of Truth

Open GitHub.

Digital schematics, KiCad boards, opcode CSVs, formal jobs, and the vault. Authority lives in the repository.

Open GitHub

Study, build, fork.
© 2026 Tyrone Marhguy · SHL-2.1

Correspondent

Tyrone Marhguy

Builder · Computer Engineering ’28 · Penn. Little obsession, evolved ALU, most rewarding migraine—639 hours and counting.