Patent attributes
A semiconductor device in which the area of a circuit that is not in use during normal operation can be reduced is provided. A semiconductor device including a memory circuit has a function of storing a start-up routine in the memory circuit and executing the start-up routine; a function of operating the memory circuit as a buffer memory device after executing the start-up routine; and a function of loading the start-up routine into the memory circuit from the outside before the semiconductor device is powered off. The memory circuit has a plurality of groups each including at least a first transistor, a second transistor, and a memory element including an MTJ element. The memory element has a function of storing a signal input through the first transistor. The second transistor has a function of being turned on or off in accordance with the signal stored in the memory elements.