Compensation circuit for input, reference, before comparator