# Logic gate truth table

### In this section

Logic circuits form the very basis of digital electronics. Circuits including the AND, NAND, OR, NOR and exclusive OR gates or circuits form the building blocks on which much of digital electronics is based.

The various types of electronic logic gates that can be used have outputs that depend upon the states of the two (or more) inputs to the logic gate. The two main types are AND and OR gates, although there are logic gates such as exclusive OR gates and simple inverters.

For the explanations below, the logic gates have been assumed to have two inputs. While two input gates are the most common, many gates that possess more than two inputs are used. The logic in the explanations below can be expanded to cover these multiple input gates, although for simplicity the explanations have been simplified to cover two input cases.

### AND and NAND gates

An AND gate has an output that is a logical "1" or high when a "1" is present at both inputs. In other words if a logic gate has inputs A and B, then the output to the circuit will be a logical "1" when A AND B are at level "1". For all other combinations of input the output will be at "0".

A NAND gate is simply an AND gate with its output inverted. In other words the output is at level "0" when A AND B are at "1". For all other states the output is at level "1".

### OR and NOR gates

For an electronic OR gates the output is at "1" when the input at either A or B is at logical "1". In other words only one of the inputs has to be at "1" for the output to be set to "1". The output remains at "1" even if both inputs are at "1". The output only goes to "0" if no inputs are at "1".

In just the same way that a NAND gate is an AND gate with the output inverted, so too the NOR gate is an OR gate with its output inverted. Its output goes to "0" when either A OR B is at logical "1". For all other input states the output of the NOR gate goes to "1".

### Exclusive OR

One other form of OR gate that is often used is known as an exclusive OR gate. As the name suggests it is a form of OR gate, but rather than providing a "1" at the output for a variety of input conditions as in the case of a normal OR gate, the exclusive OR gate only provides a "1" when one of its inputs is at "1", and not both (or more than one in the case of a gate with more than two inputs).

### Inverter

The final form of gate, if indeed it could be categorised as a gate is the inverter. As the name suggests this circuit simply inverts the state of the input signal. For an input of "0" it provides an output of "1" and for an input of "1", it provides an output of "0". Although very simple in its operation, these circuits are often of great use, and accordingly they are quite widely used.

Logic Truth Table
A B AND NAND OR NOR Ex OR
0 0 0 1 0 1 0
1 0 0 1 1 0 1
0 1 0 1 1 0 1
1 1 1 0 1 0 0

Logic gate truth table

By Ian Poole

### More circuits tutorials

Mark Patrick | Mouser Electronics
Refining IoT Technology to Address Demands of the Healthcare Market
The Internet of Things, IoT is destined to affect many areas of everyday life - we expect it will include many areas like smart meters, remote control of lighting, but what about the healthcare market . . .
Online - Effective Vector Network Analyzer Measurements
How to make effective VNA measurements at RF and microwave frequencies

More training courses

Designing for Li-ion Batteries in Motor Applications
Discover all the design considerations for integrating brushless DC motors with Li-ion batteries in 3-phase motor applications in this whitepaper from Intersil.

More whitepapers

##### Channels
Radio-Electronics.com is operated and owned by Adrio Communications Ltd and edited by Ian Poole. All information is © Adrio Communications Ltd and may not be copied except for individual personal use. This includes copying material in whatever form into website pages. While every effort is made to ensure the accuracy of the information on Radio-Electronics.com, no liability is accepted for any consequences of using it. This site uses cookies. By using this site, these terms including the use of cookies are accepted. More explanation can be found in our Privacy Policy