So the result will differ of one of the values 0, ±2
i−1
, ±3 × 2
i−1
, ±2
i
Solution 6.3. There are three cases.
• The sum bit is affected: the addition
ˆ
S = S − 2
i−2
if faulty ˆs
i
= 0 or
ˆ
S = S + 2
i−2
if faulty ˆs
i
= 1
• The carry-out bit is affected: the addition
ˆ
S = S − 2
i−1
if faulty ˆc
i+1
= 0
or
ˆ
S = S + 2
i−1
if faulty ˆc
i−1
= 1
• Both sum bit s
i−2
and c
i−1
are affected: there are four possibilities:
ˆc
i+1
ˆs
i
ˆ
S = S
0 0 −3 × 2
i−2
0 1 −2
i−2
1 0 2
i−2
1 1 3 × 2
i−2
So the result will differ of one of the values 0, ±2
i−2
, ±3 × 2
i−2
, ±2
i−1
We can conclude that to detect the errors, we must consider two bit shift
because one bit shift is not enough. Indeed, except when both results are exact,
no-shift and two-bit shift calculations will lead to different results. Nevertheless,
the results of no-shift and one-bit shift calculations will be the same in two cases
(difference 0 and difference ±2
i
).
7
Solution 7.1. A parity code can detect single-bit errors and multiple-bit errors
which affect an odd number of bits.
• If an odd number of bits is affected, then the number of 1’s in a codeword
changes from even to odd (for an even parity code) or from odd to even
(for an odd parity code).
A parity code can only detect errors, but it cannot correct them, since the
position of the erroneous bit(s) is not possible to locate.
• For example, suppose that we use an even parity code to protect the trans-
mission of 5-bit data. If we receive the word [110100], then we know that
an error has occurred. However, we do not know which codeword has been
sent. If we assume that a single-bit error has occurred during the trans-
mission, then it is equally likely that one of the six codewords [010100],
[100100], [111100], [110000], [110110], or [110101] has been sent.
Solution 7.2. The decision depends on which type of all-bits error is more
probable.
For even parity - the parity bit for the all zeroes data word will be 0 and an
all-0’s failure will go undetected - it is a valid codeword.
3