## Introduction

This blog will discuss logic gates and the different types of logic gates. But before learning about different types of logic gates, we should first look at what are logic gates and why logic gates were needed in the first place.

Also Read - __Shift Registers in Digital Electronics____ __and __Difference Between Jfet and Mosfet__

**What are logic gates?**

Logic gates are used in computers to convert 1s and 0s from input wires. A logic gate receives inputs and then outputs a result based on the state of those inputs.

**What is the use of logic gates?**

So, we send information to computers via wires that represent 1s and 0s. Computers require a method to manipulate those 1s and 0s to ultimately do more complex operations, such as computing the 50th decmal digit of pi.

Now we need to look at some basic terminologies related to logic gates like boolean algebra, truth table, etc.

You can refer to this flowchart to get some idea of basic terminologies related to boolean algebra and logic gates.

Logic Gates are large digital devices that mainly use the Boolean function. Logic gates create a single binary output by performing logical operations on multiple binary inputs. A digital system comprises logic gates, which are electrical circuits. These may take two or more inputs but only produce one output.

The output of a logic gate is determined by the combination of inputs placed across it. To carry out logical operations, logic gates make use of Boolean algebra. Nearly every digital device we use daily has logic gates. In the architecture of modern phones, computers, tablets, and memory devices, logic gates are utilized.

Recommended Topic, __Microinstruction in Computer Architecture__

## Types Of Logic Gates

There are seven different types of logic gates:

- AND Gate
- OR Gate
- NAND Gate
- NOR Gate
- NOT Gate
- XOR Gate
- XNOR Gate

We will be discussing about each of the logic gates in the following sections.

### AND Gate

**Truth Table**

The AND gate is an electrical circuit that only outputs a high value (1) if its inputs are also high. The AND operation, i.e., A.B., is represented by a dot (.). Remember that this dot is occasionally deleted, as in AB.

### OR Gate

**Truth Table**

An OR gate is a logic gate that performs a logical OR operation. The logical OR operation gives a high output if one or both of the gate's inputs are high (1). (1). The outcome is a low output if neither of the inputs is high (0). An OR gate can only have one output probe, similar to how an AND gate may have an infinite number of input probes.

### NAND Gate

**Truth Table**

This is a NOT-AND gate, a combination of an AND gate and a NOT gate. If any of the inputs is low, the outputs of all NAND gates are high. An AND gate with a little circle on the output is the symbol. The little circle represents inversion.

### NOR Gate

**Truth Table**

This is a NOT-OR gate, a combination of an OR gate and a NOT gate. If any of the inputs is high, the outputs of all NOR gates are low.

An OR gate with a little circle on the output is the symbol. The little circle represents inversion.

### NOT Gate

**Truth Table**

The NOT gate is a kind of electrical circuit that outputs an inverted version of the input. An inverter is another name for it. The inverted output is NOT A if the input variable is A. As shown at the outputs, this is also displayed as A', or A with a bar over the top. The illustrations below demonstrate two different methods to arrange the NAND logic gate to form a NOT gate. In the same manner, it may be done using NOR logic gates.

### XOR Gate

**Truth Table**

In an XOR gate, the output of a two-input XOR gate achieves state 1 if just the input is added.

The Boolean expression of the XOR gate is

** **

### XNOR Gate

**Truth Table**

The XNOR gate is the XOR gate's opposite. The output level is high only when both of the XNOR gate's inputs are the same, either 0 or 1.

The Boolean expression of the XNOR gate is

Read about __Instruction Format in Computer Architecture__ and __what is middleware__