In digital electronics, a comparator is a combinational logic circuit that is used to compare the magnitudes of two binary numbers. Comparators are used in several different electronic circuits like analog to digital converters, voltage level detectors, zero-crossing detectors, etc.