Call Now
1800-102-2727Imagine you want to compare two binary digits and find out if they are different from each other or not. The question is: how are you going to do that? The answer is an exclusive OR gate. The exclusive OR gate is an important logic gate that is used in various arithmetic, parity-checking, and encryption operations.
Table of Contents:
The exclusive-OR gate, often called the XOR or ex-OR gate, is a logic gate that is made from the basic logic gates of AND, OR, and NOT. The exclusive-OR gate plays a very vital role in digital electronics because it can function as an adder, error detector, and even correction circuit.
The XOR gate produces a high output, i.e., logic "1," when the inputs to the gate are different. It produces a low output, i.e., logic "0," when the inputs to the gate are the same.
When the inputs to the XOR gate are either ‘1 0’ or ‘0 1’, then the output produced by the XOR gate will be high, i.e., ‘1’.
When the inputs to the XOR gate are either ‘0 0’ or ‘1 1’, then the output produced by the XOR gate will be low, i.e., ‘0’.
The symbol of the XOR gate is shown below:

Image: The symbol of the XOR gate
|
A |
B |
Q |
|
0 |
0 |
0 |
|
0 |
1 |
1 |
|
1 |
0 |
1 |
|
1 |
1 |
0 |
From the above table, we can write the expression of Q as

The XOR output is represented as

Thus,

The Exclusive-OR gate is realised by connecting the basic gates of AND, OR and NOT together. The circuit diagram of realising the XOR gate using AND, OR and NOT gates is shown below:

Image: XOR gate using AND, OR and NOT gates.
This circuit is often known as the equivalent circuit of the XOR gate.

Image: 3-input Exclusive-OR gate
While the logic gates AND, OR, NAND and NOR come with 3-input pin ICs, the same cannot be said about the Ex-OR gate. The 3-input XOR gate is only used in theoretical representation for easy understanding. In practicality, a 3-input XOR gate can be created using two 2-input XOR gates in cascade as shown below:

Image:: A 3-input XOR gate created using two 2-input XOR gates
The truth table of a 3-input XOR gate is given below:
|
A |
B |
C |
Q |
|
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 |
From the above truth table, we can derive the expression of Q as

We represent the 3-input XOR gate Boolean expression in short as

Example 1: Implement the XOR gate using only NAND gates.
Solution:

Example 2: Implement the Boolean expression given below using only XOR gates

1. Realise the XOR gate using only NOR gates.
2. Realise the below given Boolean expression using XOR gates only:
Q1. What is the difference between an XOR gate and an OR gate?
Answer: An XOR gate produces a high output when the number of high inputs is odd, while an OR gate produces a high output if any of the inputs is high.
Q2. Can an Exclusive-OR gate have more than two inputs?
Answer: Theoretically, yes, it can have more than two inputs. But practically, the XOR gate does not have 3 inputs.
Q3. How is an Exclusive OR gate used in cryptography?
Answer: XOR gates are used in encryption algorithms to perform bitwise operations on data and encryption keys. They contribute to the generation and manipulation of ciphertext.