Energy Efficient Neocortex-Inspired Systems With On-Device Learning