Learn Analog Circuits with Zundamon

Episode 1

How Transistors Work: MOSFET vs BJT and CMOS

Join Zundamon and Shikoku Metan to learn how transistors work, from the MOSFET channel to the CMOS inverter.

Watch on YouTube (9:28)
  • Shikoku Metan (explains)
  • Zundamon (asks)

1Intro: my course is in danger!

Zundamon

Metan, it's a disaster! I'm going to fail Electronic Circuits, nanoda!

Shikoku Metan

Oh dear. Then let's work through transistors together before finals.

Illustration: Oh dear. Then let's work through transistors together before finals.
Figure 1

2Transistors in modern ICs: CMOS

ZundamonQuestion

Please! So what does a transistor actually do, anyway?

Illustration: Please! So what does a transistor actually do, anyway?
Figure 2

Shikoku Metan

It's a device that switches current on and off, and controls how much flows.

Illustration: It's a device that switches current on and off, and controls how much flows.
Figure 3

Shikoku Metan

Most transistors in today's ICs, like smartphone CPUs, are MOSFETs.

Illustration: Most transistors in today's ICs, like smartphone CPUs, are MOSFETs.
Figure 4

Shikoku Metan

They're combined using a scheme called CMOS.

ZundamonQuestion

"Most"? So there are other kinds of transistors too?

Shikoku Metan

Yes, the bipolar transistor, or BJT. Let's compare the two.

Illustration: Yes, the bipolar transistor, or BJT. Let's compare the two.
Figure 5

3BJT vs. MOSFET

Shikoku Metan

On the left is an npn BJT, on the right an N-channel MOSFET.

ZundamonQuestion

They both carry current, so what's the difference?

Illustration: They both carry current, so what's the difference?
Figure 6

Shikoku Metan

In a BJT, you forward-bias the pn junction between base and emitter with VBE.

Shikoku Metan: And the collector is held at a higher potential than the base.

Shikoku Metan: Electrons injected from the emitter mostly cross the thin base to the collector.

Shikoku Metan: Collector current IC varies exponentially with VBE. A small base current flows too.

Shikoku Metan: A MOSFET uses its gate voltage to create an electron path at the surface.

ZundamonQuestion

Does current flow into the gate?

Shikoku Metan

No. A thin insulating layer separates the gate from the channel, so almost no DC current flows.

Shikoku Metan: Here's a table summarizing the differences.

Illustration: Here's a table summarizing the differences.
Figure 7

Shikoku Metan

This series focuses on the MOSFET. Today, let's see how it works.

Zundamon

Let's do this, nanoda!

Illustration: Let's do this, nanoda!
Figure 8

4MOSFET symbols and terminals

Shikoku Metan

Back to the N-channel MOSFET, or NMOS. Its three terminals are the gate (G), drain (D), and source (S).

Illustration: Back to the N-channel MOSFET, or NMOS. Its three terminals are the gate (G), drain (D), and source (S).
Figure 9

Shikoku Metan

There's a fourth, the body terminal, but let's assume it's tied to the source.

Shikoku Metan: The gate-source voltage VGS controls the current ID flowing from drain to source.

Illustration: The gate-source voltage VGS controls the current ID flowing from drain to source.
Figure 10

Shikoku Metan

This circuit applies VGS and the drain-source voltage VDS, and measures ID.

Illustration: This circuit applies VGS and the drain-source voltage VDS, and measures ID.
Figure 11

Shikoku Metan

Numbers here are illustrative values, assuming roughly a 180 nm CMOS process.

Zundamon

A voltage that sets a current... like a dependent source from circuit theory!

Shikoku Metan

Good eye. Under the right conditions, it is a voltage-controlled current source.

Shikoku Metan: Let's check those conditions by varying the voltages in this circuit.

Illustration: Let's check those conditions by varying the voltages in this circuit.
Figure 12
Try it yourselfTest circuit: change VGS and VDS to observe ID

Use the sliders or arrow keys to change the voltages and observe the drain current and operating region. Notice how small the current becomes when VGS falls below Vth.

5Why current flows: the channel in cross-section

Shikoku Metan

Let's look at a cross-section: n-type source and drain in a p-type substrate.

