, a comparator
is a device which compares two voltages
and switches its output to indicate which is larger.
A dedicated voltage comparator will generally be faster than a general-purpose op-amp pressed into service as a comparator. A dedicated voltage comparator may also contain additional features such as an accurate, internal voltage reference, an adjustable hysteresis and a clock gated input.
Input voltage range
The input voltages must not exceed the power voltage range :
In the case of TTL/CMOS logic output comparators, negative inputs are not allowed:
Op-amp implementation of voltage comparator
A standard op-amp operating without negative feedback can be used as a comparator. When the non-inverting input (V+) is at a higher voltage than the inverting input (V-), the high gain of the op-amp causes it to output the most positive voltage it can. When the non-inverting input (V+) drops below the inverting input (V-), the op-amp outputs the most negative voltage it can. Since the output voltage is limited by the supply voltage, for an op-amp that uses a balanced, split supply, (powered by ± VS) this action can be written:
where sgn(x) is the sign function. Generally, the positive and negative supplies VS will not match absolute value:
when else when