Page 203 -
P. 203
172 CHAPTER 5 / INTERNAL MEMORY
Each check bit operates on every data bit whose position number contains a 1
in the same bit position as the position number of that check bit.Thus, data bit posi-
tions 3, 5, 7, 9, and 11 (D1, D2, D4, D5, D7) all contain a 1 in the least significant bit
of their position number as does C1; bit positions 3, 6, 7, 10, and 11 all contain a 1 in
the second bit position, as does C2; and so on. Looked at another way, bit position n
is checked by those bits C such that g = n . For example, position 7 is checked by
i
i
bits in position 4, 2, and 1; and 7 = 4 + 2 + 1.
Let us verify that this scheme works with an example. Assume that the 8-bit
input word is 00111001, with data bit D1 in the rightmost position. The calculations
are as follows:
C1 = 1 { 0 { 1 { 1 { 0 = 1
C2 = 1 { 0 { 1 { 1 { 0 = 1
C4 = 0 { 0 { 1 { 0 = 1
C8 = 1 { 1 { 0 { 0 = 0
Suppose now that data bit 3 sustains an error and is changed from 0 to 1. When the
check bits are recalculated, we have
C1 = 1 { 0 { 1 { 1 { 0 = 1
C2 = 1 { 1 { 1 { 1 { 0 = 0
C4 = 0 { 1 { 1 { 0 = 0
C8 = 1 { 1 { 0 { 0 = 0
When the new check bits are compared with the old check bits, the syndrome word is
formed:
C8 C4 C2 C1
0 1 1 1
{ 0 0 0 1
0 1 1 0
The result is 0110, indicating that bit position 6, which contains data bit 3, is in error.
Figure 5.10 illustrates the preceding calculation.The data and check bits are po-
sitioned properly in the 12-bit word.Four of the data bits have a value 1 (shaded in the
Bit
12 11 10 9 8 7 6 5 4 3 2 1
position
Position 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
number
Data bit D8 D7 D6 D5 D4 D3 D2 D1
Check bit C8 C4 C2 C1
Word 0 0 1 1 0 1 0 0 1 1 1 1
stored as
Word
fetched as 0 0 1 1 0 1 1 0 1 1 1 1
Position 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
number
Check bit 0 0 0 1
Figure 5.10 Check Bit Calculation

