In a semiconductor device having a MEMS according to this invention, a
plurality of units having movable portions for constituting a MEMS are
monolithically mounted on a semiconductor substrate on which an
integrated circuit including a driving circuit, sensor circuit, memory,
and processor is formed. Each unit has a processor, memory, driving
circuit, and sensor circuit.