YTread Logo
YTread Logo

Logic Gates, Truth Tables, Boolean Algebra AND, OR, NOT, NAND & NOR

Mar 19, 2024
Let's start our discussion with binary numbers now, when you hear the word for, what do you think is associated with the number two, so binary numbers only have two possibilities? zero or one Now, when it comes to circuits, zero is or a corresponds to a circuit. be in the off state, one corresponds to a circuit that is in the on state, so if these are true and false statements, an off state will be considered false and the on state will be considered true if it is voltage and a turned off. would have zero volts and an on state typically five volts, but something other than zero now before we go over the

gates

and/or not let's talk about the buffer gate so here is the buffer gate symbol and it basically looks like a triangle that points to the right to the left we have the input to the right we have the output so we are going to call the input the output will also be the same so if we were to make a

truth

table with the input and the output If the input is on, meaning it has a binary number of one, the output will also be in on state.
logic gates truth tables boolean algebra and or not nand nor
If the input is in off state, meaning it has a binary number of zero, the output will also have the same. binary number of zero now. let's draw a circuit to represent this and the main element of this circuit will be an npn transistor this is the base this is the collector and this is the emitter now we are going to connect this to a power source and we are also going to use a light emitting diode , now the light emitting diode will represent the output of the circuit. Now let's connect this to a voltage source, so here is the input we will call it input a and what will happen if we apply a voltage to point a, so if the input is in the on state, the LED will be on or off.
logic gates truth tables boolean algebra and or not nand nor

More Interesting Facts About,

logic gates truth tables boolean algebra and or not nand nor...

Once you apply a voltage to the base, the transistor will turn on, current will flow from the collector to the emitter, therefore the LED will be in an on state, so this corresponds to one for the input and the output. Now what if the input is off? In this case we have a zero at the input. If there is no voltage at the base, then the transistor will be off, there will be no current. will be able to flow from the collector to the emitter so the LED will also be off and that is basically the

logic

gate of the buffer so if you have a one n at the input you will have one at the output if you have a zero at the input , you have a zero at the output.
logic gates truth tables boolean algebra and or not nand nor
Now the next type of

logic

eight we're going to talk about is the not gate, so here's the electrical symbol. It looks like a buffer gate but it has like a circle in front now let's call the input the output will be complementary to a you can also write it as a bar now let's write a

truth

table so we will have the input and the output, so if we have a zero at the input the output will be one and if we have a one at the input the output will be zero, it will always be the opposite, so basically if the input is in the off state, the output will be in the on state and vice versa.
logic gates truth tables boolean algebra and or not nand nor
Conversely, now how can we represent this using a transistor circuit? The circuit will be very similar to what we drew before, but there will be one key difference and that is the location of the LED, so here is our voltage source and on the left. we have our input a, the emitter is connected to ground, but the LED will be connected through the collector of the transistor and the emitter, so once again this will be our output, so let's say if the circuit or rather the input a is in the on state. Will the LED be in on or off state?
Well, let's break it down so that once we apply a voltage to the base of the transistor, current can flow from the collector to the emitter, so current flows from the positive five volts through the resistor now once it reaches At this point, you have two options: the current can flow to the right or it can flow to the left. Now electricity usually doesn't but it will always take the path of least resistance and if the transistor is on then the path of least resistance is from collector to emitter so no current will flow in this direction so it will be in the off state because the current has been shunted through the transistor, so notice that we have a complementary situation: the input is on. but the output is off in the same way, the opposite is true, so let's say the input is off, no voltage is applied on the input a, so what is going to happen?
Current will continue to flow through the resistor once it reaches this point because the transistor is off, it can't. flows through the transistor so it has no choice but to flow through the LED so the LED is on as we can see here if we have a zero in a the output will be one and if we have a 1. en at the output is 0. and that is the basic function of a no gate: it converts an off state into an on state and vice versa converts a into a prime number. Now the next logic gate that we are going to talk about is the y gate and here is the symbol for the an gate and we are going to have two inputs a and b and the output will be a multiplied by b now let's write a truth table and at the same time draw a circuit for this, well We're going to need two transistors instead of one, so this is input a and this is input b and we're going to connect it to a voltage source.
So what happens if inputs a and b are in off state, the LED will be on or off in In this case both transistors will be off so no current can flow from positive voltage source 5 to ground so the output will be zero because the LED is off. Now what if a is in an on state and b is in an off state? the led is on or off, current can flow through the resistor through the led and through the first transistor, however, because the second transistor is off, no current can flow through it, so no current will flow through the LED, so the LED will be off. state, so let's put a zero, the only way the LED can be on is if both inputs a and b are on, only under that circumstance can current flow through the LED and through both transistors to reach ground, so so we can have the floor and the only way the output can be in the on state is if both inputs a and b are in the on state, so even if b is on and a is off, no current will flow through the LED only if a and b are on.
Now let's move on to the mineral circuit and start by drawing the symbol for that, this is how it looks, let's say this is input a and b, now it won't be a multiplied by b as in the case of a y circuit but it is a plus b for the logic gate or now let's make a table as before and draw a circuit that corresponds to it so this time what we are going to have are two npn transistors but they will be connected in parallel with each other to make the logic gate or in the case of a logic gate and They were connected in series with each other and that is the key difference between the logic gate and or now let's say transistors a and b are off State: will the LED be on or off, so clearly no current can flow through the first transistor or the second transistor, so no current will flow through the LED?
The LED will be off, so we can put a zero in the truth table. And now what happens? If the first transistor is on but the second is off, what will happen? Current can flow through the resistor through the LED, but through the transistor which is on, therefore there is a path from the positive voltage source to ground, so the LED will be on. on, so let's put one now, what if transistor b is on but transistor a is off? Current can still flow, but this time through transistor b, so the LED will be on now.
What happens if both transistors are on? In this case, the LED will definitely be on. current can flow through transistor a or through transistor b so we have logic gate o, the LED will be on if a or b is on and that helps me remember the truth table for logic gate o if we have one in a or b doesn't matter which one the output will be on. Now I want to talk about the

