A semiconductor device includes a first trench capacitor formed in a first
trench, a second trench capacitor formed in a second trench, a first gate
electrode disposed above a first active area, a second gate electrode
disposed above a second active area, a first impurity doped region formed
in an outer periphery of the second trench including a boundary adjacent
to the second trench and doped with an impurity of a first conduction
type, and a second impurity doped region formed in the first impurity
doped region so as to include the first active area located below the
first gate electrode, the second impurity doped region being doped with
an impurity of a second conduction type opposite to the first conduction
type impurity.