Parity Bit
XOR of data bits used for error detection.
Formula
Variables
Example
Detects single-bit errors
How it works
A parity bit is computed by XOR-ing all the data bits together, which produces a single extra bit that summarizes whether the number of 1s in the data is odd or even. This works because XOR flips whenever it sees a 1, so the final result is 1 exactly when there are an odd number of 1s, and 0 when there are an even number of 1s. When the receiver XORs the received data and parity bit again, any odd number of bit flips changes the result, revealing that an error likely occurred.
When to use it
Use a parity bit in simple communication or storage systems where you want lightweight error detection with almost no extra computation. It is common in basic serial links, memory checks, and teaching examples, but it cannot correct errors and misses some multi-bit changes.
Worked example, step by step
Data bits: b1 = 1, b2 = 0, b3 = 1, b4 = 1
Compute the parity bit:
p = b1 ⊕ b2 ⊕ b3 ⊕ b4
p = 1 ⊕ 0 ⊕ 1 ⊕ 1
Step 1: 1 ⊕ 0 = 1
Step 2: 1 ⊕ 1 = 0
Step 3: 0 ⊕ 1 = 1
Final answer: p = 1
So the parity bit is 1, making the total number of 1s in the transmitted message even.
Common mistakes to avoid
- Assuming parity can fix errors instead of only detecting them
- Forgetting that XOR is order-independent and just counts 1s modulo 2
- Using the wrong parity convention and mixing up even parity with odd parity
Did You Know?
A single parity bit can detect an error but not fix it, the simplest form of error checking.
Share this formula
More in Computer Science
View allGustafson’s Law
IntermediateIdeal scaled-workload speedup when more processors allow a larger parallel task in the same elapsed time. Here s is the serial fraction of the parallel execution time, not the single-processor fraction used in Amdahl’s law.
Hick–Hyman Law (Equal Choices)
IntermediateModels choice reaction time for n equally likely alternatives (n ≥ 1). This information-theoretic form assumes comparable, practised stimulus–response choices; it is not a universal law of menu browsing.
Fitts’s Law (Shannon Form)
IntermediateAn empirical model of aimed movement time: farther or narrower targets generally take longer to reach. Use D ≥ 0, W > 0 and fitted coefficients for the device and task.
Shannon Entropy
AdvancedAverage information content of a random source (bits).
Master Theorem (form)
AdvancedAnalyzes running time of divide-and-conquer algorithms.
Hamming Distance
AdvancedNumber of positions at which two strings differ.