A 45nm CMOS neuromorphic chip with a scalable architecture for learning in networks of spiking neurons