The Wayback Machine - https://web.archive.org/web/20240822193039/https://www.geeksforgeeks.org/xnor-gate/
Open In App

XNOR Gate

Last Updated : 23 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In digital electronics, the XNOR gate is a type of logic gate used to perform an exclusive NOR gate. It is a special type of logic gate used in digital circuits. An XNOR gate, also known as an equivalence gate or an EX-NOR gate, is a digital logic gate that outputs true (1) when an even number of true inputs are present. It produces a true output if both of its inputs are the same (either both true or both false). It is also known as the material biconditional. This logic gate is denoted by this sign “⊙”.

What is an XNOR Gate?

An XNOR gate is a specially designed logic gate having only two inputs and one output. The output of the XNOR gate is logic 1 when both the inputs are logic 1 or logic 0. In other words, the output of the XNOR gate is logic 1 when both the inputs are the same. For different inputs, the output of the XNOR gate is logic 0. Hence, the XNOR gate is used to implement similarity checker circuits.

We can design an XNOR gate by combining two logic gates namely, the XOR gate and the NOT gate. Hence, we can state that

XNOR Gate = XOR Gate + NOT Gate

I. e., an XNOR gate is an XOR gate followed by a NOT gate.

The most important point to note about the XNOR gate is that it can have only two inputs. We cannot design an XNOR gate having three or more inputs. If we need an XNOR gate with three or more inputs, then we combine multiple two-input XNOR gates together to implement a circuit that can take three or more inputs and perform XNOR operation on them.

XNOR Gate Logic Symbol

The logic symbol of an XNOR gate is depicted in the following figure. It has two inputs represented by A and B, and one output line represented by Y.

XNOR-gate

XNOR GATE

Truth Table of XNOR Gate

The truth table is a logical table that shows the relationship between inputs and output of an XNOR gate and provides information about the operation of the gate. In XNOR gate the Output is high (1) when both inputs are same (either both 0 or both 1), and low (0) when the inputs are different.

Inputs

Output

A

B

Y

0

0

1

0

1

0

1

0

0

1

1

1

Operation of XNOR Gate

The following is the Boolean expression of the XNOR gate,

Y = A ⊙ B

Here, A and B are the input variables and Y is the output variable.

This expression can also be written as follows,

Y = AB + A’B’

We can also express the operation of an XNOR gate using XOR gate logic as follows:

Y = (A ⊕ B)’

Equivalent Gates

Now we will see how we can form XNOR gate using Different Logic gate and Transistors

XNOR Gate using Basic Logic Gates

The following figure shows the circuit diagram of an XNOR gate using basic logic gates i.e., AND, OR, and NOT gates.

Logic Diagram of 2-Input  XNOR Gate

Logic Diagram of 2-Input XNOR Gate

This circuit operates as an XNOR gate and produces a logic 1 or logic 0 output depending on the inputs applied to it.

Implementation of XNOR Gate using Transistor

We can implement the XNOR gate using bipolar junction transistors. The schematic circuit diagram of the XNOR gate using transistors is shown in the following figure.

XNOR Gate Representation in Terms of Transistor

XNOR Gate Representation in Terms of Transistor

The circuit depicted above presents an efficient approach to constructing an XNOR gate using only five transistors. There are some other ways to create it using 10 transistors, which is not suggested. So here we will create an XNOR gate using 5 transistors.

The initial pair of transistors on the left serves the function of a NAND gate, while the middle transistor acts as a switch. The last two transistors fulfill a role similar to that of an OR gate. In the provided image, it is evident that both input signals are in the active state, as indicated by the connection of the two resistors on the far left to inputs A and B and the output LED as 0.

This configuration effectively directs the current away from the resistor nearest to the LED, preventing it from flowing toward the left ground. Instead, it guides the current along the path leading to the right ground. Consequently, the output is active, which accounts for the illumination of the LED. Conversely, when both inputs are inactive, the output remains inactive as the current cannot reach the left ground. If only one input is active, the current will travel from the far-right resistor to the middle ground, resulting in the LED remaining unlit.

