TECHNICAL FIELD

One embodiment of the present invention relates to a semiconductor device and an electronic device.

Note that one embodiment of the present invention is not limited to the above technical field. The technical field of the invention disclosed in this specification and the like relates to an object, a method, or a manufacturing method. Alternatively, one embodiment of the present invention relates to a process, a machine, manufacture, or a composition of matter. Therefore, specific examples of the technical field of one embodiment of the present invention disclosed in this specification include a semiconductor device, a display device, a liquid crystal display device, a light-emitting device, a power storage device, an imaging device, a memory device, a signal processing device, a processor, an electronic device, a system, a driving method thereof, a manufacturing method thereof, and a testing method thereof.

BACKGROUND ART

Integrated circuits that imitate the mechanism of the human brain are currently under active development. The integrated circuits incorporate electronic circuits as the brain mechanism and include circuits corresponding to neurons and synapses of the human brain. Such integrated circuits may therefore be called “neuromorphic”, “brain-morphic”, or “brain-inspired” circuits. The integrated circuits have a non-von Neumann architecture and are expected to be able to perform parallel processing with extremely low power consumption as compared with a von Neumann architecture, in which power consumption increases with increasing processing speed.

An information processing model that imitates a biological neural network including neurons and synapses is referred to as an artificial neural network (ANN). For example, Non-Patent Document 1 and Non-Patent Document 2 each disclose an arithmetic device including an artificial neural network constructed using SRAM (Static Random Access Memory).

REFERENCE

Non-Patent Document

[Non-Patent Document 1] M. Kang et al., “IEEE Journal Of Solid-State Circuits”, 2018, Volume 53, No. 2, pp. 642-655.[Non-Patent Document 2] J. Zhang et al., “IEEE Journal Of Solid-State Circuits”, 2017, Volume 52, No. 4, pp. 915-924.

SUMMARY OF THE INVENTION

Problems to be Solved by the Invention

In general, an artificial neural network performs calculations in which the connection strength (sometimes referred to as weight coefficient) of a synapse that connects two neurons is multiplied by a signal transmitted between the two neurons. In particular, in a hierarchical artificial neural network, the connection strength of synapses between a plurality of first neurons in a first layer and one of second neurons in a second layer and signals input from the plurality of first neurons in the first layer to the one of the second neurons in the second layer need to be multiplied and summed; for example, the number of the connection strengths and the number of parameters indicating the signals are determined in accordance with the scale of the artificial neural network. That is, in the artificial neural network, as the number of layers, the number of neurons, and the like increase, the number of circuits corresponding to the neurons and synapses also increases, which sometimes makes the amount of arithmetic operation enormous.

As the number of circuits included in a chip increases, the power consumption increases and the amount of heat generated when a device is driven also increases. In particular, a larger amount of heat generation is more likely to affect the characteristics of circuit elements included in a chip; thus, a circuit constituting the chip preferably includes circuit elements that are less affected by temperature.

An object of one embodiment of the present invention is to provide a semiconductor device and the like including a hierarchical artificial neural network. Another object of one embodiment of the present invention is to provide a semiconductor device and the like with low power consumption. Another object of one embodiment of the present invention is to provide a semiconductor device and the like that are less affected by environmental temperature. Another object of one embodiment of the present invention is to provide a novel semiconductor device and the like.

Note that the objects of one embodiment of the present invention are not limited to the objects listed above. The objects listed above do not preclude the existence of other objects. Note that the other objects are objects that are not described in this section and will be described below. The objects that are not described in this section will be derived from the descriptions of the specification, the drawings, and the like and can be extracted from these descriptions by those skilled in the art. Note that one embodiment of the present invention is to solve at least one of the objects listed above and the other objects. Note that one embodiment of the present invention does not necessarily solve all the objects listed above and the other objects.

Means for Solving the Problems

(1)

