Skip to content
BetterDL

Parity bit

Also called: check bit, even parity, odd parity, parity generator, parity checker, parity check

An extra bit added to data so the total number of 1s is even (even parity) or odd (odd parity), letting a receiver detect any single flipped bit.

A parity bit is one extra bit sent or stored with a group of data bits so that a single-bit error can be detected.

The sender and receiver agree on a scheme first:

  • Even parity: the data bits plus the parity bit together contain an even number of 1s.
  • Odd parity: together they contain an odd number of 1s.

Generating the bit takes nothing but XOR gates:

  • Even parity: P = XOR of all data bits. If the data already has an even count, P = 0; if odd, P = 1.
  • Odd parity: P is the complement of that XOR.

Checking is just as cheap. The receiver XORs every bit it got, parity bit included. Under even parity the result should be 0. A result of 1 means an odd number of bits flipped, most likely one.

Limits worth knowing:

  • Parity detects any odd number of flipped bits but misses an even number, since two flips leave the count's parity unchanged.
  • It can't say which bit flipped, so it can't correct anything. Codes that correct errors use several check bits and rely on hamming distance.

The circuit that makes the bit is a parity generator, and the one that tests it is a parity checker. Both are XOR trees computing the odd function.

ABCDP

Worked example

Example

Sending and checking 4 data bits

Data bits ABCD = 1101 are sent with an even-parity bit P, using the generator above.

  1. 1.

    Count the 1s in 1101: three, which is odd.

  2. 2.

    So P = 1, making the total four 1s, which is even. The generator agrees: A ⊕ B = 0, C ⊕ D = 1, and 0 ⊕ 1 = 1.

  3. 3.

    The five bits 11011 are sent.

  4. 4.

    Noise flips the third bit, and 11111 arrives. The receiver XORs all five: five 1s is odd, so the result is 1. Error detected.

  5. 5.

    Under odd parity instead, P would be 0, so that 11010 holds three 1s.

Common mistakes

  • Mixing up the schemes. Even parity makes the total count even, which means P = 1 when the data count is odd.

  • Believing parity can fix errors. It only signals that something went wrong.

  • Assuming every error is caught. Two flipped bits cancel out and pass the check.

Practice Parity bit

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Parity bit is taught in Logic Gates and Combinational Logic.