A new approach to the design of discrete Hopfield associative memories