4-Bit Parity Generator and Checker
A parity bit is the simplest error check there is: one extra bit that makes the count of 1s odd (or even). If a single bit flips on the way, the count no longer matches. This circuit is 1 when an odd number of A, B, C and D are 1.
Try it live
This is the Circuit Simulator itself, running in the page — it is LogicsBench's own example design, read-only. Open it full size, and sign in to make your own copy to change.
- Flip any one input and watch Odd change every time.
- Flip two at once: Odd stays the same — which is why parity catches one error, not two.
4-bit parity truth table
| A | B | C | D | Odd |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 |
How it works
Odd = A ⊕ B ⊕ C ⊕ D
XOR is 1 when its inputs differ — when an odd number of them are 1. Chaining XORs carries that across any number of bits.
Its K-map is a checkerboard: no two 1s are next to each other, so there is nothing to group and no shorter sum of products than all eight minterms. XOR gates are the only short way to build it.
Send the four bits and Odd together; the receiver XORs all five, and a 1 means a bit was flipped.
Building it from 74-series chips
| 74LS86 | three of its four XOR gates |