The XNOR gate is a logic gate that performs an exclusive NOR operation. 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(either both true or both false). For different inputs, the output of the XNOR gate is logic 0. Hence, the XNOR gate is used to implement similarity checker circuits. It is also known as the material biconditional. This logic gate is denoted by this sign "⊙".
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 SymbolTruth 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.
Truth Table of XNOR GateOperation 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
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 TransistorThe 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 GateThe 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
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.
Similar Reads
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Python Variables In Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i
6 min read
Spring Boot Interview Questions and Answers Spring Boot is a Java-based framework used to develop stand-alone, production-ready applications with minimal configuration. Introduced by Pivotal in 2014, it simplifies the development of Spring applications by offering embedded servers, auto-configuration, and fast startup. Many top companies, inc
15+ min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi
6 min read
What is an Operating System? An Operating System is a System software that manages all the resources of the computing device. Acts as an interface between the software and different parts of the computer or the computer hardware. Manages the overall resources and operations of the computer. Controls and monitors the execution o
9 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read