NMOS Transistors and PMOS Transistors Explained

An nMOS (negative-MOS) transistor forms a closed-circuit when receiving a non-negligible voltage, while a pMOS (positive-MOS) transistor forms an open circuit. Here’s what you need to know. 

Written by Brendan Massey
nmos transistor circuit concept
Image: Shutterstock / Built In
Brand Studio Logo
UPDATED BY
Brennan Whitfield | Feb 20, 2025

Microprocessors are built out of transistors. In particular, they are constructed out of metal-oxide semiconductor (MOS) transistors. There are two types of MOS transistors — positive-MOS (pMOS) and negative-MOS (nMOS). Every pMOS and nMOS comes equipped with three main components — the gate, the source and the drain.

What are NMOS Transistors and PMOS Transistors?

  • NMOS Transistor: A negative-MOS transistor forms a closed circuit when receiving a non-negligible voltage and an open circuit when it receives a voltage at around 0 volts. 
  • PMOS Transistor: A positive-MOS transistor forms an open circuit when it receives a non-negligible voltage and a closed circuit when it receives a voltage at around 0 volts.   

To understand how a pMOS and an nMOS operate, you need to know a couple key terms:

  • Closed circuit: This means that the electricity is flowing from the gate to the source.
  • Open circuit: This means the electricity is not flowing from the gate to the source; rather, electricity is flowing from the gate to the drain.

 

A tutorial on the basics of nMOS, pMOS and cMOS transistors. | Video: Electric Videos

How Does an NMOS Transistor Work?

When an nMOS transistor receives a non-negligible voltage, the connection from the source to the drain acts as a wire. Electricity will flow from the source to the drain uninhibited. This is referred to as a closed circuit. On the other hand, when an nMOS transistor receives a voltage at around 0 volts, the connection from the source to the drain will be broken, which is referred to as an open circuit.

nmos transistor diagram
Example of an nMOS transistor. | Image: Brendan Massey

RelatedAI Chips: What Are They?

 

How Does a PMOS Transistor Work?

The p-type transistor works counter to the n-type transistor. Whereas the nMOS will form a closed circuit with the source when the voltage is non-negligible, the pMOS will form an open circuit with the source when the voltage is non-negligible.

As you can see in the image of the pMOS transistor shown below, the only difference between a pMOS transistor and an nMOS transistor is the little circle between the gate and the first bar. This circle inverts the value from the voltage. If the gate sends a voltage representative of a value of 1, then the inverter will change the 1 to a 0 and cause the circuit to function accordingly.

nmos transistor example of a pmos transistor
Example of a pMOS transistor. | Image: Brendan Massey

The pMOS and nMOS transistors function in an opposite, complementary manner. So when we combine the both of them into one giant MOS circuit, it becomes a complementary metal-oxide semiconductor (cMOS circuit).

RelatedSolid-State Silicon Chips Are About to Change the Way We Live. Forever.

 

Constructing NMOS and PMOS Transistor Gates 

We can combine pMOS and nMOS circuits in order to build more complex structures called gates. More specifically, we’ll want to build logic gates. 

We can attach a pMOS transistor that connects to the source and an nMOS transistor that connects to the ground. This will be our first example of a cMOS transistor.

nmos transistor NOT Gate diagram
Example of a NOT gate. | Image: Brendan Massey

This cMOS transistor acts in a similar manner to the NOT logical function.

Let’s take a look at the NOT truth table:

nmos transistor NOT truth table
NOT truth table. | Image Brendan Massey

In the NOT truth table, every “input value: A” is inverted. What happens with the circuit above?

Well, let’s imagine the input is a 0.

The 0 comes in and goes both up and down the wire to the pMOS (top) and the nMOS (bottom). When the value 0 reaches the pMOS, it gets inverted to a 1. So, the connection to the source is closed. This will produce a logical value of 1 as long as the connection to the ground (drain) isn’t also closed. Since the transistors are complementary, we know that the nMOS transistor won’t invert the value, so it takes the value 0 as is and will therefore create an open circuit to the ground (drain). Thus, a logical value of 1 is produced for the gate.

nmos transistor in and out value table
An IN value of 0 produces an OUT value of 1. | Image: Brendan Massey

What happens if a 1 is the IN value? Well, following the same steps as above, the value 1 gets sent to both the pMOS and the nMOS. When the value is received by the pMOS, the value gets inverted to a 0. Thus, the connection to the source is open. When the nMOS receives the value, the value does not get inverted. Thus, the value remains a 1. When a value of 1 is received by the nMOS, the connection is closed. So, the connection to the ground is closed. This will produce a logical value of 0.

nmos transistor in and out table
An IN value of 1 produces an OUT value of 0. | Image: Brendan Massey

Putting the two sets of input/output together yields:

nmos transistor truth table
The truth table for a NOT gate. | Image: Brendan Massey

It’s quite easy to see that this truth table is the exact same as that which the logical function NOT produces. As a result, this is known as a NOT gate.

Can we use these two simple transistors to make more complicated structures? Absolutely. Next, we will build a NOT-OR (NOR) gate and an OR gate.

Building a ‘NOT-OR’ Gate With NMOS and PMOS Transistors

nmos transistor NOT OR gate illustration
An example of a NOR gate. | Image: Brendan Massey

This circuit uses two pMOS transistors at the top and two nMOS transistors at the bottom. Again, let’s look at the input to the gate to see how it behaves.

When “A” is 0 and “B” is 0, this gate will invert both the values to a 1 when they reach the pMOS transistors. However, the nMOS transistors will both maintain the value of 0. This will lead the gate to produce a value of 1.

