Hardware implementation of neural network using pre-programmed resistive device for pattern recognition