In electronics, a comparator is a device which compares two voltages or currents and switches its output to indicate which is larger. More generally, the term is