Apex › Hardware
How a TPU multiplies matrices (systolic array)
The matrix-multiply engine inside Google’s TPU: a grid of tiny multiply-accumulate cells. Matrix A streams in from the left and B from the top, each row and column staggered by a cycle; every cell multiplies its two inputs, adds to a running sum, and passes them on. The stagger makes the right operands meet at the right cell at the right moment, so a diagonal wavefront sweeps the grid and every cell ends holding one entry of C = A·B — each input read from memory once. Verified in node: bit-exact against the triple-loop matmul (400 matmuls, 0 mismatch), finishing in m+n+k−2 cycles. Step the clock and watch the wavefront.
More in Hardware
- Transistors → logic gates
- Binary adder (gates→math)
- Flip-flop (how bits are stored)
- ALU (the compute core)
- How hardware multiplies fast (Wallace tree)
- Address decoding & buses
- CPU cache (sets & ways)
- How RAM works (DRAM)
- Memory, up close (guided tour)
- Polling · interrupts · DMA
- How a keystroke reaches the screen
- How an SSD works (flash/FTL)
- How flash stores a bit (floating gate)
- GPU / SIMT execution