PURPOSE: To permit a comparator for one code to detect plural codes by comparing successively inputted code patterns with successively switched reference code patterns by the comparator.
CONSTITUTION: An n-bit input signal is ampled by a shift register 2, whose output is inputted to one comparison input terminal of a digital comparator 5 as input information to be discriminated. To the comparison reference input of the comparator 5, on the other hand, referece code patterns controlled by switch control pulses P1 from a clock generation part 12 are inputted, and coincidence pulses are obtained from the comparator 5 and outputted through a gate 24 by the switch control patterns are switched on time-division basis by the switch control pulses, thereby sending the comparison outputs out of the comparator 5 to the gate.