Shikoku Metan: On top, a thin oxide layer sits between the substrate and the gate.

Illustration: On top, a thin oxide layer sits between the substrate and the gate.
Figure 13

Shikoku Metan

The n+ regions (heavily doped n-type) have many electrons; the p-type substrate has many holes.

Shikoku Metan: A hole is a missing electron that moves like a positive charge.

ZundamonQuestion

It's p-type between source and drain, so electrons can't pass?

Shikoku Metan

Right. The pn junction is an energy hill that electrons can hardly climb.

Shikoku Metan: So while VGS is small, almost no current flows. That's the cutoff region.

Illustration: So while VGS is small, almost no current flows. That's the cutoff region.
Figure 14

Shikoku Metan

With a positive gate voltage, holes at the surface are pushed away first.

Shikoku Metan: This region, with few mobile charges, is called the depletion layer.

Illustration: This region, with few mobile charges, is called the depletion layer.
Figure 15

Shikoku Metan

Raise it further: electrons gather, the hill drops, and source and drain connect.

Illustration: Raise it further: electrons gather, the hill drops, and source and drain connect.
Figure 16

Shikoku Metan

This electron path is called the channel, or the inversion layer.

Shikoku Metan: The VGS at which the channel starts to form is the threshold voltage Vth. In this model, Vth=0.4 V.

ZundamonQuestion

Once there's a path, which way do the electrons flow?

Shikoku Metan

With VDS applied, the electric field pushes electrons from source to drain.

Shikoku Metan: Electrons are negative, so current runs opposite: ID flows from drain to source.

Illustration: Electrons are negative, so current runs opposite: ID flows from drain to source.
Figure 17

ZundamonQuestion

If I raise VGS more, does the channel get thicker?

Shikoku Metan

Yes. The more electrons there are, the more easily current flows.

6ID–VGS characteristics and the square law

Shikoku Metan

Hold VDS constant and plot ID against VGS, and you get this graph.

Zundamon

It's almost zero up to Vth, then starts to rise!

Illustration: It's almost zero up to Vth, then starts to rise!
Figure 18

Shikoku Metan

With large VDS and VGS well above Vth, ID is roughly proportional to (VGS−Vth)².

Illustration: With large VDS and VGS well above Vth, ID is roughly proportional to (VGS − Vth)².
Figure 19

ZundamonQuestion

Is VGS−Vth just how far we are above threshold?

Shikoku Metan

Right. We call it the overdrive voltage, Vov. It's a very important quantity.

Try it yourselfID–VGS characteristics at constant VDS

Switch to the logarithmic vertical axis to see subthreshold current, which changes exponentially even below Vth.

7Inside the current equation: μnCox and W/L

ZundamonQuestion

What are μnCox and W/L in that formula, anyway?

Shikoku Metan

Current is charge per unit length of channel times the average drift speed.

Illustration: Current is charge per unit length of channel times the average drift speed.
Figure 20

Shikoku Metan

First, the charge at small VDS. The gate and channel form an oxide capacitor.

Illustration: First, the charge at small VDS. The gate and channel form an oxide capacitor.
Figure 21

Shikoku Metan

As Q = CV says, electrons collect in the channel in proportion to VGS above Vth.

Illustration: As Q = CV says, electrons collect in the channel in proportion to VGS above Vth.
Figure 22

Shikoku Metan

Cox is the oxide capacitance per unit area. Thinner oxide means larger Cox.

Shikoku Metan: Multiply by the channel width W, and the charge per unit length is about Cox·W·(VGS−Vth).

Illustration: Multiply by the channel width W, and the charge per unit length is about Cox·W·(VGS − Vth).
Figure 23

ZundamonQuestion

Then what decides the electrons' speed?

Shikoku Metan

It's proportional to the electric field. The proportionality factor is the mobility μn, a measure of how easily electrons move.

Illustration: It's proportional to the electric field. The proportionality factor is the mobility μn, a measure of how easily electrons move.
Figure 24

Shikoku Metan

By the way, holes have lower mobility than electrons. That matters for PMOS later.

Illustration: By the way, holes have lower mobility than electrons. That matters for PMOS later.
Figure 25

