**Logic gates**

Logic gates are the basic building blocks of any digital system. Logic gates are electronic circuits. It has one or more inputs and only one output. The relationship between input and output is based on a particular logic.

In this, the input and output are in binary form, that is, the value of input / output will be only 0 (low) and 1 (high).

You can also read: What Is Boolean Algebra In Computer Science

**Types of logic gates**

Generally, there are three types of logic gates –

- AND gate
- OR gate
- NOT gate

There are many other types of logic gates which are based on these three logic gates. like :-

NAND GATE, NOR GATE, XOR gate.

**AND Gate**

**AND Gate**

AND GATE has two or more inputs but only one output. The output of AND GATE is high only when all the inputs are high. AND GATE performs the multiplication operation on two or more inputs. The operation of AND GATE is represented by (.).

Ex: X= A AND B

X= AB

### Logical Diagram of AND Gate

### Truth Table of And

A | B | A.B |
---|---|---|

0 | 0 | 0 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

**OR GATE **

OR GATE consists of two or more input signals and only one output signal. It is called OR GATE because the output is high when any one input or all the inputs are high. In OR GATE, addition operation is performed on two or more inputs. OR GATE operation is represented by (+) symbol.

Ex: X=A OR B

X= A+B

**Logic Diagram** of OR Gate

**Logic Diagram**

**Truth Table** of OR Gate

**Truth Table**

A | B | A+B |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 1 |

**What is a logic gate and what are its types?**

## Not Gate

NOT GATE has only one input and one output because its output state is opposite to the input state. That is, the input is high when the output is low. NOT GATE is also called complement, negation or inverter. The NOT GATE operation is displayed with a bar or (¯) symbol.

Ex: X = NOT A

X = A’

**Logic Diagram** of NOT Gate

**Truth Table** of NOT Gate

A | A’ |
---|---|

0 | 1 |

1 | 0 |

**NAND GATE**

**NAND GATE**

On adding an AND GATE with NOT GATE, a new GATE is obtained which is called NAND GATE. It performs NOT and AND operations. What is NAND GATE is a compliment (¯) of AND GATE.

Ex: X = A NAND B

X = (AB)’

**Logic Diagram** of **NAND Gate**

**NAND Gate**

**Truth Table** of **NAND Gate**

**NAND Gate**

A | B | (A.B)’ |
---|---|---|

0 | 0 | 1 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

**NOR GATE**

**NOR GATE**

It is a combination of NOT and OR GATE. The GATE obtained by adding a NOT GATE and an OR GATE is called NOR GATE. What is NOR GATE is a compliment to OR GATE.

Ex: X = A NOR B

X = (A+B)’

**Logic Diagram** of **NOR Gate**

**NOR Gate**

### Truth Table of **NOR Gate**

**NOR Gate**

A | B | (A+B)’ |
---|---|---|

0 | 0 | 1 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 0 |

**XOR GATE**

XOR GATE is widely used in digital circuits although it is not a basic operation but it can be constructed using basic GATES (AND, OR, NOT) or by using universal GATE (NAND or NOR).

XOR can be used in half adder, full adder, and subtractor. XOR is also called Ex-OR.

**Logic Diagram** of XOR Gate

**Logic Diagram**

**Truth Table** of XOR Gate

**Truth Table**

A | B | A⊕B |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

## Conclusion

If you liked this post of logic gates, then share it with your friends. And if you have any questions related to logic gates then you can ask in comment.