Effects of weight discretization on the back propagation learning method: Algorithm design and hardware realization