Open In App

What is the Difference Between XOR and XNOR Gate?

Last Updated : 25 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In electronics, Logic Gates are termed as “building blocks of digital circuits”. These gates are used to perform logical operations on single or multiple binary values. In the term “Logic Gate”, a Gate represents a circuit that controls the incoming electric signals. Hence, Logic Gates are those digital circuits through which electric signals can pass only when a given logical condition is true.

Although the logic gates take single or multiple binary input, it returns only a single value as output. There are several logic gates like: AND, OR, NOT, NAND, NOR, XOR, and XNOR. In this article, we will be focusing on the difference between XOR and XNOR Gate.

NOTE: Before studying logic gates one should know that in digital theory 1 indicates True (On state) and 0 indicates False (Off state).

XOR Gate

It is termed as “Exclusive Or Gate”. XOR gate performs a logical operation on input binary values by returning TRUE (High/1) only if there are an even number of true values in the input. In all other cases, the output value is FALSE (or LOW/0). For example, if the input values are 1 and 0 the output will be 1 or true (because an odd number of true values is present ). On the other hand, if the input is 1 and 1 OR 0 and 0 then the output will be false (because even number of true and false values are present respectively)

Why is it called Exclusively OR gate?

It is called so because the gate is similar to a standard OR gate. In the OR gate, the output is true if at least one value in the input is true. However, in XOR gate the output value will be true only when an odd number of input values are true, hence the term “exclusive”.

Logic Gate Of XOR

Logic Gate Of XOR

Logic Gate Of XOR

Truth Table of XOR Gate

Truth table of XOR Gate

Truth table of XOR Gate

Circuit of XOR Gate

The Boolean expression for XOR gate is: AB’ + A’B or A⊕B

The XOR gate can be represented by a Combination of two Not gates, two And gates and one Or gate as shown below.

Circuit of XOR Gate

Circuit of XOR Gate

Applications Of XOR Gate

  • Used in addition circuits to perform operations like binary addition and subtraction
  • Determines parity of binary number (total number of 1’s are even or odd)
  • Used as switchable inverters.

XNOR Gate

It is termed as “Exclusively NOR gate”. XNOR gate is basically a XOR gate added with a NOT gate. It is just the opposite or inverse of the XOR gate. In this gate the output is true (HIGH/1) if both the input values are same (i.e. both 0 or both 1). Other cases the output will be false (LOW/0).

Why is it called Exclusively NOR Gate?

It is called so because it is similar to the XOR gate but just the inverse of it. The NOT gate is added next to the XOR gate to make it “exclusively NOR or XNOR” gate.

Logic Gate Of XNOR

Logic Gate of XNOR

Logic Gate Of XNOR

Truth table of XNOR Gate

Truth table of XNOR Gate

Truth table of XNOR Gate

Circuit of XNOR Gate

The Boolean expression for XNOR gate is: AB + A’B’ or A ⊙ B

The XNOR gate can be represented by a Combination of two Not gates, two And gates and one Or gate as shown below:

Circuit of XNOR Gate

Circuit of XNOR Gate

Applications Of XNOR

  • Used to check the parity of binary numbers and hence prevents any kind of error.
  • Used for performing arithmetic operations.
  • Also checks equality between two binary numbers.

Summary

XOR Gate

XNOR Gate

It is termed as “Exclusive OR Gate”.

It is termed as “Exclusive NOR Gate”.

Similar to OR Gate

Similar to XOR Gate with a NOT Gate added

The Boolean expression for XOR is:

AB’ + A’B or A⊕B

The Boolean expression for XNOR is:

AB + A’B’ or A ⊙ B

It returns true output when odd number of inputs are true

It returns true only when both the inputs are equal

Truth Table:

Screenshot-2023-09-23-014506

Truth Table:

Screenshot-2023-09-23-014418

Applications:

• Used in addition circuits to perform operations like binary addition and subtraction

• Determines parity of binary number (total number of 1’s are even or odd)

• Used as switchable inverters.

Applications:

• Used to check the parity of binary numbers and hence prevents any kind of error

• Used for performing arithmetic operations

• Also checks equality between two binary numbers

Frequently Asked Questions

Q.1: Can XOR and XNOR gates be used with more than two inputs?

Answer:

Yes, XOR and XNOR gates can be used with more than two inputs. Here is an example of XOR Gate with 3 inputs:

Screenshot-2023-09-23-021424

XOR GATE with 3 inputs

Q.2: Are XOR and XNOR Gates Universal Gates?

Answer:

No, they are derived gates because they cannot be used individually to implement Boolean functions.

Q.3: How is XOR different from XNOR Gate?

Answer:

XOR gates return the output as true only when the number of true inputs is odd, while XNOR gates return the output as true when the inputs are same.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads