A Comparator is a circuit which accepts two voltages or currents and then switches the output showing which is bigger. Comparators are found in components like analogue to digital converters. Comparators are like operational amplifiers except a comparator is designed to operate with positive feedback and output saturated at one power rail or the other.
A comparator samples two input pins and turns on the output when identifying a difference or similarity.
An example is when you have a minus voltage on the inverting Pin and a plus non-inverting. When the voltage on the non-inverting equals the inverting voltage the Pin turns on. Normally the output Pin is open and switches to ground when the comparator is activated.
The primary use of a comparator is converting analogue to digital (ADC). Two supply voltages are applied and the difference determines a high or low digital signal.
Various package types, pins, sizes, channels per chip, PSRR (power supply rejection ratio), CMRR (common-mode rejection ratio) are all available.