There are many types of comparators, in this example a comparator with hysteresis is analyzed and simulated.
Get FREE Credit for your next AirBnb Reservation by opening a new account (even if you already have one!)
The proposed circuit is based on a two-stages open-loop comparator but adding an internal positive feedback to accomplish the hysteresis. 
The hysteresis is useful to compare noisy signals. By using the threshold we can reduce the glitches on the output caused by the small ripple of the input signal. Also it is the way to avoid fast multiple transitions in control signals.
The basic topology can be seen in the schema:
The following 2 schematics are implemented in Cadence. Both are the same, they have just a different shape. Maybe the second representation is more clear and understandable. They are differential-to-single-ended comparators with one output buffer.
In this topology two kind of feedback can be found with the inputs (IN- and IN+): positive and negative. The negative feedback is through the transistors M1 and M2. The negative feedback is on the transistors M14 and M15.
The ratio between M1 and M15 will determine the overall feedback sign. To have hysteresis, the ratio mult_M15/mult_M1 should be greater than 1.
In a normal comparator, we need to consider two cases: when the currents in M0 and M3 are different but neither is zero, and when one of the input transistors has a current equal to the sink (IPOL in the following case) and the other current is zero.
For test this comparator a capacitive load of ~1pF is attached to the output. The bigger the output cap is set, slower the response is going to be. To improve the driving capabilities of the comparator, you may only add an incremental chain of buffers at the before the output of the comparator. For my case with one small inverter was enough for the performance required.
- The bias current is set to 80nA.
- The technology used in this case is TSMC 180nm general purpose.
In this testbench, I attached several voltage sources to the positive input. By this way I can comment out (ignore) the source I dont want to use. So I can configure and modify the input source easily.
To see several hysteresis, I will sweep different transistor ratio between the positive and negative feedback. For that I set a variable named “mult”, which I control how much current flow into the positive feedback.
After the simulation
We can see, that the bigger the ratio between M15 and M1 is, greater is the hysteresis.
To graphically represent the hysteresis, normally the sweeping input voltage is plotted versus the output. This shows better the called bistable characteristic.
That can be done in Cadence!! by clicking on the menu: Axis>> Yvs Y.
For the case of mult = 20, the trip voltage is aprox. 1.02V and 1.98V, which can be seen better in the following graph:
One side hysteresis
For that the size of the transistor M14 was reduced to mult = 1 and the M15 was sized to mult = 20. As the following schema:
The results show how when in+ is less than I- (attached to 1.5V), we obtain more hysteresis because of the feedback of In+ is weaker
To obtain more hysteresis, you may play with the multipliers of M14 and M15, as well you may increase the length of M1 and M2 (or even M0 and M3)
 CMOS Analog Circuit Design. Douglas R. Holberg, Phillip E. Allen