ARCHIVED: What is a parity bit?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Parity bits are used as a form of error checking during the transmission of information. When old modems transmitted data over a network or communications device, the data was encoded into a series of ones and zeros called bits (modern modems send information in packets and check for errors in different ways, so a parity bit is unnecessary). A single bit can describe only two possible states, 0 (off) or 1 (on). Several bits are thus needed to describe a letter or number. A total of seven bits are used to describe the set of ASCII characters, which include the letters and numbers that compose this document.

The letter "A", for example, has ASCII code 65, which in binary is 1000001. Note that each binary digit corresponds to a power of two, and 65, which is two to the sixth power plus two to the zeroth power, has ones in only the sixth and zeroth columns of its binary representation. The letter C, with code value 67, has the binary sequence 1000011.

Because noise or electrical interference may sometimes interfere with the transmission of data, it is useful to have some way to easily detect errors in information as it is exchanged. One way to do this is to add an eighth bit to characters that are transmitted, called a parity bit. The parity bit is chosen such that all correctly transmitted characters will have either an even or odd number of ones. Thus, if a zero were placed at the start of the code for the letter A, producing 01000001, a one would be placed before the code for C, producing 11000011.

The prefixes shown here produce binary codes with an even number of ones (and zeros), and the added bit is thus called an even parity bit. The leading ones and zeros could also be chosen to always produce odd numbers of ones and zeros, and this scheme is called odd parity. Familiar settings in communications programs are E7, which uses one even parity bit and seven data bits, and N8, which indicates no parity bit and the use of all eight bits for transmitting data.

Use of the wrong parity setting in a communications program may produce screens full of garbage characters. If this happens, check to see what parity settings the computer to which you are connecting expects. If you do not have this information, try connecting with a different parity setting and see if this produces legible text.

This is document afdh in the Knowledge Base.
Last modified on 2023-09-22 16:54:51.