When “A” is 0 and “B”  is 1, this gate will invert both the values when they reach the pMOS transistors. So, “A” will change to 1 and “B” will change to 0. This will not lead to the source because both of the transistors require a closed circuit in order to connect the input to the source. The nMOS transistors do not invert the values. So, the nMOS associated with “A” will produce a 0, and the nMOS associated with “B” will produce a 1. Thus, the nMOS associated with “B” will produce a closed circuit to the ground. This will lead the gate to produce a value of 0.

When “A” is 1 and “B” is 0, this gate will invert both the values when they reach the pMOS transistors. So, “A” will change to 0 and “B” will change to 1. This will not lead to the source since both of the transistors require a closed-circuit in order to connect the input to the source. The nMOS transistors do not invert the values. So, the nMOS associated with “A” will produce a 1, and the nMOS associated with “B” will produce a 0. Thus, the nMOS associated with “A” will produce a closed circuit to the ground. This will lead the gate to produce a value of 0.

When “A” is 1 and “B” is 1, this gate will invert both the values when they reach the pMOS transistors. So, “A” will change to 0 and “B” will change to 0. This will not lead to the source since both of the transistors require a closed circuit in order to connect the input to the source. The nMOS transistors do not invert the values; so, the nMOS associated with “A” will produce a 1, and the nMOS associated with “B” will produce a 1. Thus, the nMOS associated with “A” and the nMOS associated with “B” will produce a closed circuit to the ground. This will lead the gate to produce a value of 0.

Thus, the gate’s truth table is as follows:

nmos transistor gate truth table
The output of the NOR gate. | Image: Brendan Massey

Meanwhile, the NOR logical function’s truth table is as follows:

nmos transistor NOR logical function table
The output of the NOR logical function. | Image: Brendan Massey

Thus, we have confirmed that this gate is a NOR gate because it shares its truth table with the NOR logical function.

Building an ‘OR’ Gate With NMOS and PMOS Transistors 

Now, we will put both of the gates that we have created together in order to produce an OR gate. Remember, NOR stands for NOT OR. So, if we invert an already inverted gate, we will get the original back. Let’s put this to the test to see it in action.

nmos transistor OR Gate Illustration
Example of an OR gate. | Image: Brendan Massey

What we’ve done here is we’ve taken the NOR gate from before and applied a NOT gate to the output. As you can see above, the NOT gate will take a value of 1 and output a 0, and the NOT gate will take a value of 0 and output a 1.

This will take the values of the NOR gate and convert all of the 0’s to 1’s and 1’s to 0’s. Thus, the truth table will be as follows:

nmos transistor OR gate truth table
Truth table of a NOR gate and an OR gate. | Image: Brendan Massey

If you would like more practice testing these gates, feel free to try out the above values for yourself and see that the gate produces equivalent results.

Building a ‘NOT-AND’ Gate With NMOS and PMOS Transistors

nmos transistor NOT AND gate illustration
Example of a NAND gate. | Image: Brendan Massey

I claim this is a NOT AND (NAND) gate, but let’s test this gate’s truth table to determine if it really is a NAND gate.

When “A” is 0 and “B” is 0, “A’s” pMOS will produce a 1, and “A’s” nMOS will produce a 0. Thus, this gate will produce a logical 1 since it is connected to the source with a closed circuit and disconnected from the ground with an open circuit.

When “A” is 0 and “B” is 1, “A’s” pMOS will produce a 1, and “A’s” nMOS will produce a 0. Thus, this gate will produce a logical 1 since it is connected to the source with a closed circuit and disconnected from the ground with an open circuit.

When “A” is 1 and “B” is 0, “B’s” pMOS will produce a 1, and “B’s” nMOS will produce a 0. Thus, this gate will produce a logical 1 since it is connected to the source with a closed circuit and disconnected from the ground with an open circuit.

When “A” is 1 and “B” is 1, “A’s” pMOS will produce a 0, and “A’s” nMOS will produce a 1. So, we must check “B’s” pMOS and nMOS, as well. “B’s” pMOS will produce a 0, and “B’s” nMOS will produce a 1. Thus, this gate will produce a logical 0 since it is disconnected from the source with an open circuit and connected to the ground with a closed circuit.

The truth table is as follows:

nmos transistor gate truth table
The above gate’s truth table. | Image: Brendan Massey

Meanwhile, the NAND logical function’s truth table is as follows:

nmos transistor NAND truth table
NAND truth table. | Image: Brendan Massey

Thus, we have verified that this is, indeed, a NAND gate.

Building an AND Gate With NMOS and PMOS Transistors

Now, how do we build an AND gate? Well, we will build an AND gate the exact same way we built an OR gate from a NOR gate. We will attach an inverter.

nmos transistor AND gate illustration
Example of an AND gate. | Image: Brendan Massey

Since all we have done is applied a NOT function to a NAND gate’s output, the truth table will look like this:

nmos transistor AND NAND truth table
Complete truth table of an AND and NAND gate. | Image: Brendan Massey

Again, please verify to make sure that what I am telling you is true. Thus we’ve covered what pMOS and nMOS transistors are, as well as how to use them to build more complex structures.

Frequently Asked Questions

An NMOS (negative-MOS) transistor is a transistor with a metal-oxide semiconductor (MOS) structure, where n-type material is used for the source and the drain terminals and p-type material is used for the substrate. An NMOS transistor forms a closed circuit when it receives a non-negligible voltage, and an open circuit when it receives a voltage around 0 volts.

NMOS transistors have n-type (electron-based) source and drain terminals and a p-type substrate, while PMOS transistors have p-type (hole-based) source and drain terminals and an n-type substrate. NMOS transistors turn on with a high gate voltage, and PMOS transistors turn on with a low gate voltage.

Explore Job Matches.