A power supply control circuit for controlling power supply or stop of power supply is provided between a power source and a circuit block such as a processor. The power supply control circuit not only performs power supply to the circuit block or intentionally stops power supply but also is able to hold the power supply potential when the power supply is suddenly stopped, so that a loss of data in the circuit block can be prevented. By utilizing the power supply potential held by the power supply control circuit, data in the circuit block is saved in the nonvolatile memory device, so that a loss of data in the circuit block can be prevented. As described above, the power supply control circuit functions as a power gating switch and a circuit for holding the power supply potential in the case where power supply is suddenly stopped.