| 7 bits of data | byte with parity bit | |
| even | odd | |
| 0000000 | 00000000 | 00000001 |
| 1010001 | 10100011 | 10100010 |
| 1101001 | 11010010 | 11010011 |
| 1111111 | 11111111 | 11111110 |
There are two types of parity bits: even parity bit and odd parity bit. An even parity bit is set to 1 if the number of ones in given set of bits is odd (making the number of ones even). An odd parity bit is set to 1 if the number of ones in given set of bits is even (making the number of ones odd). Even parity is actually a special case of a cyclic redundancy check (CRC), where the 1-bit CRC is generated by the polynomial x+1.
In serial data transmission, a common format is 7 data bits, an even parity bit, and one or two stop bits. This format neatly accommodates all the 7-bit ASCII characters in a convenient 8-bit byte. Other formats are possible; 8 bits of data plus a parity bit can convey all 8-bit byte values.
In serial communication contexts, parity is usually generated and checked by interface hardware (e.g., a UART) and, on reception, the result made available to the CPU (and so to, for instance, the operating system) via a status bit in a register in the interface hardware. Recovery from the error is usually done by retransmitting the data, the details of which are usually handled by software (e.g., the operating system I/O routines).
Given the diagram below, where each column is a disk, assume A1 = 00000111, A2 = 00000101, and A3 = 0000000. Ap, generated by XORing A1, A2, and A3, will then equal 00000010. If the second drive fails, A2 will no longer be accessible, but can be reconstructed by XORing A1, A3, and Ap:
A1 XOR A3 XOR Ap = 00000101
RAID Array A1 A2 A3 Ap B1 B2 Bp C1 C2 C3 C4 Cp
Note: Data blocks are in the format A#, parity blocks Ap.
Telecommunications | Error detection and correction
Pariteitsbis | Bit de paritat | Paritetsbit | Paritätsbit | Bit de paridad | Bit de parité | סיבית זוגיות | Pariteitsbit | パリティビット | Bit parzystości | Paridade (telecomunicações) | Бит чётности
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Parity bit".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world