﻿ How to Build an AND Gate with Transistors ﻿

# How to Build an AND Gate with Transistors

In this article, we go over how to build an AND gate circuit with transistors.

Transistors are the building blocks of logic gates, such as AND gates, NAND gates, and gates are the building blocks of integrated circuits.

With transistors arranged in certain ways, we can build the various gates that are used in electronics.

So from this article, you will not only learn how to build logic gates from discrete transistor components, but you learn more about how transistors operate in order to create gates. This teaches you more about the basic building blocks of electronic circuits, the transistor.

Really any type of transistor can be used in order to create logic gates, including BJTs or FETs. However, in this article, we will use NPN BJTs in order to do it.

The 2N3904 transistor is a very common NPN BJT transistor which can act as a switch or an amplifier.

The NPN BJT transistor, just like a FET, has 3 terminals: these 3 terminals are the base, collector, and emitter.

The base functions as the turn-on switch. A small amount of current flowing through the base can allow a much larger current to flow from the collector to the emitter.

A transistor is an electrical switch, in which if we feed a small current to the base of a transistor, it turns on a larger current from the collector to the emitter.

The components we need to build this circuit are shown below.

### Components Needed

• 2 2N3904 Transistors
• 2 10KΩ Resistor
• 470Ω Resistor
• LED

So with just a few components, we can construct an AND gate circuit.

Know that an AND gate circuit only turns on the load if all transistors in the circuit are turned on by an adequate base current. If any transistor is OFF or not conducting current from the collector to the emitter, then the circuit will not be continuous and the load will not be turned on.

Below is the truth table for an AND gate.

 AND Gate Logic Inputs Output 0 0 0 0 1 0 1 0 0 1 1 1

So as you can see from the truth table, an AND gate will only have a HIGH output if all the inputs are HIGH. Otherwise, the output will be a logic LOW and the load will not turn on.

The circuit we will build is shown below.

So what makes this an AND gate?

You can see that the transistors are pretty much lined up series with each other. Current, therefore, only has one path to travel.

Being that a BJT transistor requires current to the base in order for current to flow from the collector to the emitter, both transistors would have to have sufficient power to the base in order for current to flow from the power VCC power source to the RE resistor and to the LED load to turn on the LED.

The RE resistor is simply used to limit current to the LED, which is always good practice to do.

This setup with these 2 NPN BJT transistors functions as a logic AND gate.

As stated before, transistors are the building blocks for ICs, because they form the logic gates which are used heavily in computers.

Arranging transistors in certain configurations allows us to build gates, which can then be used to form higher-level electronic devices such as registers, latches, etc.

Knowing how transistors can be used to create logic gates allows you to understand electronics at the lowest level, so that you can get the best understanding of it from the most basic fundamental level.

This, again, was done through NPN BJT transistors but it can also be done in a similar fashion with FETs such as MOSFETs.

So this is how to build an AND gate with transistors.

Related Resources