To prevent malfunctions from occurring. A shift register, a selection circuit having a function of determining which a first pulse signal or a second pulse signal is output at the same potential level as a pulse signal input from the shift register, and a plurality of driving signal output circuits each having functions of generating and outputting a driving signal are provided. Each of the plurality of driving signal output circuits includes a latch unit, a buffer unit, and a switch unit for controlling rewriting of data stored in the latch unit.