A memory-based recurrent neural architecture for chips emulating cortical visual processing