Inside LPULite
An explainer you click through built from the LPULite source code · github.com/frankenstein-v1/LPULite

Inside LPULite

Three students designed a tiny AI chip from scratch, ran it on an FPGA — the kind of idea behind Groq's “LPU” — with a small language model on it. This takes you from a single on/off switch all the way to that chip typing “satvik”. No electronics needed.

8lanes of 8-bit numbers moving in parallel
96-bitinstruction words — 4,920 of them for one model
41.3/sfull model passes per second on a ~$377 student FPGA board
100%of the FPGA's logic used

Electricity is electrons that are free to move

materialpush

Voltage is a push, measured from a reference

supply height / voltage

Current flows one way on paper and the other way in the wire

arrows

More push, more flow; more resistance, less flow

VRwire material

Every resistor turns electrical energy into heat

voltage Vcurrent I

Two resistors in a row split the voltage

R1R2

A capacitor fills up, and it takes time

RC

Inside a chip every wire is a tiny capacitor, so switching takes time and power

gates driven (fan-out)clock f

Why computers use only 0 and 1: noise gets ignored

noise

Charge never piles up at a junction, and voltage around a loop always sums to zero

AB

Where LPULite hits these limits: its clock is 8× slower than the board's

divide the 50 MHz board clock by

Why does silicon conduct only a little?

temperature

A hole is a missing electron that seems to move

Add one foreign atom per ~5 million and silicon conducts

Press p onto n and a wall builds itself

A diode is a one-way valve for current

battery voltage

Three jobs a diode does every day

A MOSFET is a sandwich: metal, oxide, silicon

hover any layer

How a gate voltage creates a wire in silicon

gate voltage

Small Vds: a resistor. Big Vds: the channel pinches off

V_gsV_ds

PMOS is NMOS flipped: on when the gate is low

gate voltage

One PMOS + one NMOS = a NOT gate that sips power

input voltage

From 10 µm to "3 nm": and the name is now marketing

year

A chip is printed in layers, with light

A logic gate as it is actually drawn on silicon

AB

Every LPULite unit is, underneath, CMOS transistors

Eight wires make a number. Hex makes it readable.

bits

Six gates, each a tiny rule: when is the output 1?

AB

Two different circuits, the same answer for every input

AB

Write any truth table, and the circuit draws itself

ABC

A MUX is a switch controlled by a number

select bit 1select bit 0

A decoder turns a number into exactly one lit wire

address

Comparing numbers is just gates, and ReLU is a comparator plus a MUX

ABx

From one column of addition to 8 bits, with the carry racing left

A B Cin A B

Sliding bits sideways multiplies or divides by 2

xamount

Every gate takes time, and the slowest path sets the chip's speed

extra term B·C

Compute every answer at once, then let a MUX pick one

AB

Where LPULite uses MUXes, slices, comparators, shifts and adders

select lane value ctrl bits

Some circuits forget instantly. Some remember.

toggle cell holds

Two NOR gates holding hands make an SR latch

S (set)R (reset)tip: press S, release it, then press R

A D latch: a window that is open or shut

D (data)EN (enable)

Two latches back to back change only on the clock edge

D

A flip-flop needs D still around the edge — or it can't decide

when D changes

Reset now or reset at the tick — and how a flop holds

reset startslastsEN

A register is just a row of flip-flops sharing one clock

value on D busEN

Chain the flops and bits march one step per tick

serial in

A register plus a +1 adder counts — that is a program counter

jump

Data must cross the logic before the next tick — that sets Fmax

logic delayclock period

Cut a long path with registers: faster clock, but later answers

A state machine = a register that remembers “where am I”

car waiting

“Start” → busy → “done”: the handshake every hardware block speaks

start

Now read LPULite's real state machines, one tick at a time

start_iout_ready

Where LPULite remembers: 10,031 flip-flops

show

Memory is a wall of numbered boxes

addressnew value

Fast memory is tiny, big memory is slow

An SRAM bit is two inverters holding each other

storedwrite value

A DRAM bit is a leaking bucket of charge

leak (slow ↔ fast)

A memory chip is cells in rows and columns

addresscolumn mux

Synchronous memory answers one tick late

A memory can be a function

exp address aLUT inputs

LPULite fills 79% of the FPGA's memory tiles

The CPU talks to the FPGA by writing to addresses

row

A FIFO is a queue made of two chasing pointers

For AI, the pipe from memory is the bottleneck

wiresGbit/s eachmodel GB

Every memory inside LPULite

Verilog is not a program that runs. It is a drawing of wires.

A module is a box with named pins

ab

Slicing and gluing bits is just choosing wires

x[7] … x[0]

assign and always_comb build logic with no memory

absel

always_ff builds memory that updates on the clock edge

drst

<= swaps two registers. = silently breaks the swap.

An enum, a register and a case make a state machine

start

Modules go inside modules — LPULite's top box, and loops that stamp out copies

loop count

A packed struct is a bus with named bit ranges

row_scale

A testbench wiggles the inputs and checks the answer

Synthesis turns text into gates, then into a real FPGA

count bits c2 c1 c0

