Just adding this here so it is part of my "collection" of hacks. Sourcecode and writeup can be found here:
https://github.com/cpldcpu/BitNetPDK
https://cpldcpu.com/2024/05/02/machine-learning-mnist-inference-on-the-3-cent-microcontroller/
MNIST Neural Network Inference on a 3 cent Microcontroller
Hmm, you're making me wonder: maybe this could be done also with TTL logic, without too much hassle? Seems like it could be an interesting project.