In the previous section, we saw how the use of a feedback resistor can provide stability to an op-amp allowing it to operate as a linear amplifier. The purpose of the comparator is to compare two voltages and produce a signal that indicates which voltage is greater.
Figure shows an op-amp as a comparator.
The principle of the comparator is based in Equation . Since the gain, A , of an op-amp is very large, any difference will be magnified to the power supply rails , as was discussed in Section . If is greater than then the difference will be positive and the result will be amplified to . If, however, is greater, then the difference is negative and the result will be amplified to .