TRANSCRIPTEnglish

How do Transistors Build into a CPU? 🖥️🤔 How do Transistors Work? 🖥️🤔

26m 45s3,882 words238 segmentsEnglish

FULL TRANSCRIPT

0:00

Inside your computer are dozens of microchips with tens of billions of transistors. You may know that

0:06

these transistors are the cornerstone of all technology, are manufactured in

0:11

multibillion-dollar factories, and are only a few nanometers in size. But what you may not know is

0:19

that this network of billions of transistors is actually organized a lot like Lego bricks

0:25

connected together in order to build a Lego set such as this 7541-piece Millennium Falcon.

0:33

In this video, we’ll explore how the transistors inside your computer are like Lego Bricks,

0:39

what transistors actually look like, how they perform basic logic, and finally, how 26 billion

0:47

transistors are organized into the different sections of the CPU. So, let’s dive right in.

1:02

This video is sponsored by Brilliant.org. Let’s begin with exploring Lego Bricks and

1:09

Transistors. In this analogy, we’ll equate one transistor to a single stud on a Lego brick. On

1:16

their own, neither one does much at all. However, when a few transistors are connected together they

1:22

form a standard cell which is the fundamental building block of every CPU and GPU. Similarly,

1:30

multiple studs form a Lego Piece which is the building block for all Lego creations.

1:36

For example, two transistors connected together form an inverter standard cell,

1:42

4 transistors connected together form a NAND Gate, and 6 transistors form an OR gate.

1:50

There are many other standard cells built by connecting transistors together, and similarly,

1:56

there are a wide range of Lego Pieces with varying numbers of studs and shapes. But

2:02

before we explore some of the more complicated standard cells, we first need to understand how

2:08

one of the simplest standard cells works. Let’s examine the inverter which is analogous to a

2:15

one by two Lego brick. Its function is simply to take an input of a 1 and output a 0 or vice

2:23

versa. This inverter has a logic symbol like this, and the standard cell look like this.

2:30

Essentially standard cells like this inverter, are the real-world physical structure of a logic gate,

2:37

and it’s what you would see if you could open up and zoom into a nanoscopic view of the processor

2:43

in your smartphone. So let’s see how it works. At the bottom of the standard cell are two

2:51

transistors built on top of a silicon base. We’ll focus on one of these transistors which

2:56

has been simplified a little bit for the sake of this explanation. Inside this transistor are

3:02

a few key parts: the gate, the channel, and the dielectric which is a barrier that separates the

3:08

two and prevents electricity from passing through. Additionally, on either side of the channel and

3:14

above the gate are metal contacts connected to vertical vias that are used to input and output

3:20

electricity to the corresponding parts. So how does this transistor work? Well,

3:26

when 1 volt is applied or input to the gate, electricity is able to flow through the channel,

3:33

essentially connecting one side of the channel to the other side. However, when 0 volts is applied

3:40

to the gate, electricity cannot flow through, resulting in electrically separating or isolating

3:46

the two sides of the channel. A quick analogy is to think of the channel and gate as a water

3:52

faucet and handle. When the handle is turned on, water can flow and when the handle is turned off,

3:59

the water is stopped. The name of this transistor is an N-Type FinFet due to its fin-like shape.

4:07

Here’s the symbol for a simple N-Type transistor, and again, when 1 volt is applied to the gate,

4:13

electricity can flow through the channel. Let’s bring in a second transistor over here

4:19

which is the same FinFet shape, but functions a little differently and is called a P-Type

4:24

transistor. Specifically, it’s designed to operate in the exact opposite fashion where, when 1 volt

4:32

is applied to the gate, electricity cannot flow through the channel, and when 0 volts is applied

4:38

to the gate, electricity can flow through. Using our water faucet analogy from before,

4:44

this transistor is like a faulty water faucet where, when the handle is down the water is on,

4:50

and in order to turn the water off, you have to actively lift the handle. This is the symbol for

4:57

the P-Type transistor, and the circle on the gate indicates the inverted functionality.

5:03

Now that we have two transistors, one N-Type and the other P-Type, let’s connect the gate between

5:09

the two of them and merge the input gate contacts together into a single contact. As a result,

5:16

a single input voltage on the gate, which can be either one volt or zero volts,

5:21