One embodiment of the present invention is a semiconductor device including a first circuit and a second circuit. The first circuit includes a first holding node; the second circuit includes a second holding node; the first circuit is electrically connected to a first input wiring, a second input wiring, a first wiring, and a second wiring; the second circuit is electrically connected to the first input wiring, the second input wiring, the first wiring, and the second wiring; the first circuit has a function of holding a first potential corresponding to first data at the first holding node; the second circuit has a function of holding a second potential corresponding to the first data at the second holding node; the first circuit has a function of outputting a current corresponding to the first potential to the first wiring when a high-level potential is input to the first input wiring and a low-level potential is input to the second input wiring, a function of outputting a current corresponding to the first potential to the second wiring when a low-level potential is input to the first input wiring and a high-level potential is input to the second input wiring, and a function of not outputting a current corresponding to the first potential to the first wiring and the second wiring when a low-level potential is input to the first input wiring and a low-level potential is input to the second input wiring; and the second circuit has a function of outputting a current corresponding to the second potential to the second wiring when a high-level potential is input to the first input wiring and a low-level potential is input to the second input wiring, a function of outputting a current corresponding to the second potential to the first wiring when a low-level potential is input to the first input wiring and a high-level potential is input to the second input wiring, and a function of not outputting a current corresponding to the second potential to the first wiring and the second wiring when a low-level potential is input to the first input wiring and a low-level potential is input to the second input wiring.

(2)

Another embodiment of the present invention is the semiconductor device with the above structure (1). The first circuit includes first to fourth transistors and a first capacitor; the second circuit includes fifth to eighth transistors and a second capacitor; the first holding node is electrically connected to a first terminal of the first transistor, a gate of the second transistor, and a first terminal of the first capacitor; a first terminal of the second transistor is electrically connected to a second terminal of the first capacitor; a second terminal of the second transistor is electrically connected to a first terminal of the third transistor and a first terminal of the fourth transistor; a gate of the third transistor is electrically connected to the first input wiring; a gate of the fourth transistor is electrically connected to the second input wiring; a second terminal of the third transistor is electrically connected to the first wiring; a second terminal of the fourth transistor is electrically connected to the second wiring; the second holding node is electrically connected to a first terminal of the fifth transistor, a gate of the sixth transistor, and a first terminal of the second capacitor; a first terminal of the sixth transistor is electrically connected to a second terminal of the second capacitor; a second terminal of the sixth transistor is electrically connected to a first terminal of the seventh transistor and a first terminal of the eighth transistor; a gate of the seventh transistor is electrically connected to the first input wiring; a gate of the eighth transistor is electrically connected to the second input wiring; a second terminal of the seventh transistor is electrically connected to the second wiring; and a second terminal of the eighth transistor is electrically connected to the first wiring.

(3)

Another embodiment of the present invention is the semiconductor device according to (1) above. The first circuit includes first to fourth transistors, a ninth transistor, and a first capacitor; the second circuit includes fifth to eighth transistors, a tenth transistor, and a second capacitor; the first holding node is electrically connected to a first terminal of the first transistor, a gate of the second transistor, a gate of the ninth transistor, and a first terminal of the first capacitor; a second terminal of the first capacitor is electrically connected to a first terminal of the second transistor and a first terminal of the ninth transistor; a second terminal of the second transistor is electrically connected to a first terminal of the third transistor; a second terminal of the ninth transistor is electrically connected to a first terminal of the fourth transistor; a gate of the third transistor is electrically connected to the first input wiring; a gate of the fourth transistor is electrically connected to the second input wiring; a second terminal of the third transistor is electrically connected to the first wiring; a second terminal of the fourth transistor is electrically connected to the second wiring; the second holding node is electrically connected to a first terminal of the fifth transistor, a gate of the sixth transistor, a gate of the tenth transistor, and a first terminal of the second capacitor; a second terminal of the second capacitor is electrically connected to a first terminal of the sixth transistor and a first terminal of the tenth transistor; a second terminal of the sixth transistor is electrically connected to a first terminal of the seventh transistor; a second terminal of the tenth transistor is electrically connected to a first terminal of the eighth transistor; a gate of the seventh transistor is electrically connected to the first input wiring; a gate of the eighth transistor is electrically connected to the second input wiring; a second terminal of the seventh transistor is electrically connected to the second wiring; and a second terminal of the eighth transistor is electrically connected to the first wiring.