Let us now discuss how to implement the XNOR gate using NAND Gate and NOR Gate ( Universal Logic Gates).

Implementation of XNOR Gate using NAND Gate

We can also implement the XNOR gate using NAND gates only. For this we require five two-input NAND gates. The circuit diagram of an XNOR gate using NAND gates only is shown in the following figure.

XNOR Gate Construction using NAND Gate

XNOR Gate Construction using NAND Gate

The following are important points about the XNOR gate using NAND gate:

  • To create an XNOR Gate from NAND Gate we will require total 5 NAND gate.
  • The first NAND Gate output will be: (A.B)’
  • Output of the second and third NAND Gate respectively: (A. (A.B)’)’ and (B. (A.B)’)’
  • Output of the fourth output is: ((A. (A.B)’)’. B. (A.B)’)’

Now we can simplify this equation using De Morgan’s Law:

Y = ((A.(A.B)’)’ . B.(A.B)’)’ A.(A.B)’ + b.(A.B)’ A(A’ + B’) +B(A’ + B’) (A + B)(A’ + B’) Y=AB’ + A’B Y= A ⊕ B (This is equal to a XOR Gate output)

So to get the desired output of XNOR Gate, this output will be passed through a NAND Gate again, and then the output will be :

Y = ( A⨁B )’ = A⨀B

Implementation of XNOR Gate Using NOR Gate

We can also implement an XNOR gate using NOR gate. For this, we need five NOR gates that are to be connected together as shown in the following figure. This circuit will operate as an XNOR gate.

XNOR Gate Logic Circuit Using NOR Gate

XNOR Gate Logic Circuit Using NOR Gate

To create a XNOR Gate from an NOR gate it will require five NOR Gate. And we will use De Morgan’s Law again,

Lets consider the inputs are A and B. Output of the first and second NOR Gate will be :

(A+A)’ and (B+B)’

Output of the third and fourth NOR Gate Respectively :

(B+(A+A)’)’ and (A+(B+B)’)’

Then these two output goes to the last and fifth NOR Gate.

Y = ((B+(A+A)’)’ + (A+(B+B)’)’ )’ (B+A’)’ + (A+B’)’ B’.(A’)’ + A’.(B’)’ Y = B.A’+A.B’ = A⨀B

Applications of XNOR Gate

Given Below are some of the Applications of XNOR gate:

  • Comparators: They are used to compare binary values.
  • Binary Arithmetic: XNOR gates are used to detect equal values in binary addition and subtraction.
  • Parity Checking: XNOR gates are utilized to ensure even or odd parity in data.
  • Multiplexers (MUX): They assist in selecting input channels.
  • Latch and Flip-Flop Control: XNOR gates enable or disable storage elements.
  • Decoders: These gates activate specific outputs based on input codes.
  • Clock Synchronization: XNOR gates play a role in synchronizing clock signals.
  • Data Storage: They improve data storage efficiency when combined with SRAM cells.
  • Bi-stable Latching: XNOR gates help maintain stable output states.
  • Control Logic: They are pivotal in sequencing and decision-making.
  • Full Adders and ALUs: XNOR gates are integral in performing arithmetic operations in digital circuits.

Advantages of XNOR Gate

Given Below are some of the Advantages of XNOR gate

  • Simplicity: XNOR gates are known for their straightforward implementation.
  • Dedicated Functionality: They are purpose-built for equality testing.
  • Complementary Outputs: XNOR gates offer complementary output signals.
  • Ease of Integration: They simplify the design of circuits that involve comparisons.
  • Data Reliability: XNOR gates play a crucial role in memory storage, improving data integrity and reliability.

Disadvantages of XNOR Gate

Given Below are some of the Disadvantages of XNOR gate

  • Limited functionality: XNOR gates can only perform equality comparisons and lack versatility for more complex logic operations.
  • Complexity in circuit design: Constructing complex circuits exclusively with XNOR gates can be challenging and less efficient.
  • Input dependency: XNOR gates require an even number of inputs, limiting their flexibility in various applications.
  • Unsuitable for arithmetic operations: Unlike other gates like AND gate and XOR, XNOR gates are not well-suited for arithmetic operations.

