
This project implements a simplified LayerNorm accelerator for eight signed 8-bit integer samples. It calculates an integer mean and variance, then scales each sample's deviation from the mean using a reciprocal square-root lookup table.
The reciprocal square-root lookup table supports integer variances from 1 to 15 and uses Q0.9 fixed-point coefficients. A variance of 0 or a variance greater than 15 produces zero outputs. Results are signed 8-bit integers truncated toward zero.
The design does not implement epsilon, learnable scale or bias, or overflow protection.
All bidirectional pins are configured as inputs. There is no output-valid or busy signal.
Outputs appear in input order and remain available for one clock cycle each. The output bus is zero between results; zero is also a valid result.
Example input: [0, 1, 2, 3, 4, 5, 6, 7] Expected output: [-1, 0, 0, 0, 0, 0, 1, 1]
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | DATA[0] | OUTPUT[0] | VALID |
| 1 | DATA[1] | OUTPUT[1] | START |
| 2 | DATA[2] | OUTPUT[2] | |
| 3 | DATA[3] | OUTPUT[3] | |
| 4 | DATA[4] | OUTPUT[4] | |
| 5 | DATA[5] | OUTPUT[5] | |
| 6 | DATA[6] | OUTPUT[6] | |
| 7 | DATA[7] | OUTPUT[7] |