(4)

Another embodiment of the present invention is the semiconductor device with the above structure (1). The first circuit includes first to fourth transistors, a first logic circuit, and a second logic circuit; the second circuit includes fifth to eighth transistors, a third logic circuit, and a fourth logic circuit; the first to fourth logic circuits each have a function of outputting an inverted signal of a signal input to an input terminal from an output terminal; the first holding node is electrically connected to an input terminal of the first logic circuit, an output terminal of the second logic circuit, a first terminal of the first transistor, and a gate of the second transistor; an output terminal of the first logic circuit is electrically connected to an input terminal of the second logic circuit; a second terminal of the second transistor is electrically connected to a first terminal of the third transistor and a first terminal of the fourth transistor; a gate of the third transistor is electrically connected to the first input wiring; a gate of the fourth transistor is electrically connected to the second input wiring; a second terminal of the third transistor is electrically connected to the first wiring; a second terminal of the fourth transistor is electrically connected to the second wiring; the second holding node is electrically connected to an input terminal of the third logic circuit, an output terminal of the fourth logic circuit, a first terminal of the fifth transistor, and a gate of the sixth transistor; an output terminal of the third logic circuit is electrically connected to an input terminal of the fourth logic circuit; a second terminal of the sixth transistor is electrically connected to a first terminal of the seventh transistor and a first terminal of the eighth transistor; a gate of the seventh transistor is electrically connected to the first input wiring; a gate of the eighth transistor is electrically connected to the second input wiring; a second terminal of the seventh transistor is electrically connected to the second wiring; and a second terminal of the eighth transistor is electrically connected to the first wiring.

(5)

Another embodiment of the present invention is the semiconductor device with the above structure (1). The first circuit includes first to fourth transistors, a first logic circuit, and a second logic circuit; the second circuit includes sixth to eighth transistors; the first logic circuit and the second logic circuit each have a function of outputting an inverted signal of a signal input to an input terminal from an output terminal; the first holding node is electrically connected to an input terminal of the first logic circuit, an output terminal of the second logic circuit, a first terminal of the first transistor, and a gate of the second transistor; an output terminal of the first logic circuit is electrically connected to an input terminal of the second logic circuit; a second terminal of the second transistor is electrically connected to a first terminal of the third transistor and a first terminal of the fourth transistor; a gate of the third transistor is electrically connected to the first input wiring; a gate of the fourth transistor is electrically connected to the second input wiring; a second terminal of the third transistor is electrically connected to the first wiring; a second terminal of the fourth transistor is electrically connected to the second wiring; the second holding node is electrically connected to the input terminal of the second logic circuit, the output terminal of the first logic circuit, and a gate of the sixth transistor; a second terminal of the sixth transistor is electrically connected to a first terminal of the seventh transistor and a first terminal of the eighth transistor; a gate of the seventh transistor is electrically connected to the first input wiring; a gate of the eighth transistor is electrically connected to the second input wiring; a second terminal of the seventh transistor is electrically connected to the second wiring; and a second terminal of the eighth transistor is electrically connected to the first wiring.

(6)

Another embodiment of the present invention is a semiconductor device including a first circuit and a second circuit. The first circuit includes a first load circuit; the second circuit includes a second load circuit; the first load circuit and the second load circuit each include a first terminal and a second terminal; the first load circuit and the second load circuit each have a function of changing a resistance between the first terminal and the second terminal in accordance with first data; the first circuit is electrically connected to a first input wiring, a second input wiring, a first wiring, and a second wiring; the second circuit is electrically connected to the first input wiring, the second input wiring, the first wiring, and the second wiring; the first circuit has a function of outputting a current corresponding to the resistance of the first load circuit to the first wiring when a high-level potential is input to the first input wiring and a low-level potential is input to the second input wiring, a function of outputting a current corresponding to the resistance of the first load circuit to the second wiring when a low-level potential is input to the first input wiring and a high-level potential is input to the second input wiring, and a function of not outputting a current corresponding to the resistance of the first load circuit to the first wiring and the second wiring when a low-level potential is input to the first input wiring and a low-level potential is input to the second input wiring; and the second circuit has a function of outputting a current corresponding to the resistance of the second load circuit to the second wiring when a high-level potential is input to the first input wiring and a low-level potential is input to the second input wiring, a function of outputting a current corresponding to the resistance of the second load circuit to the first wiring when a low-level potential is input to the first input wiring and a high-level potential is input to the second input wiring, and a function of not outputting a current corresponding to the resistance of the second load circuit to the first wiring and the second wiring when a low-level potential is input to the first input wiring and a low-level potential is input to the second input wiring.