travels to the shared gate and controls both of the transistors. Because the N-Type and P-Type

5:28

transistors are opposite of each other, when 0 volts is applied to the gate, the P-Type will

5:34

allow electricity to flow through the channel and is considered ON and the N-Type will be OFF. And

5:41

then, when 1 volt is applied to the gate, the N-Type and P-Type FinFets flip to ON and OFF,

5:49

and the N-Type allows electricity to flow through while the P-Type doesn’t.

5:55

The next step is to bring in the power and ground rails above the transistors. The power rail is

6:01

at 1 volt, and the ground rail at 0 volts, and they always stay at 1 and 0 volts. Next,

6:09

we add some wires to the design, and to do that we use the contact points and build

6:15

vertical vias that connect both sides of the transistor along with the power rails to a

6:21

layer of wires called local interconnects. The power rails, vias, and interconnects are

6:28

simply wires made from conductive metals such as copper, tungsten or aluminum,

6:34

and just carry electricity around in intricate paths of wires. Let’s add a label for the input

6:41

which is the electrical wire that connects to the shared gate, and a label for the output over

6:47

here which connects to the local interconnect wire attached to a side of each of the two transistors.

6:53

Now that we have a complete standard cell, what happens when 1 volt is applied to the input?

7:00

Well 1 volt travels down to the shared gate that controls both of the transistors, and as a result,

7:07

the N-Type transistor turns On, and the P-Type transistor turns Off. With the N-Type transistor

7:15

on, electricity can flow through its channel which results in 0 volts from the ground rail traveling

7:22

through the local interconnects, down a vertical via, through the channel of the N-Type FinFet,

7:28

then back up a vertical via on the other side, across a separate section of local interconnects,

7:35

and finally to the output. Thus the input of 1 volt results in an output of 0 volts.

7:43

At the same time, because the same 1-volt input controls the P-Type transistor which is OFF,

7:49

no electricity flows through it, and this section of wire is isolated.

7:55

So then what happens when 0 volts is applied to the input? Well, the opposite happens. The

8:02

P-Type transistor turns ON, and the 1-volt rail is connected through the local interconnect wires

8:08

and vias, through the P-Type’s channel, back up a vertical via, and to the output, thus turning a 0

8:16

into a 1. At the same time, the N-Type transistor is off and this section of wire is isolated.

8:24

One thing to note is that while these wires may look like they’re floating 3 dimensional

8:29

structures, all the empty spaces are in fact filled with insulating material called dielectric.

8:37

This may have been a rather long explanation, but truly understanding the basic function

8:43

of the inverter standard cell is critical to understanding the more complicated ones such as

8:49

this NAND gate, this AND gate or this Exclusive OR gate, which we’ll discuss in a little bit.

8:57

Let’s now take a second and discuss some of the details that might be taught in an

9:02

electrical engineering course. Here’s the symbol for an inverter and its logic table, and again,

9:08

an input of a 1 outputs a 0 and vice versa. Next, here’s the schematic where you can see the 1-volt

9:16

power rail above and the 0-volt ground rail below, and here are the two simplified transistors with

9:24

the bottom one N-Type, and the top one a P-Type. The input to the gates is connected together,

9:30

however, we typically break them apart and label them with the same input name. Next,

9:37

the output is positioned in the middle of the two transistors. As a result,

9:42

when 1 volt is applied to input A, the output is connected to the ground rail, and when 0 is input,

9:49

the output is connected to the power rail. Now that we’ve thoroughly explored this inverter,

9:55

let’s dive into some of the more complicated standard cells such as these NAND and NOR

10:01

gates with 4 transistors, the AND and OR gates with 6 transistors, and the Exclusive OR and

10:09

Exclusive NOR gates with 10 transistors inside of it. First however, let’s continue discussing

10:15

how standard cells are like Lego Bricks. As mentioned earlier, there is a wide range

10:21

of standard cells built by connecting together different numbers of transistors using the

10:27

local interconnects, and similarly, there’s a wide range of Lego pieces built by connecting different

10:34

numbers of studs in varying configurations. So to continue our analogy, if a Lego stud is an

10:41

individual transistor, and Lego bricks and pieces are standard cells, then the equivalent to a Lego

10:49

Set is a Macrocell. For example, here are 350 Lego Pieces used to build a Starfighter Lego Set,

