A semiconductor device, comprising a semiconductor nanowire having a first
region with one of a PN junction and a PIN junction and a second region
with a field effect transistor structure, a pair of electrodes connected
to both ends of the semiconductor nanowire, and a gate electrode provided
in at least a part of the second region via an insulating layer. The
semiconductor nanowire has a P-type semiconductor portion and an N-type
semiconductor portion, and one of the P-type semiconductor portion and
the N-type semiconductor portion is a common structural element of both
the first and second regions.