
A 2x2 systolic array that computes C = A x B for matrices of signed 4-bit integers (-8..7). It is built from four multiply-accumulate (MAC) cells: each cell does acc <= acc + a*b every step and passes a and b to its neighbours. Values of A flow east, values of B flow south, and every cell accumulates one element of C:
C00 = A00B00 + A01B10, C01 = A00B01 + A01B11 C10 = A10B00 + A11B10, C11 = A10B01 + A11B11
Accumulators are signed 12-bit (up to 31 accumulated products without overflow). The array advances only when en is high, so inputs can be loaded slowly by a microcontroller. A small wrapper loads the four input registers (a0, a1, b0, b1) 4 bits at a time and lets you read one 12-bit result at a time.
Apply rst_n low once, then run the clock at any (low) frequency. To multiply A x B:
None required. A microcontroller (the RP2040 on the Tiny Tapeout demo board, or an ESP32) drives the inputs and reads the outputs following the sequence above.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | data0 | res0 | res8 |
| 1 | data1 | res1 | res9 |
| 2 | data2 | res2 | res10 |
| 3 | data3 | res3 | res11 |
| 4 | reg_sel0 | res4 | out_sel0 |
| 5 | reg_sel1 | res5 | out_sel1 |
| 6 | write | res6 | en |
| 7 | clear | res7 |