Professional Documents
Culture Documents
Example 2.38
Modulo 2 division operates through a series of partial sums using the modulo 2 addition
rules. Example 2.39 illustrates the process.
Example 2.39
Each bit whose bit number is a power of 2 is a parity bit—the others are data bits.
1. Determine the number of check bits, r, necessary for the code and then number the n bits
(where n = m + r), right to left, starting with 1 (not 0).
2. bit 1 checks the parity over bits 1,3, and 5
3. bit 2 check the parity over bits 2,3, and 6
4. bit 4 checks the parity over bits 4, 5, and 6
Odd parity:
words: 000, 001, 010, 011, 100, 101, 110, and 111
Even parity:
words: 000, 001, 010, 011, 100, 101, 110, and 111
1 p1 2 p2 3m1 4 p3 5m2 6m3
6m3 5m2 4 p3 3m1 2 p2 1 p1
0 0 0 0 0 0
0 0 0 1 1 1
0 1 1 0 0 1
0 1 1 1 1 0
1 0 1 0 1 0
1 0 1 1 0 1
1 1 0 0 1 1
1 1 0 1 0 0
1 1 0 0 1 1
Write all bit positions as sums of those numbers that are powers of 2:
1 = 1 = 20
2 = 2 = 21
3 = 1+2
4 = 4 = 22
5 = 1+4
6 = 2+4
7 = 1+2+4
8 = 8 = 23
9 = 1+8
10 = 2+8
11 = 1+2+8
12 = 4+8
The ones that are powers of 2 are parity bit positions
The Hamming distance between two code words is important in the context of error detection. If two
code words are a Hamming distance d apart, d single-bit errors are required to convert one code
word to the other, which implies that this type of error would not be detected. Therefore, if we wish to
create a code that guarantees detection of all single-bit errors (an error in only 1 bit), all pairs of code
words must have a Hamming distance of at least 2. If an n-bit word is not recognized as a legal code
word, it is considered an error.