Solved Example based on XNOR Gate

Example: A person is making a lift, where the lift will start,

  • only when the current floor and destination floor is given by the user,
  • also, if neither current floor and nor destination floor is given.

Otherwise, it will not start.

Solution:

According to the question let’s build a truth table.

Suppose current floor number input denoted by ‘1’ and input not given denoted by ‘0’;

The same way, the destination floor number given denoted by ‘1’ , and not given denoted by ‘0’.

And starting of the lift is denoted by ‘1’ and not starting is denoted by ‘0’.

Now, possible outcomes are:

Input(A)

Input (B)

Output (A⨀B)

0

0

1

0

1

0

1

0

0

1

1

1

So, according to the question, the lift will start only if both of current and destination floor number is given or neither the current nor destination floor number is given. Otherwise, it will not start. Here we can use an XNOR Gate, as XNOR gate functions are the same, it will print one, only when, both of the input is true, or neither is true.

So the first and the last combination are, when both of the inputs are true, means both of the floor numbers given or none given. In such a case, the lift will start.

The second and third combinations are for when either the current floor number is given, and the destination floor number is not given or either the destination floor number is given, and the current floor number is not given. In both of the cases, the lift will not start.

Conclusion

In this article we have learnt about the XNOR gate. An XNOR gate or equivalence gate or an EX-NOR gate, is a digital logic gate that outputs true (1) when an even number of true inputs are present. It produces a true output if both of its inputs are the same (either both true or both false). This article explains the truth table, symbolic representation, solved example, and applications which helps in better understanding of the article.

Frequently Asked Questions on XNOR Gate – FAQ’S

What is the XNOR Gate?

The XNOR gate is a logic gate that outputs 1 when both the inputs are same and outputs 0 when both the inputs are different. Also, it is the complement of XOR gate.

What is the Algebraic Expression for the XNOR Gate?

The algebraic expression for the XNOR gate is:

Y = AB + A’B’

Is XOR and XNOR Gate Same?

No, XOR and XNOR are two different logic gates where, XNOR is complement of XOR gate.

What is the Output of Exclusive NOR Gate?

The output of exclusive NOR gate is 1 when all the inputs are same otherwise the output is 0.

How Many NOR Gates are Required for XNOR Gate?

The number of NOR gates required for XNOR gate are 4.



Similar Reads

