The present invention aims to eliminate variations in 
threshold voltage subsequent to the writing of data in an 
EPROM. When a parasitic resistance between the source of a 
memory cell (M00) of an even-numbered row and its corresponding 
bit line (BL0) is larger by a resistance (R00) than a parasitic resistance between the source of a 
memory cell (M01) of an odd-numbered row and its corresponding 
bit line (BL0), a 
cell resistance compensating unit (40) having a compensating 
resistor (43) whose resistance value is equal to the resistance (R00) is provided between the 
bit line (BL0) and a ground potential (GND). When the 
memory cell (M00) is selected by a drain 
cell power-supply switching address ( / AY0), a 
transistor (41) is turned on by the same 
signal ( / AY0). When the memory 
cell (M01) is selected by a drain cell power-supply switching address (AY0), a 
transistor (42) is turned on by the same 
signal (AY0). The 
resistor (43) is inserted for the 
transistor (42), and resistance values from the sources of the memory cells (M00, M01) to the ground potential (GND) become equal to each other. Thus, variations in 
threshold voltage subsequent to the writing of data can be suppressed.