Adaptive Hardware Architecture for Neural-Network-on-Chip