2. Single Error Detection
M = (1, 1, …, 1) is the m + 1 parity check matrix
for single error detection. If c = (0, 1, 0, …, 1) is
an n-bit codeword, then McT = 0 (use XOR for
addition). If c′ = c + e contains an error, then the
syndrome is:
Mc′T = M(c + e)T = McT + MeT = MeT = 1
This detects errors: 0 for none, 1 for an error.
3. 1 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
M′ =
for double-error detection (optional)
the 3 x 7 parity check matrix for a
single-error correcting Hamming code
11.2
If c is a 7 bit code word, then McT = (0 0 0)T and Mc′T = MeT = the
syndrome for the error (e.g. try 0110011 → 0100011 on page 41). In
general, we can choose any parity check matrix for M, provided the
rows are linearly independent (otherwise the checks themselves are
redundant), and McT = 0. But, to correct a double-error, we must
have the property that the syndrome M(e1 + e2)T = Me1
T + Me2
T is
unique for every pair of columns (assuming e1 and e2 are single-error
vectors).
Single Error Correction / Double Error Detection
4. Polynomials
2[x] = {bnxn + … + b0 : n ≥ 0; bi = 0, 1; bn = 1}
Associate with each n-bit vector the corresponding polynomial, like
a generating function. Arithmetic operations (+, ×) apply to 2[x],
provided we do arithmetic on the coefficients in 2 (mod 2).
A polynomial P(x) is prime (or irreducible) if it cannot be factored
(over 2[x]) into lower-order polynomials. For example,
all are prime: x x + 1, x2 + x + 1, x3 + x + 1, x3 + x2 + 1
all composite: x2, x2 + 1, x2 + x, x3, x3 + 1, x3 + x2 + x + 1
Primitive roots are those that generate all non-zero elements.
degree coefficients leading
unless n = 0
11.5, 11.6, 11.7
5. Consider arithmetic in 2[x]/p(x) modulo an irreducible polynomial
p(x) of degree n. Since xn ≡ p(x) − xn mod p(x) there are no
polynomials of degree ≥ n. In fact, 2[x]/p(x) has 2n elements:
bn−1xn−1 + … + b0, which form a field, and hence there exists a
polynomial g(x) whose powers generate all the non-zero elements.
E.g. The powers of g(x) = x mod p(x) = x3 + x + 1 are:
1, x, x2, x + 1, x2 + x, x2 + x + 1, x2 + 1. Writing these as column
vectors of a matrix gives a rearranged Hamming code:
n = 3
2n = 8 = |2[x]/p(x)|
7 = 8 − 1 (# non-zero)
1 1 1 0 1 0 0 x2
0 1 1 1 0 1 0 x1
1 1 0 1 0 0 1 x0
x6 x5 x4 x3 x2 x1 x0
M =
11.8
Polynomial arithmetic
6. Polynomial Coding
Recall: Sent messages c should have McT = 0.
Fact: If c is a valid codeword, then c(x) ≡ 0 mod p(x).
Reason: McT = c(x) by definition of matrix
multiplication. And since the powers of x that make
up the columns of M are modulo p(x), McT = 0
c(x) ≡ 0 mod p(x).
The syndrome of a received codeword c′ is Mc'T =
MeT, and similarly, the corresponding polynomial s(x)
has c'(x) − s(x) ≡ 0 mod p(x) c'(x) ≡ s(x). If the ith
column matches, i.e. xi ≡ s(x), then that is the error
location, assuming e contains only one error.
7. Encode: Place message in columns 6, 5, 4, 3, and compute
b6x6 + b5x5 + b4x4 + b3x3 modulo p(x). Put remainder,
r(x) = b2x2 + b1x + b0, in the last columns.
b6 b5 b4 b3 b2 b1 b0
message checks
Decode: Divide received polynomial by p(x), and use the
remainder r(x) ≡ gi(x) to calculate syndrome i.
No error i doesn’t exist, i.e. r(x) ≡ 0 mod p(x).
Example: 1 0 0 1 x6 + x3 + ?
/ /
1 0 0 1 1 1 0 x2 + 1 + x + 1 = x2 + x
11.8
8. Calculating the syndrome
McT = (x6x5 … x0)(c6c5 … c0)T = c6x6 + c5x5 +…+ c0x0
Example: If M is the Hamming matrix from
before (powers of x mod x3 + x + 1), and c =
0110110, then McT = x2 + x = s(x).
Strategy: divide s(x) by x repeatedly until we
reach the identity, x7 (Fermat’s little theorem).
Is there a less symbolically laborious way?
10. Double error-correcting Code
Illustration: 15-bit Hamming code with 4 parity checks.
Verify that x4 + x + 1 is prime, and that x is primitive.
The resulting parity check matrix M1 is single error-
correcting, but x + x2 = x12 + x14 so double error-
correction is impossible.
Idea: pick another primitive generator x3 with matrix
M2. Let s1 = xi + xj = M1c′T be the first syndrome and
s2 = (x3)i + (x3)j = M2c′T be the second syndrome.
Then s2 = (xi)3 + (xj)3 = (xi + xj)((xi)2 + (xi)(xj) + (xj)2) =
s1[xixj + s1
2] So that xi + xj = s1 and xixj = s1
2 + s2/s1
11.11
Editor's Notes
Do an example
11.4
e2πi/n generates all roots of xn − 1 over . If n is prime, any root (except 1) will work.
Demonstrate all arithmetic operations, and compute inverses.
11.8 end
Use shift registers with feedback (Fig. 11.9-1). Clearly explain use of forward and reverse SRs! (see handwritten notes) Make new slides
Finish by forming quadratic equation and showing that it can always be solved/satisfied for decoding/encoding respectively