Page Section Comments
The Basic Analogue Comparator Circuit Introduces the basic principles of comparators
An Analogue Comparator with Feedback Uses a security light controller and a temperature controller
Purpose Built Voltage Comparators Explains purpose built comparators and their parameters
A Comparator used in an Analogue to Digital Convertor Describes the operation of a successive A/D convertor
The Basic CMOS Inverter The CMOS Inverter operates as an Analogue Compartor
Summary A few brief comments on the use of animations with STEM subjects


This study unit uses animations to demonstrate the key concepts of analogue comparators.

The analogue comparator, based on the differential amplifier, is a basic building block of analogue electronics.

They are used extensively to compare one analogue signal with another.

For example, a low cost temperature controller could use an analogue comparator.

Analogue comparators are used extensively in analogue to digital interfaces, such as successive approximation analogue to digital convertors.

Figure 1, Frame-1, shows the basic circuit of an analogue comparator using a differential amplifier.

The circuit uses a single supply Voltage Vcc.

The basic equation for the differential amplifier is $Vo=Avd(vp-vn)+Vcc/2$

Where $Vo$ is the amplifier output voltage, $Avd$ is the amplifier differential voltage gain and $vp$ and $vn$ are the amplifier input voltages.

The amplifier amplifies the difference between $vp$ and $vn$

We shall assume the amplifier is designed to make $Vo$ = $Vcc/2$, when $vp=vn$

So when $vp=vn$ the amplifier output voltage = $Vcc/2$

"Positive" output voltages are positive relative to $Vcc/2$

"Negative" output voltages are negative relative to $Vcc/2$

When $vn< vp$ $Vo$ is positive, When $vn>vp$ $Vo$ is negative.

In figure 1, $vp=Vref$ a fixed reference voltage and $vn=Vs$ a variable signal voltage.

Note that all voltage sources are referenced to 0V.

Differential amplifiers have very large differential voltage gains.

To start with we shall assume $Avd\to \infty$ so when $Vs>Vref$ the output voltage $Vo=0V$

and when $Vs< Vref$ the output voltage $Vo=Vcc$

In this unit we shall start by considering the use of comparators with slowly varying signals, like those used with heating systems and automatic security lights. Operational amplifiers are suited to this type of application.

The Basic Analogue Comparator Circuit

Figure 1 Basic Analogue Comparator Operation

Voltage values used with the frames for this figure have

been chosen to illustrate principles and make calculations

simple: they are not practical values.

Figure 2-Frame 1 shows the outline circuit of a simple domestic security light product

L1 is a security light, during the daytime L1 is to be switched off.

When it starts to go dark, L1 is to be turned on automatically.

Vac is the supply voltage for the security lamp- in the UK this would 240V a.c.

The amplifier input voltage vp represents the light level when L1 is turned on or off, it is a reference voltage.

The voltage vs represents the actual light level.

When vs< vp, it is dark, L1 should be on, when vs>vp, it is daytime, L1 should be off.

When vs is just greater than vp, L1 is turned off, when vs is just less than vp, L1 is turned on.

R1 and R2 form a potential divider: vp=R1Vcc/(R1+R2), vp is the reference voltage for the amplifier.

Tr1 and Tr2 drive the relay coil and R3 controls the base current of Tr1: when the relay contacts close, L1 is turned on.

When vs is just less than vp, the amplifies switches: Vo switches from 0V to Vcc

this turns Tr1 and Tr2 on

Vcc is applied to the relay coil

this causes the relay contacts to close

Vac is applied to L1, turning it on

In this section we shall use analogue comparators in two applications that use that use slowly varying signals- a security light product and a central heating system.

Analogue Comparators with Feedback

Figure 2 Comparators with Slowly Varying Signals

The comparators in this frame set use differential voltage

amplifiers designed to be used as operational amplifiers

Figure 3, Frame-1 shows a generalised block diagram of a purpose built comparator.

The comparator consists of 3 elements

a differential input stage

an intermediate stage

an output stage

The differential input stage is designed to be fast, have a low input offset voltage and low input bias current.

The output stage may be push-pull, open collector or open drain and have single or dual outputs.

The intermediate stage provides additional voltage gain and level shifting.

Differential voltage gain is high but generally not as high as that of an operational amplifier.

Common mode gain is designed to be low.


There are numerous types of purpose built comparators and care has be taken in choosing the correct one for a given application.

