## What are Logic Gates?

We can define a logic gate as a simple boolean function, which means that it has only either of two outputs. Either 1 or 0, high or low, true or false, whatever you can call it. It is the most elementary tool in building a circuit. A logic gate performs a logical operation on an input and gives the appropriate output for it.

### Types of Logic Gates

A logic gate is a basic building block of a digital circuit, which is used to implement a Boolean function. Given below are the different types of logic gates, their symbols, descriptions and truth tables.

#### AND GATE

If ‘0′ is false and ‘1′ is true, then the gate acts as the logical “and” operator. The output will be 1 only if ‘all’ inputs are true. It can have more than 1 input.

X |
Y |
Z |

0 | 1 | 0 |

1 | 0 | 0 |

0 | 0 | 0 |

1 | 1 | 1 |

#### NAND GATE

It is the NOT AND gate. The inverter bubble reverses the output of the AND gate logic, giving a 0 output only when all inputs are 1.

#### OR GATE

If “any one” of the inputs are 1, the output is 1. The output is 0 only if all inputs are 0. It can have more than 1 input.

#### NOR GATE

It is the NOT – OR gate. The inverter bubble reverses the output of the OR gate logic giving 1 as the output only if all inputs are 0. It can have more than 1 input.

#### XOR GATE

It is the ‘Exclusive – OR’ gate. The output is 1 only when one of the inputs is 1. And 0 if the inputs are the same.

#### XNOR GATE

It is the ‘Exclusive – NOR’ gate is a combination of XOR gate followed by an inverter. The output is 1 only when both the inputs (even high) are the same and false if the inputs are different.

#### Universal Logic Gates

A universal logic gate is one which can implement any Boolean function {0,1}, without the use of any other logic gate. Simply put, a logic gate which can serve the function of ALL other logic gates, including itself.

The NAND and NOR gates are called universal logic gates because all the other gates can be created using these two.

Stay tuned with BYJU’S to learn more about logic gates, integrated circuit, etc. with the help of interactive video lessons.