For bits , repeated exclusive or computes the parity of the number of ones:
An induction proves this: the first bit gives its own parity, and appending a zero preserves it while appending a one changes it. The binary string has three ones, so its parity bit is one. Append that parity bit to obtain , whose six bits have even parity. Flipping the second bit produces and changes the combined exclusive or to one, detecting an error. Flipping the third bit as well produces , with four ones and combined exclusive or zero: an even number of flips can escape this check.
For three inputs, repeated exclusive or means an odd number of true inputs, rather than exactly one: . The “exactly one” description applies to the two-input exclusive or. This distinction matters when translating a requirement that exactly one option be selected into a program condition.

Articles by others on the same topic (0)

There are currently no matching articles.