302 latches data having the same signal level as that of a signal input to a d terminal of the flip flop circuit 302 the flip flop circuit 302 latches high level data and outputs a high level signal from the q terminal at a rising edge of the second pulse of the external test clock tck the flip flop circuit 302 latches data having the same signal level as that of a signal input to the d terminal the flip flop circuit 302 latches low level data and outputs a low level signal from the q terminal the signal output from the q terminal of the flip flop circuit 302 is input to the and circuits 316 318 320 and 322 the third waveform from the top in fig7 is a waveform of an output signal of a q terminal of the flip flop circuit 304 at a rising edge of the second pulse of the external test clock tck the flip flop circuit 304 latches data having the same signal level as that of a signal input to a d terminal of the flip flop circuit 304 the flip flop circuit 304 latches a high level signal and outputs a high level signal from the q terminal at a rising edge of the fourth pulse of the external test clock tck the flip flop.