10:58

and likewise, here are approximately 160 standard cells connected to form a Macrocell that can add

11:06

two numbers together. In order to connect each of the 160 standard cells together,

11:13

a higher layer of vertical vias and wires, called Metal 1 or M1, is used. When we zoom

11:21

in we can find the individual standard cells all fitting between multiple rows of the 1 volt power

11:29

and 0 volt ground rails. As you may have figured out already, this circuit uses binary 1s and 0s,

11:38

and the input numbers that are added together are sent to this Macrocell using 1 volt or 0 volt

11:45

on these 2 sets of 32 wires, and then the binary output is carried along these 33 wires over here.

11:54

Let’s continue this analogy further. Just like there are thousands of different Lego Sets,

12:00

there’s a wide range of different Macrocells, some having thousands upon thousands of standard

12:07

cells inside of them. For example, a more complicated function is multiplication

12:13

which takes in two numbers, multiplies them together, and then outputs the result. However,

12:20

to perform multiplication, we need a much larger Macrocell, such as this one which

12:26

is built from 6,100 standard cells. The complexity of the 32-bit multiplication

12:33

Macrocell is similar to the complexity of this Millennium Falcon Lego set built from around

12:40

7500 Lego Pieces. One note is that Macrocells are also called Modules, Functional Blocks,

12:49

Functional Units, or just Blocks or Units. So now that we’ve seen a couple Macrocells,

12:56

what’s the next step up? Well, multiple Macrocells are combined into an IP Core,

13:02

and then multiple IP cores are combined into a Core or hardware accelerator, and these elements

13:09

are then combined into a complete chip such as this processor, which can be found inside this CPU

13:16

package mounted onto a motherboard. Processors are incredibly complicated with tens of billions of

13:23

transistors inside of them. So here’s a little bit of insight into how they work, again using Lego.

13:30

Lego pieces are pretty simple objects. For example, this pile of Lego bricks may hurt

13:37

when you step on it, but overall it isn’t that interesting or impressive. However,

13:42

when you meticulously assemble thousands of Lego Pieces together, you can build an impressive Lego

13:49

creation. Likewise, an individual transistor might seem pretty mundane, and a standard cell or a

13:56

basic logic gate that can only flip a 1 to 0 isn’t all that useful on its own. However, the key is

14:04

that when you have tens of thousands of scientists and engineers assembling billions of standard

14:11

cells and logic gates together in what can be thought of as a multi-billion-piece Lego set,

14:17

well then, we get an integrated circuit capable of browsing the internet, playing YouTube videos,

14:24

or running video games with incredible graphics. By the way, thus far, we showed you the local

14:31

interconnect layer for the standard cells and one metal layer called M1 which is

14:36

used to build small Macrocells. In fact, CPUs use around 17 metal layers of wires

14:44

connected together to form the Macrocells, IP cores, Cores, and other sections of the CPU.

14:53

CPUs are incredibly powerful devices, but when you boil them down, it’s just a bunch

14:59

of transistors and logic gates connected together using kilometers of wires. Throughout this video

15:06

we’ve assumed that you have a basic understanding of logic gates, but if you want to learn more

15:10

about how logic works, we recommend you check out Brilliant.org, the sponsor of this video.

15:18

Brilliant is an educational platform with thousands of interactive lessons in math,

15:23

science, programming, data analysis, along with two courses on logic. Brilliant’s mission is to

15:30

create a world of better problem solvers, and every one of their courses is crafted

15:36

with a hands-on problem solving approach that helps build understanding from the ground up.

15:42

We love to use Brilliant because each of their lessons is only 10 minutes long and their entire

15:48

catalog can be accessed using the Brilliant app on your phone. Learning a little every day is one

15:54

of the most important things you can do, both for your career and for your mental health. Consider

16:00

this, if you were to use the Brilliant app instead of mindlessly scrolling, in a couple weeks you

16:07

could build an in-depth understanding of how AI and Large Language Models work, and then after

16:14

that you could, for example, learn how to program in Python, or see how Quantum Computers work.

16:21

With each lesson only 10 minutes long it’s a no brainer that you should delete addictive

16:26

and time wasting apps, and learn something new using the Brilliant app on your phone.

16:32

