at the core of every computer are devices that actually perform the computations in most modern computers we either use nmos and P transistors as the base of most of our operations and in this lecture we'll be focusing on how we use these two gate or transistors to create logic gates now this is the OS transistor itself inside the circle and we have some conventions of how we use it so we connect this lower terminal terminal two to ground it's sufficient just so you know that this is the convention and you can explore why in future
courses and then we have a gate which is our inputs and that's how we control the transistor from our perspective and that'll be a zero or a one and then this terminal one connects to other Gates or the output of our logic gate and then we've got our posos transistor over here which behaves in an opposite fashion we have our our transistor here and notice this little symbol that tells us this is the P Moss transistor and we connect terminal one here to this high voltage vdd which is usually like about one volt but that's
going to be vary based on the technology and then we have our input gate which allows us to control this transistor and then Terminal 2 connects out to other circuits or other logic gates and so how do we actually make these work and what do these actually do and so basically a transistor is a electrically controlled switch if we put a one in or a high voltage the N Moss becomes a closed circuit whereas the PS becomes an open circuit and if we were to switch which oh let's explore this a second longer so when
this is closed or shorted there's a direct path from ground up to here so basically our output terminal has a zvt output whereas this guy since there's a an open circuit there's no current or anything going through this and so this is just basically a dangling wire there's nothing there it's nothing not connected to anything however if we switch our inputs the entire Behavior changes our n MOS becomes an open and our P mooss becomes a short and so now there's a direct path between our output and vdd so now this is going to be
our high voltage vdd and we can keep altering these behaviors we can alternate them between zero and ones and because they have opposite functionality we call them complimentary and um complimentary Moss or c moss is how we talk about n moss and P Moss as a group and any other type of logic that has a similar functionality the amazing thing is that we can use just a posos and an nmos transistors to create any circuit and so here we have a notot gate and we'll show you how this works if we have an input of
zero our P type is going to become a short and directly connect the output to vdd so when our input is 0 volts our output is going to have vdd volts which is a logical one on the other hand this this nend type is going to be open so there's no connection between our output and ground for if we input a one or vdd volts we have a direct path between ground and the output so our output is going to have zero volts and be a logical zero and our P type is going to become
an open so there's no connection between vdd and the output and so this is how we build our not gate which has this symbol when we build more complicated or complex digital logic circuits it becomes important to notice there's another part of what makes these guys complimentary so down here nmos transistors are connected in series that means the outp output of one is connected to the terminal of the other whereas our PS up here are connected in parallel where both of their outputs are connected together and they're both connected on their terminals to vdd and
this these differing paths this parall parallel path versus series path is really important that anytime you have a PS in parallel you need to have an N moss in series if you have a p moss in series need have an N moss in parallel and that's how we build our logic gate so that we maintain this complimentary functionality now let's look at what this circuit actually does so let's input a 0 b a 0 so in a is zero this PS is going to be a short and when B is zero this p is going
to be a short as well and so both of these connect our output directly to vdd so our output should be a one and down here our a is connected to our nmos so that's going to become an open and B is going to be connected to this end moss and create an open so there's no path between ground and the output so indeed our output is one and let's try another input combination so let's try try with 01 and when a is zero we're going to have a short on this P just like before
and with B is 1 this is going to create an open on this pmos a with zero is going to create an open on this n moss and B with a one is going to create a short so here our ground is still cut off from the output but we do have a direct path from vdd down to the output so our output's going to be one now let's try the next combination 1 Zer it's going to be exactly like before except a little bit flipped so a is going to result in this being open
this B is going to cause this to be short and then this a is going to cause this n MOS to be shorted and this B with zero is going to cause this n MOS to be open so again there's no path between ground and the output but there will be a path between vdd and the output so the output is one one all right one last combination to go we got a is 1 B is 1 that means a is going to be an open on this PS B is going to be an open
on this PS and then a is going to result in a short on this n moss and B is going to result in a short on this n Moss so now we have a path between ground and the output so our output is zero and we have no paths between vdd and the output so that reinforces that this is a zero if you recognize this truth table you should recognize that this is the nand function the not and which has the following circuit symbol we can now use this nand gate that we constructed to create
an and gate if we just comp concatenate this notot afterwards so we've got our nand and this is our not and this would result in a b as our inputs c as our outputs for an and gate this is one reason why we tend to use only nand gates in our implementation of actual computers because an and gate is a lot more complicated anyways we'll find out more about that in future lectures as well so let's look at one last circuit and I'll just give the punch line away for this one this is a Norgate
and we'll see exactly how this behaves but I want to draw attention back to the the series versus parallel here our P mooss are in series whereas our n Moss down at the bottom here are in parallel because they share that common point over here and so that re should hopefully reinforce the idea that we always do things complementarily between P Moos and N MOS so let's look at the inputs when a is zero B is zero a creates a short on the posos B creates a short on this posos and then the a comes
around here and creates an open on the nmos and B creates an open on this n MOS so we have a direct connection between vdd and the output and no path between ground and the output so output is one let's try the next Syle combination with 01 0o creates a short here and an open here so there's no path between vdd and the output and then we've got zero over here so this guy becomes an open but the B being one here creates an up short for this n Moss so we have a path directly
from ground to the output so that creates a zero output next input combination 1 Zer B is one so we have a open here and a short on this posos because of the B and then this guy is going to be open and and this guy will be shorted so now we have a different path but we still have a path nonetheless from ground to the output so our output will be zero and then we put both these as one both of our P mosses will be open and both of our n mosses will be
shorted so we have two paths from ground to the output so c will be zero and our output will be zero and this again creates our Norgate which has the circuit symbol nor and we can combine nor with not to create or and just like our nand art we generally will prefer to use nor Gates exclusively in our designs rather than using and ores and kns