(7)

Another embodiment of the present invention is the semiconductor device with the above structure (6). The first circuit includes a third transistor and a fourth transistor; the second circuit includes a seventh transistor and an eighth transistor; the first terminal of the first load circuit is electrically connected to a first terminal of the third transistor and a first terminal of the fourth transistor; a gate of the third transistor is electrically connected to the first input wiring; a gate of the fourth transistor is electrically connected to the second input wiring; a second terminal of the third transistor is electrically connected to the first wiring; a second terminal of the fourth transistor is electrically connected to the second wiring; the first terminal of the second load circuit is electrically connected to a first terminal of the seventh transistor and a first terminal of the eighth transistor; a gate of the seventh transistor is electrically connected to the first input wiring; a gate of the eighth transistor is electrically connected to the second input wiring; a second terminal of the seventh transistor is electrically connected to the second wiring; and a second terminal of the eighth transistor is electrically connected to the first wiring.

(8)

Another embodiment of the present invention is the semiconductor device with the above structure (7). The first circuit includes a first transistor; the second circuit includes a second transistor; a first terminal of the first transistor is electrically connected to the first terminal of the first load circuit; and a first terminal of the second transistor is electrically connected to the first terminal of the second load circuit.

(9)

Another embodiment of the present invention is the semiconductor device with any one of the above structures (6) to (8). The first load circuit includes any one of a variable resistor, an MTJ element, and a phase-change memory; and the second load circuit includes any one of a variable resistor, an MTJ element, and a phase-change memory.

(10)

Another embodiment of the present invention is the semiconductor device with any one of the above structures (1) to (9), including a third circuit and a fourth circuit. The third circuit has a function of inputting a potential corresponding to the second data to the first input wiring and the second input wiring; and the fourth circuit has a function of comparing currents flowing from the first wiring and the second wiring and outputting a potential corresponding to a product of the first data and the second data from an output terminal of the fourth circuit.

(11)

An electronic device including the semiconductor device according to any one of (1) to (10) above and performing arithmetic operation of a neural network by the semiconductor device.

Note that in this specification and the like, a semiconductor device refers to a device that utilizes semiconductor characteristics, and means a circuit including a semiconductor element (a transistor, a diode, a photodiode, and the like), a device including the circuit, and the like. The semiconductor device also means all devices that can function by utilizing semiconductor characteristics. For example, an integrated circuit, a chip including an integrated circuit, and an electronic component including a chip in a package are examples of the semiconductor device. Moreover, a memory device, a display device, a light-emitting device, a lighting device, an electronic device, and the like themselves might be semiconductor devices, or might include semiconductor devices.

In the case where there is a description “X and Y are connected” in this specification and the like, the case where X and Y are electrically connected, the case where X and Y are functionally connected, and the case where X and Y are directly connected are regarded as being disclosed in this specification and the like. Accordingly, without being limited to a predetermined connection relation, for example, a connection relation shown in drawings or texts, a connection relation other than one shown in drawings or texts is disclosed in the drawings or the texts. Each of X and Y denotes an object (e.g., a device, an element, a circuit, a wiring, an electrode, a terminal, a conductive film, or a layer).