Read a real LPULite file end to end: row_fifo.sv

Where LPULite uses all of this

wire, reg, logic are the same bits — until two things drive one

4 bits + 4 bits into a 4-bit box: the answer's top bit vanishes

ab

Forget signed and −5 becomes 251

input laneweight lane

Forget the else in always_comb and you built a latch

sel

Reset can happen any time, or only on the clock — pick one on purpose

den

One generate for loop writes 64 copies of one MAC

mxm_size

An array of registers becomes a real memory only if the read is synchronous

Two real bit layouts: a struct that names its fields, and one that doesn't

A queue that doesn't check full quietly overwrites data

Same state machine, two ways to type it

start

A function becomes gates. $display becomes nothing

value

Write the test that would have caught the bug before the chip did

Read a waveform: the cursor is on the wrong edge

Every construct here maps to a real file you're about to write

A computer only knows one thing: is this wire on?

A transistor is a switch that electricity flips

gate voltage

Wire switches together and you get logic

AB

From one kind of gate, build every gate

A few gates in a row can add numbers

AB

Eight bits, two meanings: how chips store negative numbers

pattern

Multiplying is just shifting and adding

A chip remembers by waiting for the clock tick

D (input)

Two ways to store a bit: fast and big vs small and slow

A normal computer: one worker fetching from far-away memory

Add a fraction to an integer, for free

fraction bits

Build a floating-point number by hand

Why 0.1 + 0.2 ≠ 0.3 on almost every computer

mantissa bits kept

Every number format is a trade: range against precision

format

Push a number past its limit: wrap or stick?

behaviourraw value

Inside a multiplier: a grid of AND gates, then adders

toggle bits of B

Booth's trick: turn a run of 1-bits into two additions

multiplier B

Why multiply costs so much more than add

bit width n

The chip's 87 hardened multipliers mostly sit outside the multiply array

unit

Summing many products needs more bits than any one of them

terms summed

Give a whole row of numbers just one exponent

One outlier, and a shared scale punishes everyone

outlier value

Every extra bit and every extra step costs picojoules

view

Every idea on this page, somewhere on the chip

technique

The simplest CPU: one giant slow step per instruction

Fix it like a laundromat: start the next load before this one finishes

instructions

Overlap breaks when one instruction needs the last one's answer

forwarding

The other break: the CPU doesn't know which way a branch goes yet

Guess better with a tiny memory: the 2-bit saturating counter

pattern

Memory is 200× slower than the chip — so keep a copy nearby

Not one cache — a hierarchy, each ring bigger and slower

source

Same maths, same answer — 3 different loop orders, 3 different speeds

Stop doing it one number at a time — do 8 (or 16) at once

lane width

More cores help less than you'd think — the leftover serial part wins

fraction parallelizablecores

Don't let one slow instruction block everyone behind it

schedule

All of that cleverness stops helping the moment the "loop body" is 7 billion numbers

modelstored as
memory

Everything that makes a CPU fast also makes it unpredictable

One neuron: multiply, add, then squash

x₀x₁x₂
w₀w₁w₂bias

A layer is just a matrix times a vector

x₀x₁x₂

Learning is sliding downhill on a loss curve

weight w

Backprop: the chain rule, one node at a time

Training carries three extra copies that inference doesn't

A character becomes a row of numbers

Averaging the past is dumb — attention weighs it

current position

Four narrow attentions beat one wide one

MLP width ×

One transformer block — then stack it

layers stacked

Logits → softmax → pick → append → repeat

temperature

Recomputing every past K and V is wasted work

tokens generated

Reading the prompt is parallel; writing new text is one at a time

Three numbers price out every model

An AI model is billions of multiply-and-adds

A language model writes one token, then runs again

The real bottleneck: moving the weights, not doing the maths

modelnumbers stored as
memory speed

Three bets: a few smart workers, thousands of simple ones, or an assembly line

Groq's idea: fast memory on the chip, and a plan decided in advance

Groq's chip: instructions flow north, data flows east and west

Squeeze every number into 8 bits — with a shared scale

Why 8-bit maths makes a chip so much smaller

bits per number

Two ways to build a chip: rewire a board or cast your own silicon

How an FPGA becomes any circuit: a tiny truth table in memory

presetAB

Same chip budget, opposite bet: control or arithmetic

cores drawn on the same die area

One line of code, run by 65,536 threads at once

threads per block (blockDim)

Weights live in HBM, a PCIe hop away from the CPU's DDR

compare

cuBLAS is fast because it reuses every number it loads

tile size (numbers reused per load)

Decode uses 0.2% of the chip; prefill uses almost all of it

decode batch size (requests sharing this GPU)

More requests per batch: more throughput, slower per user

batch size (concurrent requests)

Every remembered token costs 128 KiB — for real, per sequence

context lengthbatch

Between two fast kernels, the GPU can just sit there idle

Attention rewritten to never materialise the big matrix

One model, many GPUs: split the matrix, or split the layers

One decode step: mostly waiting on weights, barely any maths

The GPU die and its memory are built separately, glued together after

For one user waiting on one answer, a GPU is the wrong shape