nand

gate, but let's compare it with the and gate. The

nand

gate is basically the complement of the and gate, so here is the and symbol. gate, the nand gate symbol looks very similar, the only difference is that we are going to have a circle at the end, so let's say this is input a and this is input b, the output of an and the gate, we said which is a multiplied by b for a nand. door will be the complement of a by b now remember that the complement of zero is one and the complement of one is zero now let's look at the truth

tables

for these two types of doors to remember the only way to get a one with a door and is if both inputs a and b have a one, it will also be a zero in the case of a nand gate when both inputs a and b are in the output will be off, as you can see in this row I mean this column is more of the complement of this column.
Now we could use an and gate and a not gate to build an nand gate, so here is the and gate and let's put a not gate next to it, so let's say this is an input. b the output of a y gate is a b and once you use a not gate it basically takes the input and gives you the complement of that so the complement of a b is just a prime b so the combination of these two logic

gates

will produce or is equivalent to a nand gate now here is a question for you let's say if we have a nand gate and let's say if we take the two inputs of a nand gate and connect them together what kind of logic 8 do we have now ?
What would you say? let's compare it to the original nand gate, so this would be a and b and we would get a multiplied by b, but the complement of that result now we only have one input because they will both be a, so if we multiply these two. it would be a multiplied by a and then we'll get the complement of that, which is multiplied by a. Now you need to be familiar with some rules of Boolean

algebra

and we'll go over those rules soon, but a multiplied by a is basically a. One way to help you see this is that if you multiply zero and zero, you get zero.
If you multiply one and one, you get one. Keep in mind that we are dealing with binary numbers, so in a binary system this is what works. to be true, a multiplied by a is a, so this is the same as the complement of a, so notice that we go from a to prime, this is the equivalent of a not gate, this is how you can use a gate nand to make a hit. these two are functionally equivalent, now let's understand how this works using a truth table, so let's write the truth table of a nand gate now, once we connect the two inputs together, let's say once we make this circuit here, we have this circuit by the way. the columns have to be the same, therefore, these two possibilities cannot work because let's say that if this is a this also has to be a, that is, let's say that if we have a one we cannot have a one and a zero, that is not possible. either if this is going to be a one, both inputs will be a one or if we have a zero here, both inputs will be a zero, so these are the only two possibilities, so if we have a zero, the output is a one and if we have one, the output is zero and that is the same table as a not gate.
Now let's talk about the mineral and the north gate. The nor gate is the complement of the or gate in the same way as the nand gate. is the complement of the door and, so let's draw the symbols for both. The nor gate looks like the or gate but with a circle at the end, so given the inputs a and b, the output of the or gate we said is a plus b. for the nor gate it will be a plus b and then it is the complement of that result. Now let's write the truth

