SRAM Compute-in-Memory Classifier
Course project with a team of five, 2025. SkyWater 130 nm, Cadence Virtuoso and Spectre, Verilog-A testbenches, Python.
In neural network hardware, moving weights between memory and the arithmetic units often costs more energy than the arithmetic itself. Compute-in-memory avoids this by performing the multiply-accumulate inside the SRAM array. We designed a single dense layer (64 pixels plus a bias, feeding 10 neurons) for 8×8 MNIST, based on the IMAC architecture (Ali et al., IEEE TCAS-I, 2020).
How it works
The 6-bit weights are written directly into each cell’s storage node, which avoids connecting multiple drivers to the bitlines. Inputs are applied one row at a time as word-line levels from a DAC. Each weight bit’s bitline discharges for a window proportional to its significance, so the voltage drop on a bitline tracks the product of input and weight without binary-weighted cell sizing. Charge sharing then merges the bit columns, an accumulator (a 2.5 fF sampling capacitor onto 500 fF) sums the rows, and an ADC digitizes each neuron. The final argmax is done in Python.
Quantization
The inputs, weights, and biases covered very different ranges, so a single fixed-point format either lost accuracy or wasted bits. We scaled the inputs up and trained with non-negative weights so all three fell into similar ranges. This reduced the width needed for over 90% accuracy from 9 bits to 6 (unsigned Q3.3).
| Input range | Bits for >90% | Float accuracy | Quantized accuracy |
|---|---|---|---|
| [0, 1] (no scaling) | 9 (Q4.5) | 90.46% | 90.02% |
| [0, 3] | 6 (Q3.3) | 90.47% | 90.13% |
| [0, 7] | 7 (Q3.4) | 90.44% | 90.25% |
Results
The design achieved an average energy-delay product of 4.49 fJ·s per inference and 91% hardware accuracy. The Cadence simulation matched the quantized Python model’s predictions on every test image.
