The Linear and Digital Integrated Circuits Design Primer

A comparator compares a signal voltage applied at the input of an op-amp with a known reference voltage V ref given at the other input. It is an open-loop operation, i.e., there is no feedback path in the case of a comparator.
Comparators can be classified into two types, namely noninverting and inverting. In both cases, V ref may be either positive or negative. The output of a comparator can be in one of two states, + V sat or ? V sat. If the voltage at inverting input terminal is greater than the voltage at non-inverting input terminals then V o = ? V sat, otherwise V o = + V sat.
The signal input is given to the non-inverting input terminal and the reference voltage is given to the inverting input terminal.
As long as input V i < V ref, the output will be ? V sat. If input V i > V ref, the output voltage will be + V sat.
In a practical comparator, V ref is obtained by using a potentiometer between two power supply terminals. By adjusting the potentiometer, the V ref voltage is varied.
The signal input is given to the inverting input terminal and the reference voltage is given to the non-inverting input terminal.