For example, in the case where X and Y are electrically connected, one or more elements that allow electrical connection between X and Y (e.g., a switch, a transistor, a capacitor, an inductor, a resistor, a diode, a display element, a light-emitting element, and a load) can be connected between X and Y. Note that a switch has a function of being controlled to be turned on or off. That is, the switch has a function of being in a conduction state (on state) or a non-conduction state (off state) to determine whether a current flows or not.

For example, in the case where X and Y are functionally connected, at least one circuit that enables functional connection between X and Y (e.g., a logic circuit (an inverter, a NAND circuit, a NOR circuit, or the like); a signal converter circuit (a digital-analog converter circuit, an analog-digital converter circuit, a gamma correction circuit, or the like); a potential level converter circuit (a power supply circuit (a step-up circuit, a step-down circuit, or the like), a level shifter circuit for changing the potential level of a signal, or the like); a voltage source; a current source; a switching circuit; an amplifier circuit (a circuit that can increase signal amplitude, the amount of current, or the like, an operational amplifier, a differential amplifier circuit, a source follower circuit, a buffer circuit, or the like); a signal generation circuit; a memory circuit; or a control circuit) can be connected between X and Y. For example, even when another circuit is provided between X and Y, X and Y are regarded as being functionally connected when a signal output from X is transmitted to Y.

Note that an explicit description, X and Y are electrically connected, includes the case where X and Y are electrically connected (i.e., the case where X and Y are connected with another element or another circuit provided therebetween), the case where X and Y are functionally connected (i.e., the case where X and Y are connected with another circuit provided therebetween), and the case where X and Y are directly connected (i.e., the case where X and Y are connected without another element or another circuit provided therebetween). That is, the explicit expression “X and Y are electrically connected” is the same as the explicit simple expression “X and Y are connected”.

It can be expressed as, for example, “X, Y, a source (or a first terminal or the like) of a transistor, and a drain (or a second terminal or the like) of the transistor are electrically connected to each other, and X, the source (or the first terminal or the like) of the transistor, the drain (or the second terminal or the like) of the transistor, and Y are electrically connected to each other in this order”. Alternatively, it can be expressed as “a source (or a first terminal or the like) of a transistor is electrically connected to X; a drain (or a second terminal or the like) of the transistor is electrically connected to Y; and X, the source (or the first terminal or the like) of the transistor, the drain (or the second terminal or the like) of the transistor, and Y are electrically connected to each other in this order”. Alternatively, it can be expressed as “X is electrically connected to Y through a source (or a first terminal or the like) and a drain (or a second terminal or the like) of a transistor, and X, the source (or the first terminal or the like) of the transistor, the drain (or the second terminal or the like) of the transistor, and Y are provided in this connection order”. When the connection order in a circuit configuration is defined by an expression similar to the above examples, a source (or a first terminal or the like) and a drain (or a second terminal or the like) of a transistor can be distinguished from each other to specify the technical scope. Note that these expressions are examples, and the expression is not limited to these expressions. Here, X and Y each denote an object (e.g., a device, an element, a circuit, a wiring, an electrode, a terminal, a conductive film, or a layer).

Even when independent components are electrically connected to each other in a circuit diagram, one component has functions of a plurality of components in some cases. For example, when part of a wiring also functions as an electrode, one conductive film has functions of both components: a function of the wiring and a function of the electrode. Thus, “electrical connection” in this specification includes in its category such a case where one conductive film has functions of a plurality of components.

In this specification and the like, a transistor includes three terminals called a gate, a source, and a drain. The gate functions as a control terminal for controlling the conduction state of the transistor. Two terminals functioning as the source and the drain are input/output terminals of the transistor. One of the two input/output terminals serves as the source and the other serves as the drain on the basis of the conductivity type (n-channel type or p-channel type) of the transistor and the levels of potentials applied to the three terminals of the transistor. Thus, the terms “source” and “drain” are interchangeable in this specification and the like. In this specification and the like, expressions “one of a source and a drain” (or a first electrode or a first terminal) and “the other of the source and the drain” (or a second electrode or a second terminal) are used in description of the connection relation of a transistor. Depending on the structure, a transistor may include a back gate in addition to the above three terminals. In that case, in this specification and the like, one of the gate and the back gate of the transistor may be referred to as a first gate and the other of the gate and the back gate of the transistor may be referred to as a second gate. Moreover, the terms “gate” and “back gate” can be replaced with each other in one transistor in some cases. In the case where a transistor includes three or more gates, the gates may be referred to as a first gate, a second gate, and a third gate, for example, in this specification and the like.

