AND gate is a digital logic gate that has two or more inputs and one output to perform logical conjunction. The output of an AND gate is high only when all of the inputs are high. If one or more of an AND gate’s inputs are low, then the output of the AND gate is low.
In simple words,
- It only turns on when all the inputs are ON
- If only one input is on, then output turns OFF
- If all the inputs are off, then output turns OFF
HERE 1 IS HIGH AND 0 IS LOW
AND Gate Logic
Now we all know that in the logic world AND is represented as “ .”. If you want to represent an output Y as A AND B you have to write it as Y= A.B. You can see this dot(.) as a multiplication sign(x). Actually in AND gate if you want to get the output as high you have to set all the input in logic high. If somehow one input becomes low then the output will be low.
Here we will give you two examples so that you can do it yourself.
Let us consider there is an AND gate with its input A and B and the output is Y=A.B. Now you can write the AND gate truth tabele as below:
As we know that an AND gate may have more than two inputs so we can write the truth table for that case also just by following the same method.
How to make AND Gate
We can build an AND Gate using a transistor. Operation of an AND gate depends on transistor switching speed. Generally, we use transistors as a switch for AND Gate operation. We use BC547 Transistor, a general purpose NPN transistor, here because in common emitter configuration it is able to give a high output when input is low. This is happening due to a change in a phase shift of 180 degrees. BC547 is widely used due to its low power consumption and low switching frequency. You can use other transistors such as BC548 and BC549 also to build an AND gate.
Here we will show how to build an AND Gate using a transistor.
- BC547 NPN transistor ( 2pcs.)
- 1k Resistor (1pcs)
- 10k Resistor(3pcs)
- 4.7k Resistor(1pcs)
- toggle switches(2pcs)
- General-purpose LED
- 5V Power supply
- Jumper wires
Two input AND Gate using Transistor
We are going to use the BC547 transistor in common-emitter mode as shown in the picture. Here you can see two transistors are connected in series. Here we will use the base of these two-transistor as input. We can use one of the emitters out of two as output.
At first, when two switches are in OFF mode there is no power supply to both the bases. Now base to emitter voltage and base to collector junction voltage of both these transistors is lower than 6.05 volt and it is equal to the practical threshold voltage of the diode.
Here both transistors act like an open switch because base to emitter junction and base to collector junction is in reverse bias so both the transistors go into their cutoff state. The current coming through resistor R3 is blocked by the transistor so we get a low voltage. As a result of the low voltage, we get the LED in OFF mode.
Now if we press switch 1 then the base of the first transistor gets connected to the power supply. So the base of the first transistor gets some voltage and the base of the second transistor is still in cutoff mode. The emitter of the first transistor is connected with the collector of the second translator, as a result of this the emitter of the first transistor is not able to get any voltage as the second transistor is already in cutoff mode. So the base to emitter and base to collector junction voltage will be lower than the threshold voltage and both the transistors will be in cutoff state. All the current will be blocked by the transistor. As a result, we will get a low voltage in the output which will turn off the led.
When we press both the switch then base to emitter junction and base to collector junction has a voltage higher than the threshold voltage so both the junctions now are in forward bias. Now it shows that both the transistors are in saturation state and act like a short circuit. So the current will flow from the collector of the emitter of the second transistor. Which will produce a high voltage in the output and will turn ON the led.
In this way, we can build our AND get using transistors. If both the inputs have a high value then we get a high value in the output otherwise we will get low all the time.
CMOS AND Gate
We can build AND gates using CMOS also. In this case, we use CMOS NAND Gate. We will add an extra stage of transistors to invert the output signal of CMOS NAND Gate and which will work as an AND Gate.
The above picture is an example of CMOS NAND Gate. Transistor Q1 and Q3 are connected with input A. When the input A is high then the transistor Q1 is turning off and Q2 Is turning on. When input A is low then Q1 is turning ON and Q2 is turning off.Q2 and Q4 are similarly controlled by input B for the same level of input logic.
Here you can clearly see that Q1 and Q2 have their source and drain terminal parallel while for Q3 and Q4 it is connected in series. Which means that the output will go high when one of the transistors saturates and will go low when all the transistor saturates.
Now if we add an extra stage of transistors to invert the output signal then the same gate will work as a AND gate which we called CMOS AND Gate.
3 input AND Gate
Let us consider there is an AND gate with its inputs A, B, C . If the output of that AND gate is D. Then we can say D=A.B.C
The truth table of this 3 input AND gate will be
Here you can see the outputs Y and D are high(1) only when all the inputs are in high mode(1).