PURPOSE: To allow correct writing to a memory cell without providing an external terminal by applying a high voltage to a word line through a writing terminal.
CONSTITUTION: For instance, when a memory cell M12 of a P-ROM is written, a word driver circuit WD2 is turned on, gates G1 and G2 of a writing circuit 100 are turned on and off, respectively, and a PNPN circuit 111 is selected. If a voltage higher than that occuring in a memory cell at the time of programming from a writing terminal P1 is applied through an element 111, an electric the potential of the first P-N junction in the circuit 111 rises, which is activated after rising time T1. A high voltage is applied through a resistance R1 and a diode D3 from a common area connected to this junction, then a non-selected word line W1 is charged, and the circuit 111 is activated. At this point writing power is supplied to the cell M12, a PNPN element formed between bit lines B1 and B2 will not be turned on, and correct writing to a memory cell can be executed without providing an external terminal.