Implementation of XNOR Gate from AOI Gate
Digital electronics revolve around storing data in bits of 1s and 0s. Not only is digital electronics an efficient way of storing data but it also makes it easier to encrypt and secure our data. It is awesome how we can use different logic gates to implement some functions and represent these equations. In this article, we will see how we can repre
6 min read
What is the Difference Between XOR and XNOR Gate?
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 p
4 min read
Difference Between Call Gate, Interrupt Gate, Trap Gate
Gate is used to transfer performance control across all segments. The level of rights assessment is done differently depending on the type of site and the instructions used. Other than that these three gates are almost identical except that Call Gate has parameters for calculating parameters, and that these three gates have different types of field
5 min read
Implementation of NOR Gate from NAND Gate
Implementation of the NOR gate from the NAND gate is possible because NAND is a Universal gate i.e., it can implement all other gates. The NAND gate gives output low when all the inputs are high whereas the NOR gate gives output high when all inputs are low. In this article, we will implement the NOR gate using the NAND gate. Table of Content NOR G
5 min read
Implementation of XOR Gate from AND, OR and NOT Gate
In this article, we will discuss the implementation of XOR gate using AND, OR and NOT Gate. We will discuss about the AND, OR, XOR and NOT gates, and with it, we will discuss about their operations, logic diagrams and truth table. After understanding the gates and their operation we will use those gates to design a combinational circuit to replicat
5 min read
Implementation of AND Gate from NOR Gate
Digital electronics revolves around storing data in bits of 1s and 0s. Not only is digital electronics an efficient way of storing data but it also makes it easier to encrypt and secure our data. It is awesome how we can use different logic gates to implement some functions and represent these equations. In this article, we will see how we can repr
4 min read
Implementation of AND Gate from NAND Gate
It is worth mentioning that Boolean algebra is a fundamental part of the digital electronics field that uses binary variables and logical operations. Think of it as the mind that makes the computers work effectively. Then, imagine that logic gates (AND, OR, and NOT) could be the necessary helpers in the digital world. These gates are the components
5 min read
Implementation of OR Gate from NOR Gate
The Logic gates are the Fundamental Building Blocks of the Digital Circuits. The Logic Gate takes one or more Binary inputs and performs logical Operations to Produce a single binary Output. Understanding through the Different Combinations of gates is important for the Designer to produce the desired functionality in digital circuits. By Understand
5 min read
Implementation of NOT Gate using NOR Gate
Understanding the concept of logic gates is Fundamental to understanding digital logic circuits. Logic gates are the building blocks of digital circuits responsible for performing the logical operations on binary inputs(0s and 1s) to produce a binary Output. There are many gates such as AND, OR, NOT, NAND, and other logical gates but in this Articl
5 min read
Implementation of XOR Gate from NOR Gate
Implementation of the XOR gate from the NOR gate is possible because the NOR gate is a Universal gate i.e., it can implement all other gates. The NOR gate gives the output 1 if all the inputs are 0. XOR gate is a logic gate that gives output 1 when several 1s are odd. In this article, we will explore the XOR gate, and NOR gate and implement the XOR
4 min read
Implementation of NOT Gate using NAND Gate
A universal gate is a logic gate that can be used to implement other types of logic gates. In other words, using a universal gate, you can do all the simple operations like AND, OR, NOT, NAND, and NOR. The two most general purpose NAND gates and NOR gates. These gates are considered universal because they can be used to create all other logic gates
5 min read
Implementation of XOR Gate from NAND Gate
Logic Gates are the building blocks of digital circuits, taking binary values as input and returning a binary value as output after performing a logical operation. There are several kinds of gates available in Digital Electronics like basic gates, and universal gates. Implementation of the XOR gate from the NAND gate is possible because the NAND ga
7 min read
Implementation of OR Gate from NAND Gate
Logic gates are an essential component of digital electronics and are used to handle binary data. Because of its universal nature, the NAND gate is particularly significant among these gates. This article explores the use of NAND gates to implement an OR gate, demonstrating the adaptability and usefulness of these fundamental building blocks. In th
4 min read
Difference Between AND Gate and OR Gate
AND gate and OR gate are basic logic gates. AND gate outputs 1 when all inputs are 1 else output 0. OR gate outputs 1 when at least one input is 1 else output 0. The main difference between AND gate and OR gate is that AND gate represents logical conjunction whereas OR gate represents logical disjunction. In this article we will explore difference
4 min read
Difference Between NAND GATE and NOR GATE
NAND and NOR gates are universal logic gates, which means any Boolean expression can be implemented without using any other gate. Using only NOR gates or only NAND gates all other Boolean expressions can be created unlike other gates. In this article, we will discuss the difference between NAND GATE and NOR GATE.  Table of Content What is NAND Gate
4 min read
Realization of Logic Gate Using Universal gates
In Boolean Algebra, the NAND and NOR gates are called universal gates because any digital circuit can be implemented by using any one of these two i.e. any logic gate can be created using NAND or NOR gates only. Every logic gate has a representation symbol. The below image shows a graphical representation of all logic gates. 1. Implementation of AN
1 min read
Implementing Any Circuit Using NAND Gate Only
A universal gate is such a gate that we can implement any Boolean function, no matter how complex, using a circuit that consists of only that particular universal gate. The NAND & NOR gates are the most commonly encountered universal gates in digital logic. In this article, we will take a look at how to convert any circuit into a circuit that c
6 min read
Insulated Gate Bipolar Transistor
IGBT stands for Insulated Gate Bipolar Transistor. IGBTs find extensive applications in various domains, including household appliances like air conditioners and refrigerators, industrial motors, and automotive main motor controllers. Their utilization of these devices serves to enhance overall energy efficiency. IGBT is also called insulated gates
11 min read
Implementation of NAND Gate using 2 : 1 MUX
In electronics Engineering, Understanding the Concepts of MUX and Logic gates is very important. These components are the building blocks for designing and Constructing complex digital circuits. Multiplexer is a versatile device that plays an important role in data routing and Selection. It enables the selection of one of the several input signals
6 min read
Digital Logic and Design - GATE CSE Previous Year Questions
Solving GATE Previous Year's Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of questions generally asked in the GATE exam, and that eventually helps you to gain good marks in the examination. Previous Year Questions help a candidate practice and revise for GATE, whic
4 min read
NOR Gate
Logic gates are one of the most important elements of digital electronics engineering. It works on the concept of Boolean function. There are several gates in digital electronics, NOR Gate is one of them, which also lies under the Universal Gate because it can be used to implement other basic logic gates like AND, OR, and NOT gate by connecting NOR
7 min read
NOT Gate
This article will explain the concept of NOT gate operation in digital electronics along with its truth table, logic symbol, switching circuit diagram, etc. The NOT gate is one of the main building blocks of Digital Logic Circuits. A NOT Gate, also called an inverter, has only one input and one output. It is a logic gate whose output is always the
8 min read
AND Gate
Logic gates are small digital switching circuit that determines the output of two or more inputted functions in Binary format. Logical '1' means 'True' or 'High' in nature, whereas logical '0' means 'False' or 'Low' in nature. Based on different logical operations, the output differs. There can be many inputs in a logic gate but there will be only
6 min read
NAND Gate
Logic Gates are one of the most important topics in electronics, especially digital electronics. The concept of logic gates relies on the concept of Boolean functions. Logic gates take one or multiple binary values as input and return one binary value as output after doing the logical calculation on them. There are several kinds of GATEs available
7 min read
Implementation of NOR gate using 2 : 1 Mux
In Digital Electronics, the concepts of Gates and Mux are a must to design the Digital circuit. The gates are the building block in Digital electronics and a MUX is a combinational logic circuit used in Digital Electronics. By Combining different types of gates we can design a complex circuit that can be used to perform a specific task. Through a c
6 min read
Implementation of AND gate using 2 : 1 Mux
In Digital Electronics, The concept of the Gates and Multiplexer is Important for Building any Digital Logical Circuit. The Gates are the Building Block of the Digital Electronics. On the Other hand, Multiplexers are an Important Component in Digital Electronics. They Enable the Selection of one data input from the Multiple Lines. Together, These T
5 min read
CMOS Logic Gate
The logic gates are the basic building blocks of all digital circuits and computers. These logic gates are implemented using transistors called MOSFETs. A MOSFET transistor is a voltage-controlled switch. The MOSFET acts as a switch and turns on or off depending on whether the voltage on it is either high or low. There are two types of MOSFETs: NMO
4 min read
OR Gate
The OR gate is known as a primitive digital electronics building block in digital logic. This is one of the logic gates that executes the logical disjunction—a function producing true when at least one input is true. OR gates can be used in applications in digital circuits, computer systems, and other electronic devices. They form the basis of deci
9 min read
XOR Gate
The XOR or Exclusive OR Gate is a special type of logic gate used in digital electronics to perform the exclusive OR operation. The XOR gate takes two inputs and produces an output depending on the combination of the two inputs applied. In, this article will explain the complete theory of the XOR gate along with its truth table, Boolean expression,
9 min read
GATE
This page is no longer maintained on GeeksforGeeks. It is now being maintained @ below link on GeeksQuiz. GATE Corner on GeeksQuiz GATE CS 2016 Syllabus and Important Dates GATE CS Notes GATE CS 2015 Mock Tests GATE CS 2015 Mock Test GATE-CS-2015 (Set 1)(65) GATE-CS-2015 (Set 2)(65) GATE-CS-2015 (Set 3)(65) Topic wise solutions of previous year que
3 min read
three90RightbarBannerImg