Constructing a NAND Gate Using Transistors: A Step-by-Step Guide


In the realm of digital electronics and logic circuits, the NAND gate stands as a fundamental cornerstone, wielding immense power in information processing. Short for Negated AND, NAND is a logical operation that produces a low output only when all of its inputs are high.

This article will guide you through the process of constructing a NAND gate circuit using transistors.

Transistors serve as the foundational building blocks of logic gates, including AND gates, NAND gates, OR gates, XOR gates, and others crucial to integrated circuits. In our previous electronic circuits, we have implemented XOR Gate, NAND Gate, NOT Gate, NOR Gate, AND Gate, OR Gate, XNOR Gate.

By configuring transistors in specific arrangements, various gates utilized in electronics can be constructed.

Any type of transistor, whether BJTs or FETs, can be used to create logic gates. However, in this article, we will use NPN BJTs. The 2N2222 transistor, a common and widely available NPN BJT, is capable of acting as either a switch or an amplifier.

What is a NAND logic gate? A two-input NAND gate produces a LOW output when both of its inputs are HIGH and a HIGH output otherwise. Creating a NAND gate using only two transistors is relatively straightforward.

NAND Gate Symbol

Logic NAND Gates use digital circuits to produce the desired logical function and are represented by a symbol resembling a standard AND gate with a circle, sometimes called an “inversion bubble,” at its output to represent the NOT gate symbol with its logical operation.

Truth table of NAND Gate

Inputs     Output
A    B       Y
0    0       1
0    1       1
1    0       1
1    1       0

Boolean expression for this gate is �=�⋅�. A NAND gate exhibits a HIGH output for all conditions except when both inputs are 1. In such a scenario, the output will be a logic LOW.

Components Needed for Building NAND Gate

  • 2 2N2222 (NPN) transistors
  • 2 10kΩ resistors
  • 2 220Ω resistors
  • 1 470Ω resistor
  • 2 Push buttons
  • A Breadboard
  • A 9V Battery
  • LEDs and Connecting wires

Circuit Diagram of NAND Gate using Transistors

Now, let’s delve into the construction of the NAND gate using two NPN transistors.

  1. Connect the collector of the first NPN transistor (Q1) to Vcc with resistor (RS). This establishes the power connection for Q1.
  2. Connect the emitter of Q1 to the collector of the second NPN transistor (Q2). This connection between the transistors forms the core of our NAND gate.
  3. Connect the collector of Q1 to the output terminal Y, which will be our NAND gate’s output.
  4. Attach a resistor (R1) between the base of Q1 and the input terminal A. This resistor limits the current flowing into the base of Q1.
  5. Connect a resistor (R2) between the base of Q2 and input terminal B. Similar to R1, R2 controls the current entering the base of Q2.

A simple 2-input NAND gate can be constructed using RTL Resistor-transistor switches connected together as shown above with the inputs connected directly to the transistor bases.

NAND Gate Circuit

A NAND gate circuit is almost identical to an AND gate circuit. The key difference is that instead of connecting the output to the emitter of the second transistor, the output is obtained from the collector of the first transistor.

When both inputs are set to HIGH, both transistors conduct through their collector-emitter paths, effectively creating a short circuit to ground. This diverts the current away from the output, causing it to go LOW.

Conversely, if either transistor turns off, the supply current flows through the output circuit (LED), resulting in a HIGH output. Hence, the output will be HIGH if either one of the inputs is LOW.


The NAND gate, with its versatile functionality and ability to negate and simplify logical expressions, finds widespread applications in various fields. Some notable applications include digital logic circuits, universal gates, data storage, error detection and correction, programmable logic controllers (PLCs), digital displays, mathematical and computational operations. These examples highlight the wide-ranging application of the NAND gate, making it an indispensable component in the design and implementation of digital systems across numerous industries.


Please enter your comment!
Please enter your name here