5 / 63 · Concepto
XOR and XNOR: difference, equality and parity
Distinguish two-input XOR from multi-input parity and explain its detection limits.
Las lecciones se pueden leer gratis. Inscríbete para guardar el progreso.
La traducción aún no está disponible. Se muestra la lección original. (English)
Difference and equality
Two-input XOR is 1 when its inputs differ; XNOR is 1 when they agree:
OR and XOR differ at 11. In these symbols, the extra input-side curve marks XOR and an output circle makes it XNOR.
| a | b | y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
More inputs mean odd parity
For three inputs, is 1 when an odd number of inputs are 1. It is not an “exactly one” test: 111 also gives 1. The full-adder sum is this parityparity Whether the number of one bits is odd or even. Parity detects an odd number of bit flips but can miss an even number. function, while its carrycarry The value carried from one addition column to the next. The final carry and signed overflow are different conditions. Learn more is a majority function.
a + b + cin = sum + 2 × cout
At 111, sum=1 and cout=1 represent the integer sum .
What parity can detect
For data 1011, the even-parity bit is 1. XOR of the data and parity bit is therefore zero. Any odd number of flips changes that check to one. Even numbers of flips can escape detection, and one parity bit cannot locate the error.
Vector equality needs an OR of bit mismatches, followed by inversioninversion The NOT operation exchanges 0 and 1. An overline applies NOT to the entire expression covered by the line. Learn more:
XOR-reducing the mismatches instead would allow two differences to cancel.
Inténtalo tú
Find A XOR B and equality for A=1010, B=1001. What goes wrong if equality is inferred from XOR-reducing the mismatch vector?
Leer la explicación
The mismatch vector is 0011 and equality is 0. XOR-reducing two mismatches gives zero; inverting that would incorrectly indicate equality. OR-reduce the mismatches instead.