Introduction to Data Communications | ||
---|---|---|
Previous | 20c. Parity Bits | Next |
Even Parity Generation
Even Parity counts the number of 1s in the data to see if the total is an even number. If the number of 1s is an even number then the Parity bit is set to 0. If the number of 1s is an odd number, then the Parity bit is set to 1 to make the total number of 1s an even number. The Even Parity Bit is used to make the total number of 1s equal to an even number.
Data | Even Parity Bit | |
0100 1010 |
|
3 x 1s in Data: 3 is an odd number, Parity Bit = 1 |
0111 1110 |
|
6x 1s in Data: 6 is an even number, Parity Bit = 0 |
1010 1010 |
|
What should the parity bit be? |
Even Parity Checking
When a data with even parity is received. The number of 1s in both the data and the parity bit are counted. If the number of 1s is an even number than the data is good data, if it is an odd number than the data is corrupted.
Data | Even Parity Bit | |
0100 1010 |
|
4 x 1s in data and parity bit = Good data |
0111 1110 |
|
7 x 1s in data and parity bit = Bad data |
1010 1010 |
|
Is this good or bad data? |
Odd Parity Generation
Odd Parity is the opposite of Even Parity. Odd Parity counts the number of 1s in the data to see if the total is an odd number. If the number of 1s is an odd number then the Parity bit is set to 0. If the number of 1s is an even number, then the Parity bit is set to 1 to make the total number of 1s an odd number. The Odd Parity Bit is used to make the total number of 1s equal to an odd number.
Data | Odd Parity Bit | |
0100 1010 |
|
3 x 1s in Data: 3 is an odd number, Parity Bit = 0 |
0111 1110 |
|
6x 1s in Data: 6 is an even number, Parity Bit = 1 |
1010 1011 |
|
What should the parity bit be? |
Introduction to Data Communications | ||
---|---|---|
Previous | Table of Contents | Next |