Systolic Arrays Explained
How the hardware multiplies matrices
An interactive guide to the systolic arrays inside matrix engines, one clock cycle at a time, drawn from a cycle-accurate model.
Loading the animation…
How this is checkedChecked against RTL: the weight-stationary array with shadow weights, written in SystemVerilog and simulated in Verilator 5.020, matches the cycle-accurate model on every register after every clock edge: 17,488 values, 0 mismatches (29,180 across three designs). Synthesised with Yosys: a 16 × 16 array is 203,392 gates and 16,000 flip-flops. How it is tested →
The RTL beside the model
The waveform is the weight-stationary array in Verilator, read from its VCD; below it is the model's frame for the same clock edge. Step through: the shadow weights shift down each column while the previous tile computes, and each PE swaps them in as the next tile's first activation arrives. Shift the model by one cycle and the mismatches light up (511 of 1,116 registers), the check's negative control. Synthesis numbers for every PE and array size are on the model page.
Loading the waveform…
What you'll learn
A matrix unit is a grid of multiply-accumulate cells that pass numbers to their neighbours every clock cycle: each operand is fetched from memory once and used by a whole row or column of cells. This site takes that machine apart one cycle at a time: which operand stays put, how the inputs are skewed so everything meets at the right moment, and where the cycles go.
Every animation is drawn from a cycle-accurate model of the array (Python reference, exact TypeScript port). Its weight-stationary and output-stationary frames, and the processing element's pipeline, match SystemVerilog designs simulated in Verilator on every register after every clock edge: 29,180 values, 0 mismatches.
01
Why systolic?
The memory wall, and Kung's answer: fetch each number once and pass it from processor to processor, so a grid of n × n multipliers needs only 2n words a cycle.
02
Weight-stationary, cycle by cycle
The TPU's dataflow: weights sit still, skewed activations march right, partial sums flow down and drain out of the bottom. Every register, every cycle.
03
Output- and input-stationary
The same matrix multiply in three dataflows side by side: what stays put, what moves, and what that costs in memory reads, link hops and register writes.
04
Skew, fill and drain
Why the inputs arrive as a staircase, how long the array takes to fill and empty, and what that does to utilisation as the matrices grow or stop fitting.
05
Tiling big GEMMs
A matrix bigger than the array, cut into weight tiles and run back to back: double-buffered weights hide each tile's load, and the dataflow decides how many words the buffer must deliver.
06
Inside a PE
One processing element, bit by bit: a three-stage MAC that multiplies bfloat16 or FP16 exactly and accumulates in FP32, checked register for register against the author's RTL.
07
The TPU
The matrix units in a chip (MXU, vector and scalar units, on-chip memory, HBM) and the chips in a pod: an all-reduce on a 2-D torus, step by step.
08
Other ways to build it
GPU tensor cores against systolic arrays, Eyeriss's dataflow taxonomy with row-stationary animated, and computing in or near memory.
09
From graph to silicon
An ONNX model lowered onto the array: im2col turns a convolution into a GEMM, the GEMMs become weight tiles, and the cycle-accurate count meets a simulator's estimate.
The model, its conventions and the RTL cross-check: the model.
New to the Hardware track? Start here: the four sites in reading order, what you need first, and a glossary of the terms they define.
Built by a hardware engineer
The author designs hardware: the RTL, SoC and signal-integrity work behind this track is public too.
- The author's portfolio: Everything in one place: the hardware work, the explainer sites, the deck series and how every number is checked.
- A transformer decoder in RTL: SystemVerilog with 84 passing tests (a Python golden model and cocotb), synthesised in Vivado 2025.2 for an Artix-7: its 4 × 4 systolic array is 455 LUTs, 901 flip-flops and 16 DSPs at 156.8 MHz (the README's synthesis table).
- The decoder, module by module: A walkthrough of every RTL module, the verification and the synthesis numbers.
- RTL challenges for LLM accelerators: Systolic array, mixed-precision MAC, softmax pipeline, KV cache and more, each simulated (two run inside Systolic Arrays Explained).
- FPGA design challenges: FPGA architecture, synthesis, timing closure and the Vivado and Quartus flows, with RTL exercises.
- A five-stage RISC-V SoC: BRV32P: a pipelined RV32IMC core with caches and an AXI4-Lite fabric in Verilog, and a MESI cache controller (Cache_Controller_MESI).
- Modern SoC design: Slide decks from chiplets and advanced packaging to on-chip interconnects and silicon implementation.
- Equalisation in high-speed serial links: One 28 GBd backplane channel end to end: S-parameters, CTLE, FFE and DFE, a noise budget.
- Signal integrity: Seventeen decks on getting a signal from one chip to another intact, every number computed by a model.
- All the hardware decks: RISC-V, Arm, AMBA, simulators, photonics and more.
Part of a family of sixteen companion sites in four tracks, all in the site menu above: Foundations (Decoder, Training), Hardware (Kernels, Systolic, Accelerators, Racks), Inference (Serving, Architectures, Numerics, Trade-offs) and Agents (Harnesses, Protocols, Context, Orchestration, Evals, Security). This site is the silicon inside a matrix engine. How it was built, and how to check it: about.