To extract a value of M-th rank data in a data string at a high-speed by repeating extraction of the maximum value (the minimum value) and value conversion and extracting an M-th largest (smallest) value through the M-th maximum value (minimum value) extract processing, so as to reduce the scale of circuit.
N sets of data 1 are received to produce a data string 2, consisting of data '200', '150', '50', '130', '70', '20', '100', the maximum value '200' among the data is obtained, the maximum value '200' is replaced by a default value to produce a data string 3 consisting of data '0', '150', '50', '130', '70', '20', '100$. Similarly, the maximum value '150' in the data string 3 is obtained, the maximum value '150' is replaced with the default to produce a data string 4 consisting of data '0', '0', '50', '130', '70', '20', '100'. These steps are repeated by (M-1) number of times, to produce a data string 5 consisting of data '0', '0', '50', '0', '70', '20', '100'. Then the maximum value in the data string 5 produced here is obtained, and the obtained value is selected or the M-th largest value 6 '100'.