Patent ID: 8558581

Claim:
A method of operating an analog rail-to-rail comparator circuit with common mode detection of differential input signals, the method comprising: providing, as outputs from a comparator, first, second, third and fourth differential signals when a common mode voltage used for the common mode detection is between zero volts and a supply voltage of the comparator circuit; generating a hysteresis current for the comparator circuit based on the common mode voltage; and adding the hysteresis current to a one of the differential outputs of the comparator in the comparator circuit, such that a hysteresis voltage at an output of the comparator circuit is substantially independent of the common mode voltage, wherein generating a hysteresis current includes: providing an output of a PMOS differential stage current source to a first current mirror having an output, providing an output of a NMOS differential stage current source to a second current mirror via a node, wherein the NMOS differential stage current source has an output, providing the output of the first current mirror to the node, and obtaining the hysteresis current from the output of the second current mirror.