To provide a pattern generator which outputs a plurality of test patterns repeatedly.
A memory part in which a plurality of test patterns are stored and which outputs the test patterns is provided. An address output part 54 which outputs a pattern address used to specify the test patterns which are output by the memory part is provided. A first register 56 which stores a first address used to specify a first test pattern contained in the plurality of test patterns is provided, An address comparison part 58 in which the pattern address is compared with the first address is provided. An address specification part 51 in which a second address used to specify a second test pattern contained in the plurality of test patterns is output to the address output part 54 on the basis of a compared result is provided.