Shikoku Metan

L is the channel length. Field ≈ VDS/L, so a shorter L means faster electrons.

Illustration: L is the channel length. Field ≈ VDS/L, so a shorter L means faster electrons.
Figure 26

Shikoku Metan

Multiply them together and, for small VDS, you get ID≈μnCox(W/L)(VGS−Vth)·VDS, which is proportional to VDS.

Illustration: Multiply them together and, for small VDS, you get ID ≈ μnCox(W/L)(VGS − Vth)·VDS, which is proportional to VDS.
Figure 27

Zundamon

A wider W means more electrons; a shorter L means faster ones. So ID increases!

Illustration: A wider W means more electrons; a shorter L means faster ones. So ID increases!
Figure 28

Shikoku Metan

Raise VDS and the channel narrows at the drain, so charge and speed vary along it.

Illustration: Raise VDS and the channel narrows at the drain, so charge and speed vary along it.
Figure 29

Shikoku Metan

Working it out, the current levels off, and you get the square law from earlier, with its factor of ½.

Illustration: Working it out, the current levels off, and you get the square law from earlier, with its factor of ½.
Figure 30

Shikoku Metan

Let's write μnCox·W/L as K. In this model, K = 2 mA/V².

Illustration: Let's write μnCox·W/L as K. In this model, K = 2 mA/V².
Figure 31

8The subthreshold region

ZundamonQuestion

By the way, is the current really zero below Vth?

Illustration: By the way, is the current really zero below Vth?
Figure 32

Shikoku Metan

I said cutoff, but it isn't really zero. Let's make the vertical axis logarithmic.

Illustration: I said cutoff, but it isn't really zero. Let's make the vertical axis logarithmic.
Figure 33

Shikoku Metan

Even below Vth, ID increases exponentially with VGS.

Shikoku Metan: This is called the subthreshold region, or weak inversion.

Illustration: This is called the subthreshold region, or weak inversion.
Figure 34

Shikoku Metan

In this model, ID rises tenfold for every ~90 mV increase in VGS.

Shikoku Metan: At room temperature, a normal MOSFET needs at least ~60 mV per decade of current.

ZundamonQuestion

If it's not zero, is current leaking even when it's off?

Shikoku Metan

Yes. With billions of transistors on a chip, that adds up to leakage you can't ignore.

Shikoku Metan: Conversely, some ultra-low-power circuits deliberately use this tiny current.

9ID–VDS characteristics and the linear region

Shikoku Metan

Back above Vth. Now let's fix VGS and vary VDS.

Zundamon

It rises in a straight line at first, then flattens out.

Illustration: It rises in a straight line at first, then flattens out.
Figure 35

Shikoku Metan

As before, at small VDS, ID is nearly proportional to VDS, like a resistor.

Zundamon

Changing VGS changes the slope. It's like a variable resistor!

Shikoku Metan

Yes. This is called the linear region, or triode region.

10Pinch-off

ZundamonQuestion

So why does it flatten out partway?

Illustration: So why does it flatten out partway?
Figure 36

Shikoku Metan

As VDS rises, the gate-to-drain voltage VGD=VGS−VDS gets smaller.

Shikoku Metan: So the closer to the drain, the thinner the channel gets.

Shikoku Metan: When VGD drops below Vth, that is, when VDS exceeds VGS−Vth, the channel vanishes at the drain end.

Shikoku Metan: This is called pinch-off.

ZundamonQuestion

If the channel breaks, doesn't the current stop?

Shikoku Metan

It doesn't. A strong electric field sweeps the electrons across the short gap to the drain.

Shikoku Metan: The remaining channel largely sets the current, so the curve is nearly flat.

Illustration: The remaining channel largely sets the current, so the curve is nearly flat.
Figure 37

11Saturation and the voltage-controlled current source

Shikoku Metan

Back to the graph. Plot several curves with different VGS and you get this.

Illustration: Back to the graph. Plot several curves with different VGS and you get this.
Figure 38

Shikoku Metan

The boundary is VDS=VGS−Vth. Linear on its left, saturation on its right.

Try it yourselfID–VDS characteristics and the linear–saturation boundary

