A semiconductor device comprises a first transistor and a potential generator
circuit.
The first transistor has a first conduction type first semiconductor region and
a second conduction type second semiconductor region formed in the first semiconductor
region. The first and second semiconductor regions are supplied with first and
second prescribed potentials, respectively. The potential generator circuit generates
the first prescribed potential. The potential generator circuit has a first power
supply terminal supplied with a first power supply potential, a second power supply
terminal supplied with a second power supply potential set to a higher potential
than the first power supply potential, and an output terminal outputting the first
prescribed potential. The potential generator circuit outputs the second power
supply potential when the second power supply potential is higher than a predetermined
potential, and the first power supply potential when the second power supply potential
is lower than the predetermined potential.