NAND Gate using Transistor
Updated: Apr 24
NAND Gate is a logic gate that is the combination of AND gate and NOT gate.
#NAND gate is said to be the inverse of AND gate.
To know more about logic gates click here.
The symbol of NAND #Gate is shown below.
This explains that the boolean expression of a NAND Gate is (A.B)’ or (A*B) inverse. So, the #boolean expression is output, O = (A.B) inverse.
According to this expression, the truth table of NAND Gate is given by,
Input A Input B Output 0 0 1 0 1 1 1 0 1 1 1 0
Building NAND Gate using transistor
To build a NAND gate using a transistor, you will need two BJT transistors and for this tutorial, we use the building of a NAND Gate using two NPN transistors. The two transistors used are #BC547 NPN transistors with all other components mentioned in the list below.
The list of components required to build a NAND gate using transistors are:
1 . Two NPN transistors.
Click here to know more about transistors.
2 . Two 10K Ohm resistors and one 2-4K Ohm resistor
Resistors are passive devices that oppose the flow of electrons and restrict the flow of current or divide the voltage through the circuit. The resistors used for this circuit are 10k Ohm and 2-4k Ohm resistors. 10k Ohm Resistor is connected before the transistor, i.e. the input power passes through these resistors and then to the transistors. The 2-4k Ohm resistor is connected before the LED so that a lesser amount of voltage is diverted to the LED.
To know more about Resistors click here.
3. Two Push Buttons
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. Push buttons are used to provide input to the transistors.
4. One Breadboard
The breadboard is the key component of any circuit-building process. All components 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 breadboards.
5 . Connecting wires
Connecting Wires are the main components that are used to establish the connections between different devices of the circuit.
6. One LED
Light Emitting Diode is a commonly used light source. It is a semiconductor that emits light when current flows through it. LED is used to check the output.
Learn more about LED by clicking here.
7. 5V Power Supply
The Power supply 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 onboard LED which indicates when the power is supplied through the module. For this circuit, the power supply can be 5V or 6V.
Using these all components you can make a circuit similar to the schematic shown in the picture below.
To explain the same circuit, refer to the image below, and the connection of hardware is explained by referring to these images.
In the above image, two transistors Q1 and Q2 are connected in series to build a NAND Gate and the circuit is similar to the circuit of AND Gate. The collector terminal of the first transistor is connected with a VCC i.e. a 5V power supply through a 2K Ohm resistor and also with the output terminal, O.
Then the emitter terminal of the first transistor is connected with the collector terminal of the second transistor, making a series connection between the two transistors.
Finally, the #emitter of the second transistor is connected with the ground to complete the circuit and on the other side, the #base terminal of both the transistors is connected with input A and input B using a 10K Ohm resistor, respectively.
Working of NAND gate using transistor
The working of the NAND Gate using a transistor can be explained using 4 cases according to the truth table of the NAND Gate. So, if we get the same output (with respective input) as in the truth table then we can say that we have successfully built a NAND gate using transistors.
Case 1: Input A = 0 and B = 0
According to the boolean expression, output O = inverse (A * B) and if the input A = 0 and B = 0 then output, O = 1. Hence, due to HIGH output, the LED will turn ON in the circuit.
In practice, when both the inputs are zero then the transistors which are acting as a switch don’t allow any connections between the #collector and emitter terminal. So, when a 5V supply is passed through the circuit, the current doesn’t reach the emitter terminal of the first transistor and just reaches the collector terminal of the first transistor.
But the collector terminal is also collected with the output LED and so, this 5V supply directly passes to the LED. Hence, the output is HIGH, and the LED glows.
Case 2: Input A = 0 and B = 1
When a 5V supply is passed to a NAND Gate circuit built using transistors, the output LED is ON according to the boolean expression. Since, the inputs are A = 0, B = 1 and so the output, O according to the NAND gate boolean expression will be 1. Hence, the LED will glow.
Being high input at the second transistor, the base of the second transistor allows a connection between the collector and the emitter terminal. But, the input at the collector terminal of the second transistor will be 0 because the input at the first transistor is 0 i.e. there is no connection between the collector and emitter terminal of the first transistor. So, the power supply reaching the collector terminal goes directly to the output terminal, and hence, the LED is ON.
Case 3: Input A = 1 and B = 0
This case is very much similar to Case 2, just the difference is that the first transistor has a HIGH input and the second transistor has LOW input. So, the switch of the first transistor is ON while for the second transistor, it is OFF. So, the output here would be the same as the previous case i.e. the LED will be turned ON.
Also, according to the boolean expression where output, O = (A*B) inverse, and A = 1 and B = 0, the output will be 1. So, the LED is ON.
Case 4: Input A = 1 and B = 1
Here, both the inputs A = 1 and B = 1, so the output will be LOW when calculated using the boolean expression. Since the output is LOW, the LED will also be OFF.
In the hardware, the 5V supply reaches the collector terminal passing through the resistor and since both the transistor has HIGH input, there will be a direct connection between the collector terminal of the first transistor and the emitter terminal of the second transistor. But the second transistor is connected directly with the ground and so, the potential difference between the collector terminal of the first transistor and the emitter terminal of the second transistor is zero. Also, the collector terminal is connected with the output terminal and so, the LED receives 0V and hence the output is LOW.
The above explanation can also be understood by a practical demonstration using the video below.
NOTE: In the video, I have not used push buttons for changing values of input A and B instead I have used wires. But would recommend you to use the push-button for easy understanding and implementation.
Follow us -
Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes, and contests.
Written By: LearnElectronics India
Modified By: Nagapuri Swathi