Linear Block Codes
Linear Block Codes
Linear Block Codes
(
(
(
(
(
(
=
1 1 0
0 1 1
1 1 1
1 0 1
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
k n k k k ( )
Parity-Check Matrix
For G = [ P | I
k
], define the matrix H = [I
n-k
| P
T
]
(The size of H is (n-k)xn).
It follows that GH
T
= 0.
Since c = mG, then cH
T
= mGH
T
= 0.
H =
(
(
(
1 0 0 1 0 1 1
0 1 0 1 1 1 0
0 0 1 0 1 1 1
Encoding Using H Matrix
| |
c c c c c c c
1 2 3 4 5 6 7
1 0 0
0 1 0
0 0 1
1 1 0
0 1 1
1 1 1
1 0 1
0
0
0
1 6 7
2 5 6
3 6 7
1 6 7
2 5 6
3 6 7
(
(
(
(
(
=
+ + =
+ + =
+ + =
+ +
+ +
+ +
0
c + c c c
c + c c c
c + c c c
c = c c c
c = c c c
c = c c c
4
4
5
4
4
5
information
Encoding Circuit
Examples of BLOCK codes
Hamming Codes
Hamming codes constitute a class of single-error
correcting codes defined as:
n = 2
r
-1, k = n-r, r > 2
The minimum distance of the code d
min
= 3
Hamming codes are perfect codes.
Construction rule:
The H matrix of a Hamming code of order r has as its
columns all non-zero r-bit patterns.
Size of H: r x(2
r
-1)=(n-k)xn
Decoding
Let c be transmitted and r be received, where
r = c + e
e = error pattern = e
1
e
2
..... e
n
, where
The weight of e determines the number of errors.
If the error pattern can be determined, decoding can
be achieved by:
c = r + e
e
i
i
th
=
(
(
(
(
(
(
=
Decoding of Hamming Codes
(contd)
That is, the (transpose of the) i
th
column of H is the
syndrome corresponding to a single error in the i
th
position.
Decoding rule:
1. Compute the syndrome s = vH
T
2. Locate the error ( i.e. find i for which s
T
= H
i
)
3. Invert the i
th
bit of v.
Hardware Implementation
Let v = v
0
v
1
v
2
v
3
v
4
v
5
v
6
and s = s
0
s
1
s
2
From the H matrix:
s
0
= v
0
+ v
3
+ v
5
+ v
6
s
1
= v
1
+ v
3
+ v
4
+ v
5
s
2
= v
2
+ v
4
+ v
5
+ v
6
From the table of syndromes and their corresponding
correctable error patterns, a truth table can be
construsted. A combinational logic circuit with s
0
, s
1
,
s
2
as input and e
0
, e
1
, e
2
, e
3
, e
4
, e
5
, e
6
as outputs
can be designed.
Decoding Circuit for the (7,4) HC
v rather than r