In order to improve the reliability of the operation of switching the scan direction in a bidirectional shift register without using a complex circuit configuration or complex timing, a clock signal is maintained at a high level by a controller around the timing of the switching of the scan direction in a bidirectional shift register including a plurality of stages of unit shift registers connected to each other in which the scan direction is switched. Alternatively, a power supply VDD is connected to the output terminal of a first clocked inverter in the unit shift register of any one of the odd-numbered stages through third and fourth transfer gates, which become conducting at the same timing as first and second transfer gates of the input terminal of the first clocked inverter, respectively.