# What is a NAND Gate?

In this step, you are going to have a look at how transistors can be combined together to form what are called logic gates, and in particular you will look at the NAND gate.

In this step, you are going to have a look at how transistors can be combined together to form what are called logic gates, and in particular you will look at the NAND gate.

## Transistors

You may already know how transistors can be used to represent the value 1 or 0 by acting like simple switches. You are now going to look at combining these transistors together so they can perform more complex operations.

The diagram below shows a circuit containing two transistors. Again, you don’t have to understand what is going on in this circuit, just as long as you can understand the basic inputs and outputs.

The two switches act as inputs to the transistor setup, and the LED represents the output. When both switches are in the off position, the LED is on. Either of the switches can be turned on, leaving the other one off, and the LED still stays on. It’s only when both switches are turned on that the LED will switch off.

This arrangement of transistors is called a NAND gate, and you’ll learn about why later.

## NAND Gate Symbol

Now, rather than drawing two transistors every time you want to represent a NAND gate, you can use a symbol that looks like this.

Whether you use this symbol or show the two transistors, the behaviour of the NAND gate is the same. When both switches are off, the output is on. Turning either of the switches individually doesn’t affect the output. Only when both switches are in the “on” position does the output become “off”.

## NAND Gate Truth Table

You can represent this behaviour by drawing what is called a truth table, where the states of the switches are represented by 1s and 0s. When both switches are off, the inputs are both 0. Since the lamp is on, the output in this state is 1. If you turn one of the switches to the “on” position, the corresponding input is 1; the lamp remains on, so the output is 1. Only when both inputs are 1 does the output change to 0.

So the full truth table for a NAND gate is as shown below.

You can play with your own simulation of a NAND gate on the website CircuitVerse.

Here, you can select different gates, and choose inputs, which can be 1 or 0, with outputs in the form of a digital LED. This will allow you to play around with a NAND gate and investigate the truth table for yourself.

You could even have a go at experimenting with different types of gate.