
thumb|LM393 dual comparator, a common comparator integrated circuit chip, shown on a circuit board
thumb|LM393 dual comparator, a common comparator integrated circuit chip, shown on a circuit board
In electronics, 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 V_\text{o}. The output is ideally V_\text{o} = \begin{cases} 1, & \text{if }V_+ > V_-, \\ 0, & \text{if }V_+ A comparator consists of a specialized high-gain differential amplifier. They are commonly used in devices that measure and digitize analog signals, such as analog-to-digital converters (ADCs), as well as relaxation oscillators.
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).