A Scalable Flash-Based Hardware Architecture For The Hierarchical Temporal Memory Spatial Pooler