A comparator, wherein, it comprises a current mirror module, a comparison module and a buffering and outputting module, the current mirror module provides a bias current to the comparison module, the comparison module comprises a positive input end, a first negative input end and a second negative input end, the positive input end connects to an external terminal, the first negative input end and the second negative input end input a low threshold voltage and a high threshold voltage, respectively, the comparison module compares a voltage of the positive input end to the low threshold voltage and the high threshold voltage, and outputs a comparison result to the buffering and outputting module, when the voltage of the positive input end is less than the low threshold voltage, the buffering and outputting module outputs a low voltage to the comparison module;
- when the voltage of the positive input end is greater than the high threshold voltage, the buffering and outputting module outputs a high voltage to the comparison module.