Hey friends, welcome to the YouTube channel ALL ABOUT ELECTRONICS. So in this video, we will learn about the logic gates. The logic gates are very basic building blocks of the digital systems.
So these logic gates are the electronic circuits which consist of one or more inputs and one output. Now the inputs and outputs of these logic gates can have only two values. i.e. Logic 1 or the high value or the Logic 0 or the low value. Now, in reality, this high or low or the Logic 1 or the Logic 0 are the voltage levels.
That means high could be 5V while the low could be 0V. And the relationship between this input and output of the logic gate is based on the certain logic. For example, for a some logic gate, the output could be high or the logic 1 when the both inputs are high. Or for some other logic gate, the output would be high if any one of the inputs is equal to logic 0. So in a way, these logic gates have the ability to make certain logical decisions.
And since these electronic gates can make a logical decision, so these gates are known as the logic gates. Now when we interconnect or cascade these logic gates, then it is possible to perform various logical operations. And using these logic gates, Even it is possible to build the processor. So now, let's understand about these logic gates.
So this AND gate, OR gate and the NOT gate are very basic type of logic gates. And using these 3 gates, it is possible to build any Boolean function. Apart from that, there are 2 universal gates. That is NAND gate and the NOR gate.
So these 2 gates are known as the universal gates. Because using any of the 2 gates alone, it is possible to build any logic circuit or Boolean function. So apart from this Universal and the Basic gates, there are two more gates. That is XOR gate and the XNOR gate.
So one by one, let's learn about all these different logic gates. And first, let's start with the AND gate. So this is the symbol of the two inputs AND gate.
Where this A and B are the inputs of this AND gate. While this Y is the output. So this output of the AND gate will be high or the logic 1 when the both inputs are high. And if any of the two inputs is low or the logic 0, in that case the output of the AND gate will be equal to 0. So let us understand that with the help of the truth table.
So this truth table shows all the possible combinations of the input signal and the corresponding outputs for those input combinations. So here is the truth table of the two input AND gate. So as I said earlier, Each input to the logic gate can have only two values. That is logic 0 or the logic 1. So, for the two different inputs, there are total 4 different possibilities.
That is, either both inputs are logic 0 or both inputs are logic 1. And the other two possibilities are when the both inputs are different. So, as I said earlier, the output of the AND gate is logic 1, when the both inputs are high. And if any of the one input is low, or the logic 0, in that case, the output will be also equal to logic 0. So let's say, this A and B are the input to this AND gate, and Y is the output.
So the Boolean expression of this AND gate can be given as Y is equal to AB. That means if input A and B both are 1, then and then only, this output of the AND gate will be equal to 1. And if any of the one input is low or the logic 0, in that case, The output of the AND gate will be equal to LOW. So that is the 2-input AND gate. Similarly, we can also have a AND gate with more than 2 inputs.
So here is the symbol of the 3-input AND gate. Where this A, B and C are the inputs to this AND gate. And if we see the Boolean expression of this 3-input AND gate, then this output Y can be given as A, B and C.
That means whenever all the 3 inputs are high, Then and then only, the output of the AND gate will be equal to HIGH. Similarly, we can also have an input AND gate. So now, let's move to the next gate. And the next gate is equal to OR gate.
So, this is the symbol of the OR gate. Where this A and B are the inputs to this OR gate. And Y is the output. So, this output of the OR gate will be LOW, whenever both the inputs are LOW. And if any of the one input is HIGH, In that case, the output of this OR gate will be equal to high.
So, let's understand it with the help of the truth table. So, here is the truth table of the two-input OR gate. So, for the two inputs A and B, there are total 4 different combinations. So, in case of the OR gate, the output is low whenever both inputs are low or the logic is zero. And if any of the two inputs are high, or both inputs are high, in that case, the output of the OR gate will be equal to high.
So, if A and B are the input to this OR gate. and y is the output, then the Boolean expression of this OR gate is equal to a plus b. That means if either a is 1 or b is 1 or both are 1 in that case, the output of the OR gate will be equal to logic 1. And if both inputs are 0, in that case, the output of the OR gate will be equal to 0. So that is the two-input OR gate. Similarly, we can also have an OR gate with more than. two inputs.
So, here is the symbol of the three input OR gate. And if you see the boolean expression, then it is equal to A plus B plus C. That means if all the three inputs are low, then and then only, the output of the OR gate will be equal to low. And in any other case, the output of the OR gate will be equal to high.
So, that is the OR gate. Similarly, the next gate is equal to NOT gate, which is also known as the inverter gate. Because in this gate, the output is the complement of the input signal.
So if the input is high, then the output will be equal to low. And likewise, if the input is low, then the output will be equal to high. So this is the truth table of the NOT gate.
So basically, this gate inverts the logic 0 to the logic 1 and the logic 1 to the logic 0. And it is very useful in implementing the different Boolean functions. And this is the symbol of the NOT gate. And if A is the input to this NOT gate, then this is the Boolean expression of this NOT gate. Which indicates that the output is the complement of the input signal. So this AND, OR and the NOT gate are the three basic gates using which it is possible to design any logic circuit or it is possible to implement any Boolean function.
But apart from that, there are two universal gates. And using any of the two gates alone, it is possible to design any logic circuit. So let us understand about this NAT gate and the NOR gate.
And first, let us start with the NAT gate. So this is the symbol of the two-input NAT gate. And if you see, then it is very similar to the AND gate. But here, there is a bubble on the output side. So this NAT gate is the combination of the AND gate followed by the NOR gate.
That means the output of the NAT gate is equivalent to the output of the AND gate followed by the NOT gate. And its Boolean expression is equal to AB bar. That is the complement of the output AB. So now, let us see the truth table of the two inputs, NAT gate.
Now we have already seen the truth table of the two inputs, AND gate, right? So let's say, the output of this AND gate is equal to Z. So this output Z is equal to 1, whenever the both inputs are high.
And if any of the two inputs are low, or both inputs are low, in that case, this output Z will be equal to 0. Now whenever this input is passed through the NOT gate, then it will get inverted. That means the output of this NOT gate will be equal to Z bar. So in this Z bar, all the 0s will get replaced by 1 and the 1 will get replaced by 0. And this is the output of the AND gate followed by the NOT gate.
which is equivalent to the output of the NAND gate. So as you can see from the truth table, when all the input to the NAND gate is equal to 1, then only the output of this NAND gate will be equal to 0. But whenever any of the two inputs is logic 0, in that case, the output of the NAND gate is equal to 1. So similar to the two input NAND gate, we can also have a NAND gate which has more than two inputs. But in that case also, the output will be low. whenever all the inputs are high.
Apart from that, for all other combinations, the output of the NAND gate will be equal to high. Alright, so now let us see the NOR gate. So this is the symbol of the two-input NOR gate. And as you can see, it is very similar to the OR gate. But there is a bubble on the output side, which indicates that the output of the NOR gate is similar to the output of the OR gate followed by the NOT gate.
So now, let's see the truth table of this NOR gate. So let's say, The output of this OR gate is equal to Z. And whenever it is given to the NOT gate, then the output of the NOT gate will be equal to Z bar.
Which is the complement of the Z. Now we have already seen the truth table of the two-input OR gate. And we have seen that when any of the two inputs is high, in that case, the output of the OR gate will be equal to high.
And whenever both the inputs are logic 0, then only, the output will be equal to logic 0. Now when this output Z is passed through the NOR gate, then it will get inverted. So all the 1s will become 0 and all the 0s will become 1. And that is the output of the NOR gate. That means the output of the OR gate followed by the NOR gate is equivalent to the output of the NOR gate.
And the Boolean expression of this NOR gate is equal to a plus b whole bar. Which indicates that The output of the NOR gate is the complement of the OR gate. So, as you can see from the truth table, the output of the NOR gate is 1, whenever the both inputs are 0. So, that is the 2-input NOR gate.
Similarly, we can also have a NOR gate which has more than 2 inputs. Alright, so far we have seen the 3 basic gates and the 2 universal gates. Apart from that, there are 2 more gates.
That is XOR gate and the XNOR gate. But we will talk more about it in the next video. But I hope in this video, you understood what is logic gate. And you also learned some basics of the logic gates.
So, if you have any question or suggestion, then do let me know here in the comment section below. If you like this video, hit the like button and subscribe the channel for more such videos.