Navigation

Authors

Useful programs

Logic Gates Extras

 

XOR/XNOR Gates

 

The XOR and XNOR gates perform opposite operations, they both can have two or more inputs but only a single output.

 

XOR Gate

The "X" in XOR stands for exclusive. This means that the XOR gate performs the function of the OR gate but only if there is a single 1 and 0. If either input is true (1) then the other input is false (0) then the output is true; if the inputs are both the same then the output is false(0)

The Boolean equation of the logic gate is:

Based on this equation we can find out all possible results of different outputs. This gate can have two or more inputs. Below is the truth table that shows the outputs for all the different input combinations for a two-input XOR gate.

The truth table and Venn diagram below represent the different inputs and outputs of the gate. For more information on truth tables and Venn diagrams, click here.

Truth Table: XOR Gate - 2 Inputs
Input Output
0 0 0
0 1 1
1 0 1
1 1 0

Below, we have provided GIF animations to represent the function of the gate.

XOR Gate: Input = 00 XOR Gate: Input = 01



XOR Gate: Input = 10 XOR Gate: Input = 11

Application

XOR gates can be used for a variety of different application. One practical use is for lights with multiple switches. If you switch the light at either place, the current state of the light will change. If both the switches are at 0, then the lights are off. Once you switch the first switch to 1 the lights are turned on. When the second switch is turned on to 1 or the first light is switch back off then the light would turn off again. This shows how an XOR gate would function in electrical circuits around your home.





Above is the traditional symbol that represents a XOR gate.


Above is the International Electrotechnical Commission (IEC) symbol for the gate.
 
 

XNOR Gate

A XNOR gate, also known as an exclusive NOR gate, does the function of the XOR gate and then negates it. This means that if the result was one it would change it to zero and vice versa. A XNOR gate also has two or more inputs but only a single output. This negated function is done on the XOR gate by putting a small circle at the end of it. As you can see to the right, the symbol is identical to the XOR gate but with a little circle.

The Boolean equation of the logic gate is:

Based on this equation we can find out all possible results of different outputs. This gate can have two or more inputs. Below is the truth table that shows the outputs for all the different input combinations for a two-input XNOR gate.

The truth table and Venn diagram below represent the different inputs and outputs of the gate. For more information on truth tables and Venn diagrams, click here.

Truth Table: XNOR Gate - 2 Inputs
Input Output
0 0 1
0 1 0
1 0 0
1 1 1

Below, we have provided GIF animations to represent the function of the gate.

XNOR Gate: Input = 00 XNOR Gate: Input = 01



XOR Gate: Input = 10 XNOR Gate: Input = 11

Application

A XNOR gate can be used in a variety of different applications. One example of a XNOR gate in used is in a heat exchanger tank. In the tank, the water can not be too high or too low. There are sensors at both those points. When the water is in the correct range, it is only triggering the lower sensor so there is an input of 1 and 0. Since the output is 0 the alarm won't sound. However when the water is too high and both sensors are at one, or if it is too low and both sensors are at 0, the output will be 1 and the alarm will sound.





Above is the traditional symbol that represents a NOR gate.


Above is the International Electrotechnical Commission (IEC) symbol for the gate.