An error detection and correction circuit is connected to at least one
memory bank of a CAM device. During background processing (i.e., when the
CAM is not performing reading, writing or searching functions) the error
detection and correction circuit tests all of the CAM locations that it
is connected to in sequence. If an error is detected, the error detection
and correction circuit rewrites the CAM location with the correct data.
Multiple error correction and detection circuits can be used in the CAM
device to test multiple CAM locations simultaneously.