In this specification and the like, a node can be referred to as a terminal, a wiring, an electrode, a conductive layer, a conductor, an impurity region, or the like depending on the circuit configuration, the device structure, or the like. Furthermore, a terminal, a wiring, or the like can be referred to as a node.

In this specification and the like, “voltage” and “potential” can be replaced with each other as appropriate. The “voltage” refers to a potential difference from a reference potential, and when the reference potential is a ground potential, for example, the “voltage” can be expressed as the “potential”. The ground potential does not necessarily mean 0 V. Potentials are relative values, and the potential applied to a wiring or the like is sometimes changed depending on the reference potential.

Note that “current” is a charge transfer (electrical conduction); for example, the description “electrical conduction of positively charged particles occurs” can be rephrased as “electrical conduction of negatively charged particles occurs in the opposite direction”. Therefore, unless otherwise specified, “current” in this specification and the like refers to a charge transfer (electrical conduction) accompanied by carrier movement. Examples of a carrier here include an electron, a hole, an anion, a cation, and a complex ion, and the type of carrier differs between current flow systems (e.g., a semiconductor, a metal, an electrolyte solution, and a vacuum). The direction of a current in a wiring or the like refers to the direction in which a positive carrier moves, and the amount of current is expressed as a positive value. In other words, the direction in which a negative carrier moves is opposite to the direction of a current, and the amount of current is expressed as a negative value. Thus, in the case where the polarity of a current (or the direction of a current) is not specified in this specification and the like, the description “current flows from element A to element B” can be rephrased as “current flows from element B to element A”, for example. The description “current is input to element A” can be rephrased as “current is output from element A”, for example.

Ordinal numbers such as “first”, “second”, and “third” in this specification and the like are used in order to avoid confusion among components. Thus, the terms do not limit the number of components. In addition, the terms do not limit the order of components. In this specification and the like, for example, a “first” component in one embodiment can be referred to as a “second” component in other embodiments or claims. Furthermore, in this specification and the like, for example, a “first” component in one embodiment can be omitted in other embodiments or claims.

In this specification and the like, terms for describing arrangement, such as “over” and “under”, are sometimes used for convenience to describe the positional relation between components with reference to drawings. The positional relation between components is changed as appropriate in accordance with a direction in which the components are described. Thus, terms for the description are not limited to terms used in the specification and the like, and the description can be made appropriately according to circumstances. For example, the expression “an insulator positioned over (on) a top surface of a conductor” can be replaced with the expression “an insulator positioned on a bottom surface of a conductor” when the direction of a drawing showing these components is rotated by 180°.

Furthermore, the term “over” or “under” does not necessarily mean that a component is placed directly on or directly under and in direct contact with another component. For example, the expression “electrode B over insulating layer A” does not necessarily mean that the electrode B is formed on and in direct contact with the insulating layer A, and does not exclude the case where another component is provided between the insulating layer A and the electrode B.

In this specification and the like, the terms “film”, “layer”, and the like can be interchanged with each other according to circumstances. For example, the term “conductive layer” can be changed into the term “conductive film” in some cases. Moreover, the term “insulating film” can be changed into the term “insulating layer” in some cases. Alternatively, the term “film”, “layer”, or the like is not used and can be interchanged with another term depending on the case or according to circumstances. For example, the term “conductive layer” or “conductive film” can be changed into the term “conductor” in some cases. Furthermore, for example, the term “insulating layer” or “insulating film” can be changed into the term “insulator” in some cases.

