The HLS implementation of LeNet is taken from here. Further, it is modified to share exponents in a layerwise fashion. Any layer, in the end, does Generalized Matrix Mulplications (GEMM) between input and weights. Here weights are stored as proposed in [1]. The implementation of an independent GEMM is shared #here.
[1] P. Kashikar, S. Sinha and A. K. Verma, "Exploiting Weight Statistics for Compressed Neural Network Implementation on Hardware," 2021 IEEE 3rd International Conference on Artificial Intelligence Circuits and Systems (AICAS), 2021, pp. 1-4, doi: 10.1109/AICAS51828.2021.9458581.