Exclusive-OR (XOR) Gate: Truth Table, Boolean Expression, Circuit & Applications

Introduction

The Exclusive-OR (XOR) Gate is a digital logic gate that produces a HIGH output only when its inputs are different. Unlike a standard OR gate, the XOR gate outputs logic 1 only if one input is HIGH and the other is LOW. Due to this unique behavior, XOR gates are widely used in arithmetic circuits, digital comparators, error detection systems, and data encryption applications.

The Exclusive-OR (XOR) gate is one of the most commonly used digital logic gates in electronic circuits. It plays a vital role in arithmetic operations such as binary addition and is widely used in error detection and correction circuits. Although the XOR gate can be implemented by combining basic logic gates, its Boolean function is so important that it is considered a separate logic gate. Along with its complement, the Exclusive-NOR (XNOR) Gate, it belongs to the family of hybrid logic gates.

ADVERTISEMENT

The XOR gate is frequently used in:

What is an Exclusive-OR (XOR) Gate?

An Exclusive-OR (XOR) Gate is a digital logic gate whose output is HIGH (1) only when the input values are different. If both inputs are the same, the output remains LOW (0). Because it performs modulo-2 addition of binary numbers, the XOR gate is commonly referred to as a Modulo-2 Adder.

2-Input XOR Gate Symbol

The XOR gate is represented by the OR gate symbol with an additional curved line at the input side.

Truth Table of 2-Input XOR Gate

A B Output (Q)
0 0 0
0 1 1
1 0 1
1 1 0

Boolean Expression:

Q = A ⊕ B

This expression means:

“A OR B, but NOT both.”

Working Principle of XOR Gate

The Exclusive-OR gate compares two binary inputs and generates a HIGH output only when the inputs are different.

The output conditions are:

In simple terms, the XOR gate produces an output of 1 only when the number of HIGH inputs is odd.

Boolean Expression of XOR Gate

The Boolean expression for a two-input XOR gate is:

Q = A ⊕ B

This can also be written as:

Q = A’B + AB’

where:

This expression indicates that the output is HIGH only when one input is HIGH and the other is LOW.

3-Input XOR Gate

A three-input XOR gate produces a HIGH output whenever an odd number of inputs are HIGH.

Truth Table of 3-Input XOR Gate

A B C Output (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

Boolean Expression:

Q = A ⊕ B ⊕ C

The output becomes HIGH whenever the number of logic 1 inputs is odd.

XOR Gate Implementation

Although the XOR gate is treated as a separate logic gate, it can be implemented using basic logic gates.

The Boolean expression is:

Q = A’B + AB’

This implementation requires:

An XOR gate can also be implemented using only NAND gates, making it suitable for integrated circuit design.

Advantages of XOR Gate

Disadvantages of XOR Gate

Applications of XOR Gate

Conclusion

The Exclusive-OR (XOR) gate is one of the most important digital logic gates used in modern electronic systems. Its ability to identify differences between input signals makes it an essential component in arithmetic operations, digital communication, error detection, and cryptographic systems. Due to its versatility and high-speed operation, the XOR gate is widely used in computers, microprocessors, embedded systems, and digital electronics.