๐งฎ Parity Bits in Digital Systems
๐ง Motivation
โน๏ธ
Why we invented this Parity bits offer a lightweight method for error detection in digital communication and storage.
By encoding the evenness or oddness of 1s in a binary word, parity bits help verify data integrity without heavy computational overhead.
๐ฃ What Is a Parity Bit?
A parity bit is an extra bit appended to a binary word to encode whether the total number of 1s is even or odd.
- โ Even Parity: Parity bit is set so that the total number of 1s (including the parity bit) is even.
- ๐งจ Odd Parity: Parity bit is set so that the total number of 1s (including the parity bit) is odd.
๐ Examples
| Data Bits | Even Parity Bit | Odd Parity Bit |
|---|---|---|
1010 | 0 | 1 |
1101 | 1 | 0 |
1001 | 0 | 1 |
โ๏ธ How Parity Is Computed
๐ง XOR Method (Efficient)
Parity bit = XOR of all data bits
For 8-bit data:
P = Dโ โ Dโ โ Dโ โ Dโ โ Dโ โ Dโ
โ Dโ โ Dโ- Even parity: use result directly
- Odd parity: invert the result
๐งฎ Counting Method (Conceptual)
Count the number of 1s:
- If even โ parity bit = 0 (for even parity)
- If odd โ parity bit = 1 (for even parity)
๐งท Visual Anchor: XOR Cascade for 8-bit Parity
Dโ โโฌโ XOR โโฌโ XOR โโฌโ XOR โโฌโ XOR โโฌโ XOR โโฌโ XOR โโฌโ XOR โโบ Parity Bit
โ โ โ โ โ โ โ
Dโ Dโ Dโ Dโ Dโ
Dโ Dโ๐ก๏ธ Error Detection Using Parity
โ Detection Steps
- Generate parity bit at sender
- Transmit data + parity bit
- Receiver recomputes parity from received data
- Compare with received parity bit
โ ๏ธ Limitations
- Can detect odd bitflips
- Cannot detect even bitflips
- Cannot correct errorsโonly detect
Last updated on