It is intended to provide a comparator circuit which uses a switched capacitor and has a small circuit size. An input INA is supplied to positive input terminals of comparators Com1 and Com2 through a capacitor Ca by means of a switch SW1. An input INB is supplied to a negative input terminal of the comparator Com1 through a capacitor Cb1 by means of a switch SW2, and in addition, is supplied to a negative input terminal of the comparator Com2 after being inverted through the use of a capacitor Cb2 by means of switches SW3 and SW4. Outputs from the comparators Com1 and Com2 are input to an exclusive OR circuit EXOR, which outputs a result of judgment as to whether or not the input INA is within the range extending between the positive input INB and the negative input INB.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
An embodiment of the present invention will be described in detail with reference to the following drawings, wherein:
FIG. 1 shows a comparator circuit according to an embodiment of the present invention;
FIG. 2 shows an example of comparison; and
FIG. 3 shows another example structure.
Claims
1. A comparator circuit for comparing a first input and a second input, the comparator circuit comprising:
a first capacitor for storing and outputting a first input, wherein an input side is alternately connected to a first input and to an output, and a reference side is connected to a reference terminal having a reference voltage;a second capacitor for storing and outputting a second output, wherein an input side is alternately connected to a second input and to an output, and a reference side is connected to a reference terminal;a third capacitor for storing, then inverting and outputting, a second input, wherein an input side is alternately connected to a second input and to a reference terminal, and a reference side is alternately connected to a reference terminal and to an output;a first comparator for comparing an output from the first capacitor and an output from the second capacitor; anda second comparator for comparing an output from the first capacitor and an output from the third capacitor, whereina first input and a second input are compared based on results of comparisons performed in the first comparator and the second comparator.
2. The comparator circuit according to claim 1, wherein:
an output from the first capacitor is input to a positive input of the first comparator and an output from the second capacitor is input to a negative input of the first comparator so that the first comparator compares the output from the first capacitor and the output from the second capacitor;an output from the first capacitor is input to a positive input of the second comparator and an output from the third capacitor is input to a negative input of the second comparator so that the second comparator compares the output from the first capacitor and the output from the third capacitor; andoutputs from the first and second comparators are input to an exclusive OR circuit, and an output from the exclusive OR circuit is output as a result of comparison.
3. The comparator circuit according to claim 2, wherein:
the first input is an alternating current signal that fluctuates about a reference level, and the second input is a signal indicating a threshold direct current level; andthe exclusive OR circuit outputs a signal identifying whether an amplitude of the alternating current signal is within or outside a range extending between positive and negative thresholds determined by the second input.