A sense amplifier has first and second input nodes. A reference memory
cell is connected to the first input node. To the second input node, a
constant current source circuit and a main memory cell are connected via
a first transistor and a second transistor, respectively. A current
mirror type load circuit is provided as a load circuit of the reference
memory cell and the main memory cell. When a threshold voltage of the
reference memory cell is adjusted, the first transistor is turned on and
the second transistor is turned off. When the threshold voltage of the
memory cell is adjusted at verification of writing to/erasing from the
memory cell, the first transistor is turned off and the second transistor
is turned on.