AND Gate using transistor
Updated: Nov 30, 2020
What is AND Gate?
The logic gate whose symbolic representation resembles D-shape is the AND Logic Gate. Also, the AND gate has two inputs and one single output which are connected through a Logic.
When both the inputs are HIGH, only then the output is HIGH and for the rest of all the cases, the output is LOW. This can be more clear from the truth table below:A : (Input 1) B : (Input 2)O : (Output) Input A Input B Output
0 0 0
0 1 0
1 0 0
1 1 1
Also from the truth table, we can say that the boolean expression of an AND Gate output is,
O = A * B.
How to build AND Gate using transistors?
To successfully build an #AND Gate using transistors, we need to make sure that whatever the circuit we build has output similar to the output in the truth table above. Now, let’s have a look at the list of components required for making an AND Gate using a transistor.
Components Required for AND GATE
The list of components required are mentioned below:
Two transistors (using BC 547 NPN transistors).
Buy Transistors from here.
2. One power supply(5V preferable).
In making AND GATE, this module is specially used for providing voltage supply to circuits designed with components on a small scale. The module has a Barrel jack the can be connected to the DC supply directly. The Voltage is regulated to supply 6-12 V DC. This regulated voltage is then supplied to the circuit built.
The power channel can be configured to supply 3.3V, 0V, or 5V. It has a control button that can be operated as per our requirement to start and stop the power supply. It has an on-board LED which indicates when the power is supplied through the module. For this circuit, the power supply can be 5V or 6V.
Buy the Power supply module from here.
3. Two 10K Ohm resistors and one 5K Ohm resistor.
Resistors are passive devices that restrict the flow of current or divide the voltage through the circuit in AND GATE. The resistors used for this circuit are 10k Ohm and 5k Ohm resistor. 10k Ohm Resistor is connected before the transistor, i.e. the input power passes through these resistors and then to the transistors. The 5k Ohm resistor is connected before the LED so that a lesser amount of voltage is diverted to the LED.
Buy Resistors from here.
The breadboard is the basic component of any circuit building process. All components, be it input sensors or output display devices are connected to the power supply, microcontroller using wired connections through a breadboard. The holes in the breadboard are in series. There are various sizes like full-sized, half-sized, and mini breadboard.
Buy Breadboard from here.
5. Connecting Wires.
These are the main components that are used to establish the connections between different devices of the circuit.
Buy Connecting Wires from here.
5. One LED(To see the output)
Light Emitting Diode is a commonly used light source. It is a semiconductor that emits light when current flows through it.
Buy LEDs from here.
6. Two Push Buttons(Wires can be used as an alternative).
PUSH Buttons are simple devices used for switching control. It is easy to use and starts or stops the function when connected in a circuit.
Buy Pushbuttons from here.
Using all the above-mentioned components, a hardware circuit can be built referring to the below hardware schematic.
Circuit Diagram of AND GATE
This hardware schematic can resemble the circuit diagram shown below for easy understanding. In the circuit, a power supply VCC (5V supply) is connected to the collector terminal of the first transistor T1 directly. Both the transistors, T1 and T2 are connected in serial with each other like the NAND Gate circuit and also the circuit somewhat resembles the NAND gate circuit built using transistors.
The base terminal of both the transistors T1 and T2 are connected to input A and B, respectively through a 10K Ohm resistor for each viz. R & R and finally, the emitter terminal of transistor T2 is connected directly with the ground using a 5K Ohm resistor, R2. Now to check the output of the circuit, the emitter terminal of transistor T2 is also connected with the output LED which is further connected to the ground to complete the circuit.
Working of AND GATE
The working of the AND gate circuit can be understood by considering the 4 cases from the truth table. So, if the output from the hardware matches the output of the truth table for each case then we can say that we have successfully built an AND Gate using transistors. Now, let’s see all 4 cases in AND GATE one by one:
Case 1: Input A = 0 and B = 0.
When input A = 0 and B = 0, the output O = 0 too, according to the AND Gate boolean expression i.e. output, O = A * B. This can also be proved when we see the hardware circuit result.
In the circuit, the 5V supply passes to the #collector terminal but since the input at the base of transistor T1 is 0, it means that there is no connection between the collector and emitter terminal of the transistor T1.
So, the current doesn’t pass from the collector terminal of T1 to anywhere else. Now the output is connected to the second transistor’s emitter terminal and so, there is zero output. Hence, the LED connected to the #emitter terminal is OFF.
Case 2: Input A = 0 and B = 1.
For input A = 0 and B = 1, the output according to the boolean expression of AND Gate will be 0. As a result, the LED will be OFF again.
In the circuit, when a 5V supply is connected to the collector terminal of transistor T1 and if input A connected to the base of the same transistor is 0 then, there is no passage of electrical signal from the collector to the emitter terminal in T1. So, the collector of the transistor has LOW input and the same would be passed to the emitter terminal since the #base of transistor Q2 connected with B has HIGH input. As a result, the emitter would pass the same LOW value to the LED and the LED will be OFF.
Case 3: Input A = 1 and B = 0.
Here, the working will be a bit opposite to the previous case i.e. the current would pass through transistor T1 but not through #transistor T2, being the input A = 1 and B = 0. So, the current would pass only till the collector terminal of transistor T2 and not to the emitter of T2. Again, the emitter of T2 has a LOW value and again the output LED will have a LOW input. Therefore, the LED will be OFF for this case too.
Also, according to the boolean expression of AND Gate i.e. output, O = A * B, and when input A = 1 and B = 0, the output will be O = 0.
Case 4: Input A = 1 and B = 1.
As mentioned earlier, for an AND Gate the output is HIGH only when both the inputs are HIGH and so explains the #boolean expression. For input A = 1 and B = 1, the output O = A * B will be 1.
Also in the hardware circuit when both the inputs A and B are HIGH, the base terminal for both the transistors allows a connection between the collector and emitter of both transistors. This creates a straight line path from the 5V supply to the emitter terminal of transistor T2 via transistor T1 and hence, the 5V supply reaches the output terminal making the LED turn ON.
You can try practically by watching the video.