We shall start by considering the principles of the differential input stage.

In this section we shall cover the operation of differential amplifiers designed be used as comparators.

These comparators are suitable for use with rapidly changing signals.

Purpose Built Voltage Comparators

Figure 3 Purpose Built Comparator Operation

In this frame set the differential amplifiers used have

been designed specifically to operate as comparators.

Figure 4, Frame-1 shows the outline block diagram of a successive approximation (SA) analogue to digital convertor (ADC).

The SA ADC converts an analogue signal to a digital signal, so it can be processed by software.

The SAR is a successive approximation register; it stores the digital value of the analogue signal.

CLK is a clock signal that controls and times the conversion process.

The SAR is also involved in the conversion process.

The DAC is a digital to analogue convertor: it is used in the conversion process.

Note the DAC has a fixed reference voltage Vref applied to it.

SH is a sample and hold circuit: at the start of a conversion it samples the analogue signal to be converted, Vin.

The SH holds the signal constant at the sampled value during the conversion process to prevent errors.

A1 is a high perfromance analogue comparator- it plays a vital part in the conversion process.

SC is the start conversion input, to start a conversion SC is made to go Hi.

When SC goes Hi, EOC goes Lo, which means a conversion is in progress.

During the Successive Approximation process, the analogue value of each bit is compared to Vin in turn.

If the value of a bit is >Vin its bit is set to 0 in the SAR.

If the value of a bit is < Vin its bit is set to 1 in the SAR.

At the end of the conversion (EOC) the SAR holds the digital value of the signal Vin: EOC goes Hi.

This means the digital value of the input signal is ready to use.


In the next frame the conversion process is described in more detail.

We shall now describe the operation of a successive approximation (SA) analogue to digital convertor (ADC).

The analogue comparator used plays a vital role in the conversion process.

A Comparator used in an Analogue to Digital Convertor

Figure 4 A Successive Approximation A/D Convertor

This frame set describes the use of a comparator in

a successive approximation analogue to digital convertor.

Figure 5, Frame-1

The circuit shown in Figure 5 is a CMOS inverter.

It consists of a PMOS transistor Tr1 and an NMOS transistor Tr2.

The input voltage is digitally valid when Vin=0V, or Vdd. Vdd is positive with respect to 0V.

When Vin=Vdd, Tr2 is turned fully ON and Tr1 is turned fully OFF, Vo =0V, logic 0.

When Vin=0V, Tr2 is turned fully OFF and Tr1 is turned fully ON, Vo =Vdd, logic 1.

The output voltage is the inverse of the input voltage, the circuit is an inverter.

The circuit uses positive logic, when Vo=Vdd, it represents logic 1, when Vo=0V, it represents logic 0.

The small circle on the gate of Tr1 means it is off when Vin is high.

The static current taken by the circuit from the supply is very small because one transistor is always off.

The static power dissipated by the inverter is almost zero.

Normally Vin switches rapidly, so Vo switches rapidly, typically in less than a nanosecond.

During the time the circuit is switching both transistors conduct, the power dissipated by the circuit increases.


The inverter has a built in reference voltage VTH, the threshold voltage, which is designed to be Vdd/2

The CMOS inverter is the basic building block of CMOS logic and is used extensively.

The device you are viewing this web page on will almost certainly be using millions of them.

The operation of the CMOS Inverter is basically the same as an analogue comparator.

The Basic CMOS Inverter Circuit

A CMOS Inverter is Basically an Analogue Comparator

Figure 5 A Basic CMOS Inverter

This frame set explains the analogue operation of a CMOS

inverter, the basic building block of digital logic circuits.


The main purpose of this web page is to demonstrate the use of animations in Electronic Engineering, which is a STEM subject.

A common problem when learning STEM subjects is understanding concepts which often have no tangible, visual, existence.

Animations can provide learners with visual models that help them understand complex concepts: this is essential if they are involved in product design and development.

Each figure on this page is actually a sequence of fixed images, like a circuit diagram, and related animations.

Descriptive text and mathematical equations associated with each image or animation enables concepts to be understood.

The animations may be played, paused and repeated as often as the learner likes- the associated text changes dynamically and is relevant to the frame being viewed.

In a fully developed learning module, other content would be provided, such as the detailed development of mathematical equations, exercises and problems.

The examples used on this page also demonstrate that virtually all STEM subjects, such as physics, chemistry and all branches of engineering can benefit from the use of animations.