You can sign up for free using the link: Brilliant.org/BranchEducation and for a

16:38

whole month you’ll have full access to their entire catalog of courses. If you like their

16:44

content and decide to stick around, the link will also save you 20% off an annual subscription. You

16:51

can also find this link in the description below. So let’s get back to exploring some of the more

16:59

complicated standard cells. Specifically we’ll start with this NAND gate, then the AND gate,

17:06

and then discuss the other types of logic gates. This NAND gate performs the logic of AND followed

17:13

by a NOT. Using the Lego analogy, the NAND gate would be equivalent to a 2 by 2 Lego brick. We’ll

17:20

move a little bit faster than our explanation of the inverter and start with the logic symbol,

17:26

truth table, and schematic. To build a NAND gate we use two P-Type transistors in parallel above

17:33

and two N-Type in series below. The two inputs for the NAND gate are connected to one of each

17:40

of the transistor’s gates, and the output is in the middle of the channels. In order for the

17:45

output to be a 0, both of the inputs need to be ones, thus turning both N-Types on and creating

17:53

a path from the ground rail to the output. For the output to be a 1, we need either or both of

18:00

the P-Type transistors to be on, thus creating a path from the 1-volt power rail to the output.

18:07

Let’s see how we turn this logic into a physical standard cell. Here are the two

18:12

P-Type transistors above, and the two N-types below, as well as the power and ground rails.

18:19

To control these transistors the two inputs, labeled input A and input B, are connected

18:25

to the center of each of the gates which span across one set of N-Type and P-type transistors.

18:32

In order to build the P-Type transistors in parallel, we connect the power rail to one

18:38

side of each of the transistors, and the output is connected in the middle. You can see that when

18:44

either or both of these P-Type transistors is ON, which happens when a 0 is applied to either of

18:51

the inputs, then the 1-volt rail is connected through that P-type transistor to the output.

18:57

As a result, an input of 0 0, 0 1, or 1 0 yields an output of a 1. And again, these transistors

19:11

are in parallel because either or both need to be on for 1 volt to travel to the output.

19:18

Next let’s look at the N-Type transistors which are placed in series with one another. To build

19:24

this, the ground rail is connected to one side of both of the transistors,

19:29

and the output is connected to the opposite side. Therefore, for 0 volts from the ground

19:34

rail to travel through these transistors, both N-types need to be ON, which happens when both

19:41

N-Types are connected to 1 volt. Thus an input of 1 1 yields an output of a 0. Again, these

19:50

transistors are in series because both need to be turned ON to allow electricity to flow through.

19:57

One note is that thus far we’ve been showing the power rail above and the ground rail

20:02

below. However, in the addition Macrocell we showed earlier, the power and ground rails are

20:08

alternated, and therefore half of the standard cells have the power rail below and the ground

20:14

above. To accommodate this, the standard cell is flipped around with the P-type transistors

20:21

on the bottom and the N-Type on Top, but it still works the same way, and if we rotate

20:28

the camera, well, it looks the same as before. We’re going to get to the other logic gates in a

20:34

second, but first we want to say that this video’s script was actually one of the hardest to write.

20:41

In the first 28 drafts of the script, we were trying to explain how standard cells work and

20:48

how logic gates are used to multiply two numbers, which looks like this. However, we decided to move

20:53

the lesson on how logic gates perform math into an entirely separate video and focus this video on

21:00

the design of standard cells. As a result, this video has taken close to 54 script revisions,

21:09

and 6 times I just threw out large sections and restructured the whole script. So, we have

21:16

one ask from you the viewer: if you’ve enjoyed watching this video and learned something new,

21:22

could you take just a few seconds to write a quick comment below, subscribe to the channel,

21:29

like this video, and most importantly, share it with a friend, family member, or colleague.

21:36

We would greatly appreciate it. Thank you. Let’s next take a look at this AND gate.

21:44

Here’s the schematic along with the logic table. Essentially an AND gate is a combination of a NAND

21:50

gate with an inverter tacked on. Let’s take a look at the standard cell. Here you can see the NAND

21:57

gate with two inputs, and the output of the NAND gate being carried to the input of the inverter,

22:03

with the overall output right here. As a result, when we input two ones, the output is also a 1,

22:12

however if either or both inputs are 0s then the output is a 0. The NOR and OR Logic gates use very

