To provide a semiconductor device with low power consumption. In transistors electrically connected to function as a comparator circuit, back gates are provided in the transistors functioning as current sources, and the transistors functioning as the current sources can be switched between conduction and non-conduction in accordance with a control signal supplied to the back gates. The control signal makes the transistor conductive in a period during which the comparator circuit operates and non-conductive in the other period. A semiconductor layer to be a channel formation region of the transistor included in the semiconductor device includes an oxide semiconductor.