Who decides what happens next: the chip, or the compiler?

Inside the chip: instructions flow north, data flows east & west

slice

Delete the guessing hardware, and every run takes exactly the same time

design

230 MB of very fast memory — fast enough, but you need hundreds of chips

modelstored aschip generation

Chain the chips: each layer on its own chip, the token flows through

rack size

One user, one stream: milliseconds per token, side by side

Fast for one user is not the same question as cheap per token

requests served together

2026: Nvidia's Groq 3 LPX — what's published, what isn't

view

Google's bet: a matrix-multiply ASIC, chips wired together by light

generation

Cerebras' bet: don't cut the wafer into chips at all

Three more bets: open silicon, in-memory compute, and hard-wired transformers

Where each bet sits: capacity vs bandwidth, flexible vs efficient

What LPULite actually rebuilt — and at what scale

The whole chip in one drawing — six parts and two roads

The chip's unit of data: a row — 8 small numbers and 1 shared scale

scale exponent

Two shared roads, and one sender per tick

narrow road (8-bit)
wide road (32-bit)

One instruction = 96 switches that set every unit at once

Hover any field. There is no opcode: each group of bits drives one unit directly.

The conductor doesn't think: it just counts

One multiply–accumulate cell, with scales that don't match

The matrix unit: 64 cells multiplying in the same tick

The clever trick: build W · x out of repeated outer products

SXM doesn't do maths — it turns rows into columns

The vector unit: an assembly line that each row rides through

RMSNorm with a 32-entry lookup table instead of a square root

Softmax needs ex and division — the chip uses two tables

scores

After the maths, squeeze back to 8 bits — by counting shifts

Two memories: the model and the scratchpad

Hover any block. Every address is decided by the compiler before the chip runs.

Take one real row from the compiled image — what does it actually do?

real row

Ten real ticks: the chip's very first computation, cycle by cycle

A memory read isn't instant — trace the real 2-tick hold

One MAC cell, two different ways to align mismatched scales

64 identical copies of one line: the real generate loop

Two magic numbers, 5A5 and A5A — and why the board skips them

Five real registers, s0 through s4 — and three 2-to-1 muxes

vxm_ctrl bits:

Softmax is a 4-state machine — walk it with 4 real scores

Requantizing takes exactly 2 clock edges — proved by the testbench

The bus is two tiny modules: a mux and a decoder

producer
consumer

The compiler is a Python program that writes the chip's program

What the ARM does 900 instructions at a time, forever

Quartus says the logic tops out at 9.84 MHz — here's the report

The model it runs is tiny — on purpose

compare with

One transformer layer, coloured by which part of the chip does it

The compiler turns a model into 974 rows and 4,920 ticks

Attention, done by ordinary units in sequence

Follow one character through the machine: v → i

Reading the prompt vs writing new letters: every letter is a full pass

What it actually prints: sat → satvik

One board, two brains: an ARM computer and an FPGA

The design fills the FPGA to the last block

The chip ticks at 6.25 million times a second — because it has to

Where a character's time goes: mostly not the chip

From SystemVerilog to a silicon layout — as a showcase

It printed “sata”, then nonsense — here's what fixed it

How do you know a chip is right? Compare at every level

What's real, what's partial, what it isn't

Same ideas, wildly different scale

What it would take to run a real 8-billion-weight model

Where to go from here

Every word, one line each

Nine months, one chain: every month breaks the one before it

Every pick passed the Milen test — scored from its real narration

How to not become someone who knows many names and nothing else

Month 1: how does a switch become a computer?

Month 2: what is a gate made of, and why is it slow and hot?

Month 3: describe hardware in text and put it on a real chip

Month 4: what limits speed, and how do real CPUs go faster?

Months 5–9: from what a model computes to your own accelerator on silicon

NPTEL: not the teacher — the problem sets and the certificate

What to buy, what is free, and when you need it

Auto-saved every snap, note and highlight lands here by itself — nothing to file away.

Your notebook: every snap, note and highlight

Every tool we plugged in — and what we didn't

One tap on 🧪 Try it live near a page's heading opens the tool already set up for that idea, with one small task. Green = wired into a page. Amber = worth knowing about, but linked out instead of embedded. Red = looked at and rejected, with the reason.

Watch and take notes, lying down

Chapters

Lying down mode: voice, read-aloud & the remote

1 · Get set up — one tap each

2 · Ten things you can just say

Tap any card above to try it right now, even without a microphone.

3 · The keys, if your hands are free

Hold v to talk once, without switching voice on for good.

4 · Try the mic right now

Say something…

Logic lab: build it, don't just watch it

clock 2 Hz
⚠ unstable — oscillating
Waveform strip tap a wire's ◎ to record it here

Verilog lab: rebuild LPULite, one module at a time

A real Icarus Verilog compiler runs entirely in this tab (WebAssembly) — nothing leaves your browser. Write the module, hit Run grader, read the waveform.

Loading Verilog compiler (~3 MB, first run only)…
console
run it to see output here.

Practice: cards that remember what you forget

🔥 0streak

Mastery by part

Practice gym: every topic, one question at a time