Comparator

From Wikipedia, the free encyclopedia

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 also used to refer to a device that compares two items of data.

A standard op-amp without negative feedback can be used as a comparator, as indicated in the following diagram.

An operational amplifier with no feedback path is 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:

Vout = VS sgn(V+ − V)

where sgn(x) is the signum function. Generally, the positive and negative supplies VS will not match absolute value:

Vout <= VS+ when (V+ > V-) else VS- when (V+ < V-).

Equality of input values is very difficult to achieve in practice. The speed at which the change in output results from a change in input (often called the slew rate in operational amplifiers) is typically in the order of 10ns to 100ns, but can be as slow as a few tens of μs.

A dedicated voltage comparator chip, such as the LM339, is designed to interface directly to digital logic (for example TTL or CMOS). The output is a binary state, and it is often used to interface real world signals to digital circuitry (see analog to digital converter). The LM339 accomplishes this with an open collector output. When the inverting input is higher, the output of the comparator is connected to the negative power supply. When the noninverting input is higher, the output is floating (has a very high impedance to ground). With a pull-up resistor and a 0 to +5V power supply, the output takes on the voltages 0 or +5 and can be interfaced to TTL logic:

Vout <= Vcc when (V+ > V-) else 0.

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 and adjustable hysteresis.

It is incorrect to consider a comparator as a device with a differential (bipolar) input and a logic (0/Vcc) output as the inputs of real comparators are not isolated. This means that not only their difference affects the output but also their voltages must not exceed the power voltage range: VS-V+,V-VS+. In the case of TTL/CMOS logic output comparators negative inputs are not allowed: 0 ≤ V+,V-Vcc.

When comparing a noisy signal to a threshold, the comparator may switch rapidly from state to state as the signal crosses the threshold. If this is unwanted, a Schmitt trigger can be used to provide hysteresis and a cleaner output signal.

This article contains material from the Federal Standard 1037C, which, as a work of the United States Government, is in the public domain.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.