An associative memory based on a model by Rizvi and Zubairy [Appl. Opt. 33, 3642 (1994)] is experimentally demonstrated. The parallel optical interconnection is realized compactly by computer-generated holograms. A novel scheme of real-time thresholding is proposed and is proved to be effective and simple to implement. Stored images are successfully retrieved with both complete and partial inputs.