I attended a Tiny Tapeout workshop with essentially zero chip design experience and made a 2×2 INT4 systolic array ready to be taped out, and built an 8x8 handwritten digit classifier to run on the chip. This blog post documents the journey of designing the chip in Verilog and building the software and firmware on top of it.
Table of Contents
- Background
- What Even Is a Systolic Array?
- Designing and Verifying the Chip
- Submitting to the Shuttle
- Building the Digit Classifier
- Takeaways
- Conclusion
Background
I signed up for a "Make Your Own Chip" workshop hosted with Tiny Tapeout with essentially zero experience in chip design. You would think it would be sensible to start small, like a fun little logic gate or a 4 bit counter.
Naturally, I decided I wanted to build a systolic array, the hardware engine behind modern AI accelerators like Google's TPUs, and use it for some model inference. Quite ambitious I dare say. But first, some background knowledge is needed.
What Even Is a Systolic Array?
If you've ever done modern machine learning, you know that everything boils down to matrix multiplication. Doing it sequentially on a normal CPU or GPU means constantly fetching the same weights and numbers from memory over and over again, which is very wasteful in terms of compute.
A systolic array addresses this issue with a grid of small Processing Elements (PEs) that transfer data from neighbour to neighbour on every clock tick, like blood pumping through a heart (hence the word "systolic"). Each number in a matrix enters the edge of the grid once and gets reused by every PE it passes through.
Output-Stationary vs. Weight-Stationary
There are two main types of systolic arrays, output-stationary and weight-stationary. I came across a great YouTube video by SigFyg demonstrating a 3×3 systolic array. In the video, the rows of matrix A and the columns of matrix B intersect into the array simultaneously at each clock tick, and each cell computes its final answer within the PE. That is an example of an output-stationary array.
The process sounds very elegant. Unfortunately, Tiny Tapeout gives each project a very small pin budget: 8 dedicated input pins (ui_in), 8 dedicated output pins (uo_out), and 8 bidirectional pins (uio).
For a 2×2 array using 4-bit integers (INT4), streaming two rows of A (8 pins) and two columns of B (8 pins) at the same time eats up 16 input pins. That would consume every single input and bidirectional pin on the chip, leaving zero pins for control signals, not to mention that the final answers would still be trapped inside the PEs, needing extra logic and multiplexers just to output them.
Instead, I went with a weight-stationary architecture:
- First, you shift the 4-bit weights into the PEs and park them there (
load_weight = 1). - Next, you switch to compute mode (
load_weight = 0) and stream skewed 4-bit activations from left to right. - Each PE multiplies the incoming activation by its stored weight and adds the partial sum coming from above (
psum_out <= psum_in + (a_in * weight)), passing the result downward.
This only requires 8 data input pins (reusing ui_in for weights first, then activations), and the finished outputs will naturally flow out the bottom of the grid.
Okay, so if systolic arrays are so good at matrix multiplication, why aren't they as popular as normal GPUs? Simply put, that's all they can do. GPUs are far more flexible and can handle general-purpose workloads, whereas systolic array hardware like Google's TPUs are hyper-specialised one-trick ponies. If some revolutionary new AI architecture comes out in the future that doesn't rely on matrix multiplications, the TPU is now a $10,000 piece of junk.
Verilog vs Wokwi
Tiny Tapeout also supports Wokwi, where you drag and drop logic gates in a GUI to build a chip visually. It is technically the beginner friendly way to design a chip. At one point I wondered if I could convert my design into Wokwi just to see it wired up.
However, inserting the Verilog into a digital design converter demonstrated that a single 4-bit multiplier and 8-bit adder expands into over a hundred basic logic gates. Across four PEs plus all the flip-flops, that's easily 500 to 700+ individual components. I am NOT manually wiring 700 logic gates on a website GUI. Verilog it was.
Designing and Verifying the Chip
Architecture and Pinout
The design ended up being surprisingly clean and modular with just three Verilog files:
simple_pe.v: A single 4-bit weight-stationary PE.systolic_2x2.v: Wires foursimple_pemodules into a 2×2 grid.project.v(tt_um_systolic_array): The Tiny Tapeout top-level wrapper.
Because a 2×2 grid produces two 8-bit column outputs (c_col0_out and c_col1_out) and Tiny Tapeout only gives you 8 output pins (uo_out[7:0]), I used uio_in[1] as a simple multiplexer switch (0 = Column 0, 1 = Column 1). A neat little hack.
| Pin | Function |
|---|---|
ui_in[3:0] |
4-bit activation / weight input for Row 0 |
ui_in[7:4] |
4-bit activation / weight input for Row 1 |
uio_in[0] |
load_weight (1 = load weights, 0 = compute) |
uio_in[1] |
col_select (0 = output Col 0, 1 = output Col 1) |
uo_out[7:0] |
8-bit accumulated result from the selected column |
To multiply two 2×2 matrices, it takes 6 clock cycles in total: 2 cycles to shift in the weights, and 4 cycles to stream in the skewed activations and read out all four results. At a 10Mhz clock, that roughly equates to 600 nanoseconds.
Stress-Testing and Visualising It
Once I checked that the array can do basic matrix multiplication, I expanded test.py with four test suites to catch any edge cases I could think of. I do not intend to spend all this time and effort only to be greeted with a useless tile of silicon that can't compute jack.
- Basic math: Verifying
[[1,2],[3,4]] * [[5,6],[7,8]] = [[19,22],[43,50]]. - Max-value boundary: Multiplying an all
8s matrix by an all15s matrix to confirm the 8-bit output is240without overflowing. - Back-to-back runs without resetting: Running a max-value matrix followed immediately by an all-zero matrix to assert that leftover partial sums don't leak into the next calculation.
- 20 randomized 2×2 matrices: With a fixed random seed for reproducible CI runs.
I also put together an HTML visualiser (visualisation.html) so I could visualise the 6 clock ticks and watch the weights glide across the grid. It's basically the YouTube video I saw but adapted for a weight-stationary array.
Submitting to the Shuttle
Buying a tile on Tiny Tapeout isn't cheap. Getting a tile and a PCB would cost you 170 euros. Fortunately, the workshop provided us with a coupon code that completely subsidised the cost. Yippee.
My verilog compiled, all tests on GitHub Actions passed, and I could see the layout of my chip design in the Tiny Tapeout Explorer. I'll be honest with you, I felt so amazed and proud seeing the design come to life.
I opened a PR on the Tiny Tapeout GF 26f shuttle repository, and just like that, my first ASIC design was officially in the queue to be taped out. 1
Building the Digit Classifier
Unfortunately, fabricating a real chip takes months. The GF 26f chips aren't expected to ship until mid-2027. Rather than sitting around twiddling my thumbs, I decided to build the software first so it's ready to plug and play the day the chip arrives.
Squeezing A Neural Network into 8 Bits
My chip only does unsigned 4-bit multiplication with an 8-bit accumulator (max value of 255), whereas a normal neural network uses signed floating-point weights and uses realistically much bigger numbers. I had to adapt the neural network for my chip without having any values overflowing.
- I trained a lightweight
LogisticRegressionclassifier onscikit-learn's 8×8 handwritten digits dataset (64 pixels translating to 10 digit classes). - I scaled pixel intensities to
0..8and affine-quantized the weights to unsigned0..15using a singlezero_point_woffset. - Because the max output of any 2×2 tile is
2 × (8 × 15) = 240, it fits inside 8 bits with zero overflow. - To recover the true signed dot product, the microcontroller subtracts
zero_point_w * sum(pixels)and adds the quantized bias after tiling all 2×2 chunks.
Even with 4-bit unsigned weights, the model still hit a 96.94% test accuracy. Not bad for a tiny chip.
The Drawing App and Demo Board Firmware
I split the software into three Python scripts:
train_quantize.py: Trains the model, verifies quantized accuracy, and exportsdigit_model.json.draw_client.py: Atkinterdesktop app with an 8×8 grid where you can draw digits with your mouse. Right now, it runs against a bit-exact software mirror of my 2×2 systolic array. Once the physical chip arrives, flippingSERIAL_PORTfromNoneto my board's USB port sends the 64 pixels straight to the hardware.main.py: MicroPython firmware for the Tiny Tapeout demo board's onboard RP2040/RP2350 microcontroller (uploaded viampremote). It tiles each 64-pixel image into 2×2 blocks, clocks them throughtt_um_systolic_array, and computes the predicted digit.
One of the brilliant hacks in this project is how main.py displays the prediction on the PCB's onboard 7-segment LED. Because the 7-segment display is physically wired to uo_out[7:0], and my chip outputs raw partial sums, not 7-segment bitmasks, main.py temporarily switches the shuttle to tt_um_factory_test (Project 0, included on every Tiny Tapeout chip) right after inference finishes, puts it in passthrough mode, and drives the predicted digit's segment pattern onto the display. It flickers briefly while computing, then locks onto the predicted digit (0 to 9). It's what Tom Scott would call a bodge (although it remains to be seen if this actually works...).
Takeaways
This project gave me a few key lessons:
1. Hardware constraints dictate your architecture
In software, if you need another variable or input parameter, you just add it. Hell, you can even rewrite the entire architecture model. In silicon, the constraints you are dealt with forces you to rethink the entire structure of your project. The initial plan to transition from an output-stationary to a weight-stationary array, formatting the neural network to accept unsigned numbers, and capping pixels at 0..8 so that 2×2 sums never exceed 8 bits, taught me how tightly hardware and software have to be co-designed. It's no wonder Nvidia is the king of GPUs with their CUDA software moat.
2. RTL simulation and real logic gates are two different worlds
Designing a chip is only half the battle. You need to prove that your chip is correct and it works for basically every scenario you can think of. This is why hardware verification takes so much time and effort. You can't exactly push a hotfix to a fabricated chip.
Conclusion
Going from a total newbie to having a (proven) working 2×2 systolic array submitted to a foundry has been one of the most rewarding experiences of my life. Words cannot describe what a cool experience it was designing, verifying, compiling, and submitting the chip (but I guess this entire blog post did exactly that). I encourage you to check out Tiny Tapeout and what they have to offer. Who knows, maybe you'll have a chip of your own one day.
As of now, I'm just gonna sit back and wait until the chip actually arrives in mid-2027, just so I can try to predict what an '8' looks like.
You can check out the ASIC repo on GitHub here, and the 8x8 digit classifier here.
-
Tiny Tapeout runs on multiple open-source foundries: SkyWater (130 nm), IHP (130 nm), and GlobalFoundries (180 nm). The Verilog stays the same across all three, though the physical tile dimensions and template build configs will differ. ↩

