A Methodology for Testing Content Addressable Memories