In this specification and the like, a term such as an “electrode” or a “wiring” does not limit the function of a component. For example, an “electrode” is used as part of a “wiring” in some cases, and vice versa. Furthermore, the term “electrode” or “wiring” can also mean the case where a plurality of “electrodes” or “wirings” are formed in an integrated manner.

In this specification and the like, the terms “wiring”, “signal line”, “power supply line”, and the like can be interchanged with each other depending on the case or according to circumstances. For example, the term “wiring” can be changed into the term “signal line” in some cases. As another example, the term “wiring” can be changed into the term “power supply line” in some cases. Inversely, the term “signal line”, “power supply line”, or the like can be changed into the term “wiring” in some cases. The term “power supply line” or the like can be changed into the term “signal line” or the like in some cases. Inversely, the term “signal line” or the like can be changed into the term “power supply line” or the like in some cases. The term “potential” that is applied to a wiring can be changed into the term “signal” or the like depending on the case or according to circumstances. Inversely, the term “signal” or the like can be changed into the term “potential” in some cases.

In this specification and the like, an impurity in a semiconductor refers to an element other than a main component of a semiconductor layer, for example. For example, an element with a concentration of lower than 0.1 atomic % is an impurity. If a semiconductor contains an impurity, formation of the DOS (Density of States) in the semiconductor, decrease in the carrier mobility, or decrease in the crystallinity may occur, for example. In the case where the semiconductor is an oxide semiconductor, examples of an impurity that changes characteristics of the semiconductor include Group 1 elements, Group 2 elements, Group 13 elements, Group 14 elements, Group 15 elements, and transition metals other than the main components; specific examples are hydrogen (contained also in water), lithium, sodium, silicon, boron, phosphorus, carbon, and nitrogen. Specifically, when the semiconductor is a silicon layer, examples of an impurity that changes characteristics of the semiconductor include oxygen, Group 1 elements except hydrogen, Group 2 elements, Group 13 elements, and Group 15 elements.

In this specification and the like, a switch is in a conduction state (on state) or a non-conduction state (off state) to determine whether a current flows or not. Alternatively, a switch has a function of selecting and changing a current path. For example, an electrical switch or a mechanical switch can be used. That is, a switch can be any element capable of controlling a current, and is not limited to a certain element.

Examples of an electrical switch include a transistor (e.g., a bipolar transistor and a MOS transistor), a diode (e.g., a PN diode, a PIN diode, a Schottky diode, a MIM (Metal Insulator Metal) diode, a MIS (Metal Insulator Semiconductor) diode, and a diode-connected transistor), and a logic circuit in which such elements are combined. Note that in the case of using a transistor as a switch, a “conduction state” of the transistor refers to a state where a source electrode and a drain electrode of the transistor can be regarded as being electrically short-circuited. Furthermore, a “non-conduction state” of the transistor refers to a state where the source electrode and the drain electrode of the transistor can be regarded as being electrically disconnected. Note that in the case where a transistor operates just as a switch, there is no particular limitation on the polarity (conductivity type) of the transistor.

An example of a mechanical switch is a switch formed using a MEMS (micro electro mechanical system) technology. Such a switch includes an electrode that can be moved mechanically, and operates by controlling conduction and non-conduction with movement of the electrode.

Effect of the Invention

One embodiment of the present invention can provide a semiconductor device and the like including a hierarchical artificial neural network. Alternatively, one embodiment of the present invention can provide a semiconductor device and the like with low power consumption. Alternatively, one embodiment of the present invention can provide a semiconductor device and the like that are less affected by environmental temperature. Alternatively, one embodiment of the present invention can provide a novel semiconductor device and the like.

Note that the effects of one embodiment of the present invention are not limited to the effects listed above. The effects listed above do not preclude the existence of other effects. Note that the other effects are effects that are not described in this section and will be described below. The effects that are not described in this section will be derived from the descriptions of the specification, the drawings, and the like and can be extracted from these descriptions by those skilled in the art. Note that one embodiment of the present invention has at least one of the effects listed above and the other effects. Accordingly, depending on the case, one embodiment of the present invention does not have the effects listed above in some cases.