The dashed line marks VDS=VGS−Vth. To its right, ID changes only slightly. The remaining upward slope is due to channel-length modulation.

Zundamon

In saturation, ID barely changes even when VDS changes.

Shikoku Metan

And ID is set by VGS. That's the voltage-controlled current source from earlier.

ZundamonQuestion

So amplifiers use the saturation region?

Shikoku Metan

Exactly. We'll cover amplifiers properly another time.

Shikoku Metan: Look closely at the saturation region: the curves slope up slightly. That's channel-length modulation.

Zundamon

So it's not a perfect current source.

Shikoku Metan

Right. We'll look at that closely next time.

12Summary: three operating regions

Shikoku Metan

Let's sum up. A MOSFET has three operating regions.

Illustration: Let's sum up. A MOSFET has three operating regions.
Figure 39

Zundamon

Compare VGS with Vth, and VDS with VGS−Vth, and you can tell the region!

13PMOS and the CMOS inverter

ZundamonQuestion

So what is CMOS, the thing you mentioned at the start?

Illustration: So what is CMOS, the thing you mentioned at the start?
Figure 40

Shikoku Metan

To explain, let me introduce another MOSFET: the P-channel PMOS.

Illustration: To explain, let me introduce another MOSFET: the P-channel PMOS.
Figure 41

Shikoku Metan

In CMOS, the PMOS sits in an n-well inside the p-substrate, with n and p swapped relative to the NMOS.

Shikoku Metan: Pull the gate well below the source, and holes gather at the surface to form a conducting path.

Shikoku Metan: Because holes move less easily, a PMOS with the same W/L and the same voltage magnitudes carries less current than an NMOS.

Shikoku Metan: Its symbol has a circle on the gate. The source is usually drawn on top.

Illustration: Its symbol has a circle on the gate. The source is usually drawn on top.
Figure 42

Shikoku Metan

PMOS on top, NMOS below: top source to supply VDD, bottom source to ground.

Illustration: PMOS on top, NMOS below: top source to supply VDD, bottom source to ground.
Figure 43

Shikoku Metan

Tie the gates together as the input, and the drains together as the output.

Shikoku Metan: With 0 V at the input, the PMOS is on and the NMOS is off, so the output is pulled up to VDD.

Illustration: With 0 V at the input, the PMOS is on and the NMOS is off, so the output is pulled up to VDD.
Figure 44

Shikoku Metan

Input at VDD is the reverse: the NMOS turns on and the output goes to 0 V.

Zundamon

The output is always the opposite of the input!

Shikoku Metan

Yes. This is the inverter, the NOT gate of digital logic.

Illustration: Yes. This is the inverter, the NOT gate of digital logic.
Figure 45

Shikoku Metan

With VDD=1.8 V, sweep the input from 0 to VDD. The output changes like this.

Illustration: With VDD = 1.8 V, sweep the input from 0 to VDD. The output changes like this.
Figure 46

Shikoku Metan

In this example, the output switches sharply when the input nears 0.9 V, half of VDD.

Try it yourselfCMOS inverter: vary VIN

The PMOS has a larger W/L than the NMOS to match their current-drive parameter K. The size ratio is shown below the figure. At an input of 0 or VDD, one transistor is off and almost no supply current flows.

Shikoku Metan

To put the switching point right at VDD/2, this example makes the PMOS W/L twice the NMOS's, so the two devices conduct equally well.

Shikoku Metan: NMOS and PMOS work as complements: hence Complementary MOS, or CMOS.

ZundamonQuestion

What's good about one of them being off?

Shikoku Metan

With the input held at 0 or VDD, one device is off, so almost no current flows.

Shikoku Metan: So power consumption is low. That's why nearly all of today's ICs are CMOS.

Zundamon

So that's what "today's ICs are CMOS" meant at the start. I finally get it!

Illustration: So that's what "today's ICs are CMOS" meant at the start. I finally get it!
Figure 47

14Next time

Shikoku Metan

Next time: that slight upward slope we saw, channel-length modulation.

Illustration: Next time: that slight upward slope we saw, channel-length modulation.
Figure 48

Zundamon

I'm getting it! Thanks for reading, nanoda!