XOR gate circuit diagram using only NAND or NOR gate

XOR gate or Exclusive OR gate is a widely used logic gate in digital electronics. It is one of the logic gates in the Computer which is available in IC form. We discussed basic logic gates like OR gate, AND gate and NOT gate earlier in another article. XOR gate can be constructed using only basic logical gates, NAND gates and NOR gates separately. In this article, we’re to discuss the XOR logic gate, its Boolean expression and Truth table. The circuit diagrams of XOR gate using only NAND gate or NOR gate are designed and explained as well.

Contents of this article:

  1. What is XOR gate?
  2. Boolean expression of XOR gate
  3. Circuit diagram of XOR gate
  4. Truth Table of XOR gate
  5. XOR gate using NAND gate
  6. XOR gate using NOR gate
  7. Application of XOR gate

What is XOR gate?

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

XOR gate Boolean expression

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

Y=A\overline{B}+\overline{A}B

or, Y=A\oplus B

This is the XOR gate formula. For a three-input XOR 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 using basic logic gates

One can draw the circuit diagram for an XOR gate in many ways by using the different combinations of NAND, NOR, NOT, AND, OR gates. The XOR logic circuit can also be designed by using only NAND gates or only NOR gates which are discussed at the end. This section shows how to design XOR logic circuit using basic logic gates i.e. by using AND, OR and NOT gates. Figure-1 gives the XOR gate schematic diagram and Figure-2 shows the symbol of XOR gate.

Circuit diagram of XOR gate using Basic logic gates
Figure-1: Circuit diagram of XOR gate using Basic logic gates
XOR gate circuit symbol
Figure-2: XOR gate circuit symbol

Truth Table of XOR gate

Table-1 and Table -2 are the Truth tables for XOR gate with two inputs and three inputs respectively.

Input (A)Input (B)Output, \small Y=A\overline{B}+\overline{A}B
000
011
101
110
Table-1 : Truth Table for Two Input XOR gate
Input (A)Input (B)Input (C)Output, \small Y=A\oplus B\oplus C
0000
0011
0101
0110
1001
1010
1100
1111
Table-2: Truth Table for Three input XOR gate

XOR gate using NAND gate

One can construct an XOR gate using a minimum of four NAND gates. However, It is also possible to design an XOR gate using more than four NAND gates. The following figure shows the circuit diagram for the implementation of a two-input XOR gate using four NAND gates.

Circuit diagram of XOR gate using NAND gates
Figure-3: Circuit diagram of XOR gate using NAND gates

Derivation of the output of NAND gate-based XOR circuit

de Morgan theorem and Boolean Algebra are used to derive the output equation of the above circuit of XOR gate using NAND gates. The used relations are \small\color{Blue}A.\bar{A} =B.\bar{B} = 0 and \small\color{Blue}\overline{AB} = \bar{A} + \bar{B}.

Let’s derive the output of the circuit!

Thus the output of the above circuit is the same as the output of an XOR gate. Hence the above circuit represents the circuit diagram of Exclusive OR gate using NAND gates.

XOR gate using NOR gate

To design the circuit diagram of an XOR gate using only NOR gates, a minimum of five NOR gates are required. XOR gate can be contained by more than five NOR gates as well. The following figure is the schematic diagram of XOR gate using five NOR gates.

Figure-4: Circuit diagram of XOR gate using only NOR gates

Derivation of the output of NOR gate-based XOR circuit

Here is how to obtain the output of XOR gate from the above circuit –

This is the output of the XOR gate. Hence the above NOR gate-based circuit is the circuit of XOR gate.

Thus the output of the above circuit is the same as the output of an XOR gate. Hence the above circuit represents the circuit diagram of Exclusive OR gate using NAND gates.

Application of XOR gate

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

This is all from this article on the implementation of XOR gate, its diagram and truth table.

Any doubts on this topic can be asked in the comment section. If you are looking for someone to help with your physics assignments, please delegate your Do my physics homework for me to experts from “MyAssignmentLab“.

Thank you!

Related Posts:

  1. XNOR gate using NAND gate and NOR gate only
  2. Basic logic gates using NAND gates only
  3. Basic logic gates with Truth Table and diagram – OR, AND, NOT gate
  4. NAND gate
  5. NOR gate