A comparator is a device that compares two voltages (or currents) and outputs a digital signal indicating which is larger. It has two analog input terminals V+, and V-, and one binary digital output Vo. It is commonly used in devices that measure and digitize analog signals, such as analog-to-digital converters (ADCs).

\begin{equation} if \ V_+ > V_- \ then \ V_{out} = V_{S+} \end{equation} \begin{equation} if \ V_- > V_+ \ then \ V_{out} = V_{S-} \end{equation}If the output is digital, then V_{S+} is H or 1 and V_{S-} is L or 0. It can then be considered to be a one bit analog to digital converter.

A comparator consists of a specialized high-gain differential amplifier. Due to the high gain, Vout is undetermined for the following condition.

\begin{equation} V_- = V_+ \end{equation}A comparator can be implemented using an opamp. The output voltage of the op-amp is given by the equation:
\begin{equation}
V_{out} = {A_{OL} \, (V_{\!+} - V_{\!-})}
\end{equation}
where A_{OL} is the open-loop gain of the amplifier.

With advertising revenues falling despite increasing numbers of learners, we need your help to maintain and improve this site, which takes time, money and hard work. Thanks to the generosity of our learners who gave earlier, you are able to use this site at no charge.

If you have benefited from this site and are able, please **give via Paypal**. It will allow us
to continue into the future. It only takes a minute. Thanks!