XOR gate or Exclusive OR gate is a widely used logic gate in digital electronics. It is one of the logic gates which is **available in IC form**. We have discussed the **basic logic gates like OR gate, AND gate and NOT gate** earlier in another article. In this article, we are going to discuss the XOR logic gate, its Boolean expression, Truth Table and circuit diagram using only NAND or NOR gate.

**Contents in this article:**

*What is XOR gate?**Boolean expression of XOR gate**Circuit diagram of XOR gate**Truth Table of XOR gate**XOR gate using NAND gate**XOR gate using NOR gate**Application of XOR gate*

**What is XOR gate?**

XOR gate is also known as Exclusive OR gate or Ex-OR gate. It gives the output 1 (High) if odd number of input is 1. This can be understand in the Truth Table. It can have infinite number of inputs and only one output. In most of the cases two-input or three-input XOR gates are used.

**Boolean expression of XOR gate**

We consider a two-input XOR gate with inputs A and B. If Y be the output of the gate then Boolean expression relating the inputs and the output is,

Y=A\overline{B}+\overline{A}Bor, Y=A\oplus B

For three input XOR logic gate, the Boolean expression is Y=A\oplus B\oplus C, where A, B and C are the inputs.

**Circuit diagram of XOR logic gate**

One can draw the circuit diagram for a XOR gate in many ways by using the different combinations of NAND, NOR, NOT, AND, OR gates. Also, XOR logic circuit can be designed by using only NAND gates or only NOR gates which are discussed later. Here we have designed XOR logic circuit by using **basic logic gates** i.e. by using AND, OR and NOT gates. Figure-1 shows the circuit diagram and figure-2 shows the symbol of XOR gate.

**Truth Table of XOR gate**

Table-1 and Table -2 shows the Truth Table for two input and three input XOR gate respectively.

Input (A) | Input (B) | Output, \small Y=A\overline{B}+\overline{A}B |

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

**Table-1 :**

**Truth Table for Two Input XOR gate**

Input (A) | Input (B) | Input (C) | Output, \small Y=A\oplus B\oplus C |

0 | 0 | 0 | 0 |

0 | 0 | 1 | 1 |

0 | 1 | 0 | 1 |

0 | 1 | 1 | 0 |

1 | 0 | 0 | 1 |

1 | 0 | 1 | 0 |

1 | 1 | 0 | 0 |

1 | 1 | 1 | 1 |

**Table-2: Truth Table for Three input XOR gate**

**XOR gate using NAND gate**

One can construct an XOR gate by using **minimum four NAND gates**. However, It is also possible to design an XOR gate using more than four NAND gates. Here, we will draw the circuit diagram of two input XOR gate by using four NAND gates.

**XOR gate using NOR gate**

To design the circuit diagram of an XOR gate using only NOR gates, **minimum five NOR gates** are required. Also, one can design the same with more than five NOR gates. Here is the schematic diagram of XOR gate using five NOR gates.

**Application of XOR gate**

XOR gate has wide uses in **arithmetic section of the computer**. In the Truth Table of two input XOR gate one can see that circuit shows output as high (1) when inputs are unequal (when one is 0 and other is 1). Thus, two input XOR gate acts as an **inequality detector**.

This is all from this article on XOR gate diagram and truth table. If you have any doubt on this topic you can ask me in the comment section.

Thank you!

**Related Posts:**

**All the logic gates with Truth Table and diagram – OR, AND, NOT gate****NAND and NOR gate as Universal Logic gates**

## 2 thoughts on “XOR gate circuit diagram using only NAND or NOR gate”