22:21

similar setups to the NAND and AND cells. A NOR gate is simply a NAND gate, but with two P-Types

22:29

connected in series and the N-Types in Parallel. And then an OR gate is a NOR gate with an inverter

22:37

tacked on. Pause the video to work out the logic. Exclusive Or and Exclusive NOR gates are a little

22:45

more complicated and require a total of 10 transistors each because the logic needs to

22:52

account for only one of the inputs being on. Here is the standard cell for an Exclusive OR gate.

22:59

We’ll spend a few seconds flying around it and showing the different layers, so see if you can

23:05

draw a schematic and work out how it works. Next, here’s the corresponding schematic.

23:15

And then here’s what it looks like with an input of 1 and 0.

23:22

And then here it is with an input of 0 and 0 and then an input of 1 and 1.

23:29

When we look at an Exclusive NOR gate we can see that it’s rather similar,

23:34

just with the series and parallel n-type and p-type transistors flipped around.

23:40

So one question is: How do we make an AND gate with 3 inputs? What about

23:46

an exclusive OR gate with 4 inputs? Let’s end this lesson by discussing a

23:52

few important technical details and notes. The first is that this circuit is called a

23:57

complementary metal oxide semiconductor or CMOS circuit. This is due to the two types

24:04

of transistors, N-Type and P-Type functioning opposite each other. These circuits have a high

24:10

noise tolerance, and low power consumption because one of the pairs of transistors is always off,

24:16

and, if designed correctly, there is never a path between the 1 volt rail and the ground rail.

24:23

The second note is that although the explanation for how an inverter works took around 10 minutes,

24:30

in actuality it physically takes just a few picoseconds or 10 to the negative 12 seconds

24:37

between the input changing from 0 to 1 volt to the gates and then for the transistors to

24:43

change their states, and then for 0 volts from the ground rail to travel to the output. With

24:50

each standard cell taking a few picoseconds to complete its logic, the multiplication macrocell

24:57

with over 6000 standard cells takes around 150 to 200 Picoseconds between the inputs

25:05

coming in and all the standard cells completing their logic and changing their states to yield

25:11

the correct value on the output wires. The third note is that transistors are

25:17

incredibly complicated. For example, most finfets are built from multiple fins in order to improve

25:24

electrical characteristics. If you’re wondering how transistors are made or how they work, well,

25:30

we’re planning multiple videos that will explore transistor manufacturing,

25:35

transistor physics, why CMOS circuits use P-Type transistors above and N-Types below,

25:42

and the evolution and future of transistor design. Subscribe so you don’t miss it.

25:49

The final note is that we’d like to give a shoutout to Matt Venn,

25:53

who was vital in helping us get these accurate standard cell layouts. He runs the Zero to ASIC

26:00

Course YouTube channel and we recommend you check it out if you want to learn more about

26:05

integrated circuit design. Additionally, he runs a service called TinyTapeout which allows

26:11

you to manufacture your own integrated circuit. We’re thankful to all our Patreon and YouTube

26:18

Membership Sponsors for supporting our videos. If you want to financially support our work,

26:24

you can find the links in the description below. This is Branch Education, and we create 3D

26:31

animations that dive deeply into the technology that drives our modern world. Watch another Branch

26:38

video by clicking one of these cards or click here to subscribe. Thanks for watching to the end!

UNLOCK MORE

Sign up free to access premium features

INTERACTIVE VIEWER

Watch the video with synced subtitles, adjustable overlay, and full playback control.

SIGN UP FREE TO UNLOCK

AI SUMMARY

Get an instant AI-generated summary of the video content, key points, and takeaways.

SIGN UP FREE TO UNLOCK

TRANSLATE

Translate the transcript to 100+ languages with one click. Download in any format.

SIGN UP FREE TO UNLOCK

MIND MAP

Visualize the transcript as an interactive mind map. Understand structure at a glance.

SIGN UP FREE TO UNLOCK

CHAT WITH TRANSCRIPT

Ask questions about the video content. Get answers powered by AI directly from the transcript.

SIGN UP FREE TO UNLOCK

GET MORE FROM YOUR TRANSCRIPTS

Sign up for free and unlock interactive viewer, AI summaries, translations, mind maps, and more. No credit card required.