 Hi, today we're going to start with talking about PMOS and PMOS logic. So PMOS, unlike NMOS, looks like this. And so in keeping with sort of the PNP transistor idea, so we have a gate here and then we have the drain is up here and the source is over here. And the threshold voltage, no I got this backwards, source, drain, yes, okay. So the threshold voltage VT is typically less than zero because this is a P channel MOSFET so everything is reversed effectively. So that means that the voltage between gate and source has to be greater than this threshold voltage. So for example, if we had a MOSFET, a PMOS that was connected up here to VDD say, even though it's source anyway, and we have a resistor here and we have an LED over here. So the question is what gate voltage do we have to apply to the MOSFET to turn it on and off? Well, to turn it off, just like with the NMOS, to turn it off you basically connect the gate to its source so that VGS is zero. So of course that's greater than the threshold. Now to turn it on you would connect the gate to ground and if you connect the gate to ground then VGS and because the polarity is plus here and minus here, that means that VGS would be minus VDD. In a lot of the equations for PMOS you often see VSG so that you don't get the negative sign. VSG is VDD. So because VGS is less than the threshold that will turn this on. So let's actually try this circuit. So again, when the gate is ground or zero that means that the transistor is on which means that current will flow from VDD to through the LED so that means that the LED is on so that's a one so again this is an inverter it's just using PMOS and if you'll notice the difference between this and an NMOS circuit the NMOS circuit looked like this with its source connected to ground or to put it another way the load resistor is on the top while the transistor is on the bottom whereas with PMOS logic it's completely different it's the opposite where the load resistor is at the bottom and the transistor is at the top. So let's go breadboard this breadboard now I have somewhere here yes I built this okay this is the dual PMOS circuit dual PMOS which is this one over here so you can see that it is a six pin package because it's got three of because it's got two MOSFETs and I have here slightly better pinout okay and the nice thing about this is that you can turn it around and because it's completely symmetrical it doesn't matter which way you flip it around so I've got my PMOS is here so I'm just going to whack that in and let me go grab the circuit again and maybe put this underneath as well let's try that okay so the first thing that I'm going to need is the LED and the resistor so here's my LED so the LED goes to ground and then I have a resistor and the resistor goes to the terminal without the arrow so we can let's see okay so this resistor is closest maybe to this transistor over here so I'm just going to use these upper two terminals and this lower terminal so I connect the resistor between the LED and this terminal right over here okay the gate is up here so there was the gate I'm going to connect it to ground for now and let's see what else oh and we have to make the connection to VDD so I'm going to take the terminal with the arrow and connect it up to VDD so that's this terminal right over here okay so if everything is as expected this should be an inverter which means that if I input is zero I should get out a one so I'll turn on the power supply and sure enough the LED is on and if I connect it now to plus the LED is off so there you go there's an inverter and just like with the NMOS we're seeing this charge effect where the gate is still charged up and you can see that the gate actually lost its charge look at that that's kind of interesting so the charge actually leaked away okay so there it is there is the inverter and of course you know just very similarly you can make all the different gates because once you have an inverter you can put two of these together well let's actually draw that out maybe actually build it so suppose we have here is turn off the power supply so here is gate one and here is gate two and here is our output okay so clearly only when both transistors are on is the LED going to light the way to turn the transistors on is to connect their gates to ground so zero zero one if any one of these is off in other words if any one of the gates is connected to VDD then the LED is going to be off off off off and again we get our in this case we have a NOR okay so that's interesting because whereas when we had the NMOS circuit with two transistors in parallel and there's our load this was an AND gate an AND gate when you use parallel PMOS transistors that gives you a NOR gate and likewise when you parallel PMOS transistors that will give you the NAND gate so in effect when you're going from NMOS to PMOS a series set of NMOS transistors is equivalent to a parallel set of PMOS transistors when we just draw out the parallel PMOS just to show that this is actually true there's one gate there's the other gate gate one gate two there's the output so again gate one gate two output so how do we turn this transistor on how do we turn the LED on well one of the transistors has to be on the transistor is on when the gate is grounded so zero zero zero one one zero one one one zero one one so if any one of the gates is grounded that means that any one of the transistors is on right and that means that this is the only condition where the LED is going to be off is when both transistors are off and that's of course an AND gate so you can see that series NMOS transistors when you go to PMOS become parallel PMOS transistors and the opposite is true that when you have parallel NMOS transistors you end up with series PMOS transistors and this is going to be important because we're going to look at CMOS logic next that's complementary MOS which means that it uses both NMOS and PMOS so why would we use both NMOS and PMOS well the basic problem is that first of all when you have let's just go back to NMOS for a moment oops here is the thing VDD here is our LED or it can be you know going to another part of the circuit well when you fabricate an integrated circuit resistors are really huge basically in an integrated circuit you've got choices between types of wires that you use and a wire can be made out of metal or it can be made out of diffused silicon and diffusion is also used to make transistors but if you just have you know a long a long trace of basically diffused silicon that also acts as a wire you've also got the possibility of polysilicon that's another conductor so in any case in order to make a resistor basically you need to make long lengths of these and you know maybe in integrated circuits you might see something that looks like this you know and it goes around and you know maybe it even goes around over here and the reason that they do that is to make a resistor but you can see that that takes a lot of area whereas making a transistor only requires having a small trace of diffusion and then an insulator going to a gate and that's a MOSFET so because the area is so large you can actually create a transistor instead of a resistor and you specifically for NMOS circuits you would create an NMOS that is connected to VDD remember this is going to be like the resistor and here's our other NMOS going to ground and here is the output so this is going to be an inverter so the question is well what do we do with this gate and in fact what you do is you connect its gate to its source and you might be saying well wait a minute that turns the transistor completely off because the voltage because the the VGS over here is definitely less than the threshold voltage well that's why you use a special it's called a depletion mode MOSFET and a depletion mode MOSFET is specifically for we're talking about NMOS where its threshold is actually less than zero so in other words with this connection VGS is zero and it is greater than the threshold voltage which means that for this depletion mode NMOS this is actually on and when it is connected like this it basically acts like a resistor except of course it takes up a lot less area so for example here is the diffusion here is our insulator say over here and say this is connected to VDD right over here and this terminal over here is the source but it is connected to its gate so you might see something like that with kind of a little hook over here and then this goes off to the rest of the circuit so this is really small as opposed to you know that crazy little zigzag sort of thing so that that is how in purely NMOS circuits you fabricate resistors in an integrated circuit now I don't have any depletion mode MOSFET so we can't really experiment with this and I don't really want to so let's talk about CMOS or complementary MOS now one of the problems with a circuit like this this is our inverter circuit with this depletion load is that when this transistor is on connecting the output to ground there is current flowing from positive to negative through this resistor effectively now the other thing the other problem with that is that not only is their current flowing through when this transistor is on but also because the output typically goes to another MOSFET there's basically a capacitor here this is the gate capacitance so when you want to when you want to connect this gate to VDD well it's going to have to do so through a resistor and a capacitor which means that you have a time constant so that instead of a nice sharp or relatively sharp waveform like that the waveform is going to take a little while to go up to VDD now you could solve that I suppose by putting a very small resistor over here but of course that still doesn't get around the first problem which is where if this bottom transistor is on then it's shorted to ground and that means that you've got a very small resistor between your power supply and your positive power supply and ground that means that you're going to get a huge amount of current and if you've got say a square wave going through here that means that you've got a huge amount of current going through half the time which is a a waste of power and b because it's going to be so much current because you wanted this time constant to be so small you're going to waste a lot of power in this MOSFET and the MOSFET could blow up so what if we could create a circuit where there's nothing connected to VDD when this transistor is on and in a complementary sense when this transistor is off there will be nothing connected here and there will be something connecting VDD to the output and the answer is CMOS here's CMOS so what I've done is I've drawn a PMOS transistor up here and an NMOS transistor down here and they serve complementary functions their gates are connected so let's see what happens when the gate is connected to ground well if the gate is connected to ground then the bottom transistor is definitely off and the top transistor is on which means that we will have a connection between VDD going through the resistor and the LED so when the gate is at ground the output is at one now if the gate is connected to plus that means that the bottom transistor is on but the top transistor is off which means that this is purely connected to ground but there's no current flowing through so the gate is one and the output is zero so again this is an inverter except you can see that in neither state will there be current flowing through this bottom transistor now of course we've got current flowing through the top transistor because in effect this is an output transistor so it goes to something that actually demands current but if this were to go to another MOSFET well then the only current that would flow is the current required to turn on or to charge up the gate and then of course the gate is charged and then no more current will flow so that means that you will only be passing current through these MOSFETs in the small transition between states so for example if we had the gate going like this say then the current would look something like this okay and this is you know maybe current going through the top MOSFET and current going through the bottom MOSFET so this is to charge up the gate of the next stage and this is to discharge the gate on the next stage with NMOS okay so if this is the gate here we have the the here we have the LED is going to be on and here we have the LED is going to be off well if the LED is on then if the if the LED is off so we have the gate being high that means that and again let me just draw the circuit over here right so if the LED is off that means this transistor is on which means that there's current flowing through from plus to minus which means that when it's on the current through the MOSFET is also something like that so you can see that the amount of power used by CMOS is a lot less than the amount of power used by NMOS so let's actually build this circuit and see what happens so I've got my breadboard over here I already have the NMOS hooked up so now let me go get the PMOS this is the this is the PMOS right over here so I'm going to hook that up yep new breadboard let's go ahead and open up the leaves okay so all right and I also have these two pinouts okay so let's see what we need first okay so first what we need is to pull everything off okay so we are going to want to take the NMOS and connect it kind of like we did before except that this resistor doesn't go to plus it goes now between the output and the LED so I'm going to take the LED and I'm going to put it say in between okay so I'm going to use say this transistor over here as the NMOS which means that this leftmost terminal needs to be connected to ground so I'll do that okay the gate first of all is going to be our input and second of all the gate must also be connected to the gate of one of the PMOS's and I'll use this these two terminals over here so I need to connect to the middle terminal over there all right so that's our gate I'll connect it to ground all right and now what do we need to do well we need to take the resistor and connect it between the LED and first of all the drain of NMOS so this is the drain of NMOS right here I'm going to connect this resistor up here and then use a I'll just use a wire to connect it to the LED actually you know what what I'll do is I'll connect the top rail to ground oops I'll connect the top rail to ground there now I have ground available at the top so I'll take my resistor and connect it to ground through that resistor okay and let me see what's next okay now I need to connect the the drain of PMOS to VDD so I'll use a wire for that so here's the PMOS here is the drain I'll connect that to plus and let's see the gate's connected and finally I need to connect the output oh well what I can do is I could just move this over and first of all do that okay yeah that that that's not going to work okay I messed that up sorry my bad so I'm going to take a wire and connect the sources of these so there's the source of the NMOS and here's the source of the PMOS and then I'm going to take the resistor and connect that there and the LED to ground all right so this wire is the connection between the two gates this wire is the connection between the two gates and this is my input right here I don't need that ground wire anymore this yellow wire is the connection between the two sources and I have the resistor and the LED going in series to ground and finally I have the drain of or yeah sorry the source okay so the two drains are connected over here the source of the PMOS connected to plus and the source of the NMOS connected to minus so let's fire this up now because this is an inverter so I'm connected to ground which means that I expect the LED to light up and it is and now if I connect it to plus the LED is off so that works great now one of the disadvantages of a circuit like this is that it's all right it's all well and good if the ground if the gate is going to be connected to either ground or VDD because then one of the two transistors is definitely off the problem is what happens if the gate is somewhere in between well if it's somewhere in between like say half of VDD well then definitely the bottom transistor is on and also definitely the top transistor is on and usually the the on resistance of these transistors is very low so you're going to have a very low resistance between the two uh between positive and negative and that's really no good because then you're going to get a huge amount of current flowing so in fact if we look at our current diagram what's good is if you have a nice sharp transition like this what's bad is if you have a transition like this because now all of a sudden you're going to have a huge amount of current flowing through here until both transistors turn off or one of one or the other transistor turns off and again the same thing over here so that's why you don't want to run CMOS with these low rise and fall times you want to have very sharp rise and fall times so one experiment I suppose that I could do it well which I don't really want to do is connect the gate up to I've got five volts over here connect the gate up to two and a half volts but if I do that then basically I will be blowing apart my MOSFETs why well let's take a look at the typical on resistance of what is this the n channel okay so let's go find the on resistance at VGS is say 4.5 fine whatever it says four ohms okay so that means that this transistor here would be four ohms and if we look at the PMOS which I have over here here's the PMOS you can see that the RDS on is 1.2 ohms doesn't say what the VGS is but let's just take that as given 1.2 ohms so I've got 5.2 ohms across here now let's call that five ohms which is convenient because VDD is also five volts so of course five volts through a five ohm resistor is one amp can these transistors take one amp no they cannot this one can only take 390 milliamps that's the positive that's the PMOS and the NMOS can only take 300 milliamps which means that if I really were to connect this gate to two and a half volts then I would blow apart my MOSFETs and I'm not really willing to do that because I went through the effort of mounting this package onto two nice breakout boards and I've also got two MOSFETs in each package so I basically be wasting a lot of time and effort and money so I'm not going to do that sorry okay so that's pretty much a CMOS inverter now let's talk about a CMOS NAND gate okay so here is my previous diagram of the NAND gate so you can see that we've got two NMOS transistors in series so two NMOS transistors in series and there's our output now remember I showed that the opposite of an NMOS series is PMOS parallel so this in effect is the opposite circuit VDD and now of course we need to connect the gate of each pair together like that so there's gate one and there's gate two and there's the output which we will connect to an LED okay so this is a complementary NAND gate so the idea here is that if both of these transistors are on and again the only way for both of these transistors to be on is for both gates to be at plus so if both of these transistors are on and the both gates are at plus then that means that both of these transistors are off so you can see that when all of these transistors are on all of these transistors are off now when one of these transistors is off or both then there's no current flowing through here so that means that the bottom circuit is off which means that in the complementary sense the top circuit needs to be on which is true because when any one of the gates is grounded one of these is off one of these is on and current is going to flow so basically the top part is the opposite of the bottom part and that's the NAND gate so we can go and build this and because there are so many connections over here I'm going to stop and then present the final circuit and here's the final circuit I'm not going to bother going through this rats nest of wires but basically it's hooked up exactly like this so I have connected these two wires these are the gates and I've connected them both to ground so of course only if both wires are connected to plus will the output be off so I expect the LED to be on and sure enough it is and if I move one of these connectors to plus of course the LED is still on and if I move the other connection to plus the LED goes off which is as expected and then if I move this back ah there's that little charge effect going on on off so this is definitely a NAND gate so and of course I had to use both of my packages here so 2MOS, 2NMOS, 2PMOS and that's a CMOS and gate and the nice thing is that this uses no power in either mode with the exception of you know any output but again if this were to go to another stage then once that stage's gates are charged up no current is being used up at all in any state which is great so that's CMOS I think that's probably most of what I wanted to go over for the MOSFET series I may talk a little bit about my findings in reverse engineering some integrated circuits through their dye photos and what I found in terms of MOS circuits like this and maybe I'll talk about that but I guess until then until the next video I'll see you bye