A plurality of reference words based on a second distance index that
allows coding of a first distance index are registered in an associative
memory core in advance. In a first pipeline stage, a retrieved word
having a predetermined number of bits is extracted from input data in a
predetermined clock cycle, and the retrieved word is coded with the
second distance index and output to the core. In a second pipeline stage,
the core searches for a reference word inhabiting the largest similarity
with respect to the retrieved word (winner) obtained in the previous
clock cycle. In a third pipeline stage, the core output result in the
previous clock cycle is analyzed, one winner is determined on the basis
of a specific priority, and an address indicating the location of the
winner and the distance between the input data and the winner are coded
and output.