A k-nearest neighbors associative memory includes: a clock counting type associative memory that holds R pieces of reference data and outputs, for each of the R pieces of reference data, a match signal that becomes active when a clock count corresponding to a distance between the reference data and given search data has been reached; and a k-nearest neighbors clustering circuit that, every time at least one of the R match signals output from the clock counting type associative memory becomes active, selects a piece of class data, out of R pieces of class data representing classes of the R pieces of reference data, corresponding to each of the at least one active match signal, until k match signals out of the R match signals become active, and determines a class having a largest number of pieces of data when the selected total k pieces of class data are classified.
展开▼