Exclusive-OR and Exclusive-NOR Gates
The Exclusive-OR Gate
The XOR gate produces a HIGH output only when both inputs are at opposite logic levels.
Example waveforms for XOR:
Notice that the XOR gate will produce a HIGH only when exactly one input is HIGH.
The Exclusive-NOR Gate
The XNOR gate produces a HIGH output only when both inputs are at the same logic level.
Example waveforms for XNOR:
Notice that the XNOR gate will produce a HIGH when both inputs are the same. This makes it useful for comparison functions.
Parity Generator/Checker
- One important application of the use of an Exclusive-OR gate is to generate parity.
- Parity is used to detect errors in transmitted data caused by noise or other disturbances.
- A parity bit is an extra bit that is added to a data word and can be either odd or even parity.
- In an even parity system, the sum of all the bits (including the parity bit) is an even number
In an odd parity system the sum of all the bits must be an odd number.
- The circuit that creates the parity bit at the transmitter is called the parity generator.
The circuit that determines if the received data is correct is the parity checker.
- Parity is good for detecting a single bit error only.
- The parity generator and the parity checker can both be built using Exclusive-OR gates.
- To generate even parity the bits of data are Exclusive-ORed together in groups of two until there is only a single output left. This output is the parity bit.
- To generate odd parity, simply invert the even parity.The last gate can be an Exclusive-NOR gate.
- To check parity first a new parity bit must be generated over the date that was received. This parity bit is then compared to the received parity bit. If they are the same, then all is ok. The comparison can be done with an Exclusive-OR gate.
- The 74280 is a TTL IC parity generator/checker circuit.
System Design Applications
- Exclusive-OR circuits can be used to generate a parity check bit.
- Exclusive-NOR circuits can be used to compare two binary data words and determine if they are exactly the same.
- Exclusive-OR gates can be used to complement (controlled inverter) a binary data word.
Additional Notes
The Exclusive-OR function is one of the most useful of the special logic functions. The Exclusive-OR is sometimes also called the "Either/OR but not Both" function. With only two inputs, the output is true if either of the inputs is true but not both of the inputs. Another way to say this is that the output is true if both of the inputs are the opposite of each other.
Although the Exclusive-OR is a special function, it is most convenient to use the Exclusive-OR in its SOP form (). Although the special symbol Å can be used to identify the Exclusive-OR, there are no rules in the Boolean Algebra to deal with this special formula. If the Exclusive-OR symbol is encountered in a Boolean Expression, it should be converted to its SOP form before any reduction process is started.