# Comparator

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).

$$if \ V_+ > V_- \ then \ V_{out} = V_{S+}$$ $$if \ V_- > V_+ \ then \ V_{out} = V_{S-}$$

If the output is digital, then VS+ is H or 1 and VS- 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.

$$V_- = V_+$$

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

Thank you for learning from electronics-course.com

We do not have a paywall as our mission is to provide everyone from Albania to Zimbabwe, rich or poor, a quality foundational electronics education. With advertising revenues falling despite increasing numbers of learners, we need your help to maintain and improve the course, which takes time, money and hard work.

If everyone who benefits from this course gives as little as \$2 via Paypal, we can continue to achieve our mission. Thanks!