PURPOSE: To quickly and easily initialize a memory cell, perform the initial test, and check the preservation state by adding a test circuit having a test address and data generating circuit, arithmetic circuit, etc., to a memory LSI.
CONSTITUTION: A test address and data generating circuit 13, an arithmetic circuit 14 which generates the check sum or the like of write data and read data at the time of test, a comparator 16 which compares the check sum of write data with that of read data, multiplexers 9 and 10 for switching between address and input/output data from the external and those for test, and a timing controller 18 which controls them are provided in the memory LSI. The memory LSI is automatically tested at the time of power-on without increasing the number of input/output pins. Thus, the test is performed in a short time.