Parity Bits
Bits can be changed by electromagnetic radiation, mismatched baud rates, or long-distance data transfers. Parity provides low-level bit error checking and has two modes: odd and even.
To calculate the parity bit, the 8 bits of the data byte are added, and the evenness of
the sum determines whether the bit is set. For example, if the parity is even and is
added to 8-bit data 1010 1110, which has an odd number of 1s (5), the
parity bit is set to 1. Conversely, if the parity mode is set to odd, the parity bit
would be 0.
When the parity bit matches the data, the UART’s transmission is free of errors.