tables

of the or gate, the output of a or the gate will be in on state if a or b is on. state now in the case of the nor gate, it is simply the opposite, if a or b is in the on state the output will be in the off state now, one of the first things you should be able to do if you are taking an introductory design course The logic is that you need to be able to write a function given a block diagram, so let's start with the first one in the top left corner.
The first thing I like to do is identify what type of logic gates I have. I'm dealing with this, so this is a door and. I'm going to use a capital letter a to represent it now. Over here, notice that the inputs of the first y gate are a and b, and when this is an and gate, you need to associate. do it with multiplication and when it's a gate or associate it with addition, so what the gate and will do is take the two inputs and basically multiply them together, so the output will be a multiplied by b now the second and the gate will take this input which is av and multiply it by this input which is c, so we could say that the output of this entire circuit represented by the function f will be the product of a and c, so this is the answer for the first , now what about the second one in the upper right corner, feelmore, let's say we have a multiplied by b plus c d prime, what kind of expression do we have?
So here we have a single term as a literal and this is a product term and it looks like just a mix of sop and pos it turns out that this expression is neither a sum of products nor a product of sums expression now this expression has four variables As we could see it is a b c and d and it has four literals if we enumerate they are a b c and d prime and that is all we can say about this expression, so this is an example of an expression that is neither sop nor pos.
Now let's say if c wasn't there, what kind of expression would we have now? Would you still say? it's not because it's now a sum term when you have c here it's no longer a sum term but when you take away c now we have a sum term and a is considered a sum term you can write it as plus zero so that's the term of addition and then b plus d prime, that's another addition term, so this is the product of two addition terms, so it would be a pos expression, but once you put c into the mix, it's no longer a sum term nor a product term. then this would be neither.
Now let's review some basic rules of Boolean

algebra

. Now, whenever you see a plus sign, know that you are dealing with the or logic gate and if you see a multiplication or product term, remember that you are dealing with the and. logic gate then the first law that we are going to review is the commutative property a plus b is the same as b plus a and a times b is the same as b times a the next is the associative property so a plus b plus c is the same as a plus b plus c and a multiplied by bc is the same as a b multiplied by c so that is the associative property and as you can see, the order of the and and or operators does not matter, next is the identity rule a plus 0 equals a and a multiplied by 1 is also equal to a the next is the null property a plus one is equal to one and a multiplied by one I mean a multiplied by zero rather it is equal to zero now if you are analyzing this using old school algebra this equation can have It makes sense to you, but this one might be a little confusing, for example, if a is zero zero plus one equals one, okay, that makes sense, but what if a is one one plus one?
Is it really equal to one? Well, in old school algebra one plus one equals two, but when it comes to

boolean

algebra, one plus one equals one and let's prove that using logic gates, so here we are dealing with the or logic gate, so let's draw that now we are going to have two inputs a and b, but b we are going to say that it is always equal to one now the output will be a plus b now let's make a truth table now remember that the output will be a 1 if input a or input b are in on state so a could be one or zero b is always one so this is b so if a and b are both in on state then this logic gate will be on so we will give it a value of 1. here b is on, a is off, so If one of the inputs is on for gate o, the output will be on, so in this case if a and b are on, we can see that the output is one here, if b is on, a is off, the output is still one. but this is the one we are working with so one plus one equals one when it comes to logic gates this means if a is on and b is on then the output a plus b will also be on and that is the shape.
You have to think about it when you deal with these types of Boolean algebra expressions. Now, the next rule we're going to talk about is that the complements of a plus a prime will be one and a multiplied by a prime will always be zero, so this is the property of the complement that now uses numbers if it has a zero and a one. , let's say a is zero, a prime has to be one, this will be one, so when it comes to the logic gate or if one of the inputs is in off state and the other is in on state, the output will be on, so that's what zero plus one equals one.
Now for this one we are dealing with the y gate, so let's draw that circuit, so let's say if we will call it a and a prime, then if a is on, that means the other a prime will be off now, when it comes to the logic gate and, the only way the output will be on is if both inputs a and b or, in this case, a and a are prime. strange because the keyword and well this will never happen because if a is in a main state it will be automatically deactivated so the two inputs will never be activated at the same time so no matter what this will always be in the deactivated state, so we will have a binary number of zero, so whenever you use a logic gate and with the main inputs a and a, the output will always be zero and it will always be off.

If you have any copyright issue, please Contact