Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
=
=
=
=
=
=
bits/symbol (3.3)
We note that the entropy, H, of a discrete memoryless source with equiprobable symbols is
bounded as follows:
0
2
s s H k log , where k is the number of equiprobable source symbols.
Furthermore, we may state that :
1- H = 0 , if and only if the probability p(s
i
) = 1 for some symbol s
i
, and the remaining
source symbols probabilities are all zero. This lower bound on entropy corresponds to no
uncertainty and no information.
2- H = log
2
k bits/symbol, if and only if p(s
i
) = 1/k for all the k source symbols (i.e. they are
all equiprobable). This upper bound on entropy corresponds to maximum uncertainty and
maximum information.
Example:
Calculate the entropy of a discrete memoryless source with source alphabet S = { s
0
, s
1
, s
2
}
with probabilities p(s
0
) = 1/4 , p(s
1
) = 1/4, p(s
3
) = 1/2 .
H p(s ) I(s )
p(s ) log [
1
p(s )
]
i
i 0
i (k 1)
i
i
i 0
i (k 1)
2
i
=
=
=
=
=
=
H p(s ) log [
1
p(s )
] + p(s log [
1
p(s )
] + p(s log [
1
p(s )
]
=
1
4
log
1
4
log
1
2
log
0 2
0
1 2
1
2 2
2
2 2 2
=
+ + = =
) )
( ) ( ) ( ) . / 4 4 2
3
2
1 5 bits symbol
Information Rate
If we consider that the symbols are emitted from the source at a fixed time rate (the signalling
interval), denoted by r
s
symbols/second. We can define the
average source information rate R in bits per second as the product of the average
information content per symbol, H, and the symbol rate r
s
.
R = r
s
H bits/sec (3.4)
Example
A discrete source emits one of five symbols once every millisecond. The source symbols
probabilities are 1/2, 1/4, 1/8, 1/16, and 1/16 respectively.
Find the source entropy and information rate.
H p(s ) log [
1
p(s )
]
i
i 0
i (k 1)
2
i
=
=
=
=
=
=
i k i
i
i
s p
0
1 ) (
2- The amount of information gained after observing the output symbol (s
i
) which
occurrs
with probability p(s
i
) is
(
=
) (
1
log ) (
2
i
i
s p
s I i = 0,1,2,,(k-1)
3- The entropy, H, of a discrete memoryless source with source alphabet composed of the set
S = {s
0
, s
1
, s
2
, . , s
k-1
}, is a measure of the average information content per source
symbol, and is given by:
=
=
=
=
(
= =
1
0
2
1
0
) (
1
log ) ( ) ( ) (
k i
i
i
i
k i
i
i i
s p
s p s I s p H bits/symbol
4- Information rate (bit rate) = symbol rate * entropy
R = r
s
H bits/sec
5- |
.
|
\
|
+ =
N
S
BW C 1 log
2
bits/sec
6- BSC = Binary Symmetric Channel
7- Prob of e errors in n digits = ) (
n
e
p
e
(1 - p)
n-e
.
CHANNEL CODING
Suppose that we wish to transmit a sequence of binary digits across a noisy channel. If we
send a one, a one will probably be received; if we send a zero, a zero will probably be
received. Occasionally, however, the channel noise will cause a transmitted one to be
mistakenly interpreted as a zero or a transmitted zero to be mistakenly interpreted as a one.
Although we are unable to prevent the channel from causing such errors, we can reduce their
undesirable effects with the use of coding.
The basic idea, is simple. We take a set of k information digits which we wish to transmit,
annex to them r check digits, and transmit the entire block of n = k + r channel digits.
Assuming that the channel noise changes sufficiently few of these transmitted channel digits,
the r check digits may provide the receiver with sufficient information to enable it to detect
and/or correct the channel errors.
(The detection and/or correction capability of a channel code will be discussed at some length
in the following pages.)
Given any particular sequence of k message digits, the transmitter must have some rule for
selecting the r check digits. This is called channel encoding.
Any particular sequence of n digits which the encoder might transmit is called a codeword.
Although there are 2
n
different binary sequences of length n, only 2
k
of these sequences are
codewords, because the r check digits within any codeword are completely determined by the
k information digits. The set consisting of these 2
k
codewords, of length n each, is called a
code (some times referred to as a code book.)
No matter which codeword is transmitted, any of the 2
n
possible binary sequences of length n
may be received if the channel is sufficiently noisy. Given the n received digits, the decoder
must attempt to decide which of the 2
k
possible codewords was transmitted.
Repetition codes and single-parity-check codes
Among the simplest examples of binary codes are the repetition codes, with k = 1, r arbitrary,
and n = k + r = 1 + r . The code contains two codewords, the sequence of n zeros and the
sequence of n ones.
We may call the first digit the information digit; the other r digits, check digits. The value of
each check digit (each 0 or 1) in a repetition code is identical to the value of the information
digit. The decoder might use the following rule:
Count the number of zeros and the number of ones in the received bits. If there are more
received zeros than ones, decide that the all-zero codeword was sent; if there are more ones
than zeros, decide that the all-one codeword was sent. If the number of ones equal the number
of zeros do not decide (just flag the error)..
This decoding rule will decode correctly in all cases when the channel noise changes less
than half the digits in any one block. If the channel noise changes exactly half of the digits in
any one block, the decoder will be faced with a decoding failure (i.e. it will not decode the
received word into any of the possible transmitted codewords) which could result in an ARQ
(automatic request to repeat the message). If the channel noise changes more than half of the
digits in any one block, the decoder will commit a decoding error; i.e. it will decode the
received word into the wrong codeword.
If channel errors occur infrequently, the probability of a decoding failure or a decoding error
for a repetition code of long block length is very small indeed. However repetition codes are
not very useful. They have only two codewords and have very low information rate R = k/n
( also called code rate),all but one of the digits are check digits.
We are usually more interested in codes which have a higher information rate.
Extreme examples of such very high rate codes which use a single-parity-check digit. This
check digit is taken to be the modulo-2 sum (Exclusive-OR) of the codeword (n -1)
information digits. (
The information digits are added according to the exclusive-OR binary operation : 0 + 0 = 0 ,
0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 0 ). If the number of ones in the information word is even the
modulo-2 sum of all the information digits will be equal to zero, If the number of ones in the
information word is odd their modulo-2 sum will be equal to one.
Even parity means that the total number of ones in the codeword is even, odd parity means
that the total number ones in the codeword is odd. Accordingly the parity bit (or digit) is
calculated and appended to the information digits to form the codeword.
This type of code can only detect errors. A single digit error (or any number of odd digit
errors) will be detected but any combination of two digit errors (or any number of even digit
errors) will cause a decoding error. Thus the single-parity-check type of code cannot correct
errors.
These two examples, the repetitive codes and the single-parity-check codes, provide the
extreme, relatively trivial, cases of binary block codes. ( Although relatively trivial single-
parity-checks are used quite often because they are simple to implement.)
The repetition codes have enormous error-correction capability but only one information bit
per block. The single-parity-check codes have very high information rate but since they
contain only one check digit per block, they are unable to do more than detect an odd number
of channel errors.
There are other codes which have moderate information rate and moderate error-
correction/detection capability, and we will study few of them.
These codes are classified into two major categories:
Block codes , and Convolutional codes.
In block codes, a block of k information digits is encoded to a codeword of n digits
(n > k). For each sequence of k information digits there is a distinct codeword of n digits.
In convolutional codes, the coded sequence of n digits depends not only on the k
information digits but also on the previous N - 1 information digits (N > 1). Hence the coded
sequence for a certain k information digits is not unique but depends on N - 1 earlier
information digits.
In block codes, k information digits are accumulated and then encoded into an n-digit
codeword. In convolutional codes, the coding is done on a continuous, or running, basis
rather than by accumulating k information digits.
We will start by studying block codes. (and if there is time we might come back to study
convolutional codes).
BLOCK CODES
The block encoder input is a stream of information digits. The encoder segments the input
information digit stream into blocks of k information digits and for each block it calculates
a number of r check digits and outputs a codeword of n digits, where n = k + r (or r = n -
k).
The code efficiency (also known as the code rate ) is k/n.
Such a block code is denoted as an (n,k) code.
Block codes in which the k information digits are transmitted unaltered first and followed by
the transmission of the r check digits are called systematic codes, as shown in figure 1
below.
Since systematic block codes simplify implementation of the decoder and are always used in
practice we will consider only systematic codes in our studies.
( A non-systematic block code is one which has the check digits interspersed between the
information digits. For Linear block codes it can be shown that a non systematic block code
can always be transformed into a systematic one).
C
1
C
n
C
n-1
C
2
..........
C
k
.....................................
r check di gi ts k information digits
Figure 1 an (n,k) block codeword in systemati c form
LINEAR BLOCK CODES
Linear block codes are a class of parity check codes that can be characterized by the (n, k)
notation described earlier.
The encoder transforms a block of k information digits (an information word) into a longer
block of n codeword digits, constructed from a given alphabet of elements. When the
alphabet consists of two elements (0 and 1), the code is a binary code comprised of binary
digits (bits). Our discussion of linear block codes is restricted to binary codes.
Again, the k-bit information words form 2
k
distinct information sequences referred to as
k-tuples (sequences of k digits).
An n-bit block can form as many as 2
n
distinct sequences, referred to as n-tuples.
The encoding procedure assigns to each of the 2
k
information k-tuples one of the 2
n
n-tuples.
A block code represents a one-to-one assignment, whereby the 2
k
information k-tuples are
uniquely mapped into a new set of 2
k
codeword n-tuples; the mapping can be accomplished
via a look-up table, or via some encoding rules that we will study shortly.
Definition:
An (n, k) binary block code, is said to be linear if, and only if, the modulo-2 addition (C
i
C
j
) of any two codewords, C
i
and C
j
, is also a codeword. This property thus means that (for
linear block code) the all-zero n-tuple must be a member of the code book (because the
modulo-2 addition of a codeword with itself results in the all-zero n-tuple).
A linear block code, then, is one in which n-tuples outside the code book cannot be created
by the modulo-2 addition of legitimate codewords (members of the code book).
For example, the set of all 2
4
= 16, 4-tuples (or 4-bit sequences ) is shown below:
0000 0001 0010 0011 0100 0101 0110 0111
1000 1001 1010 1011 1100 1101 1110 1111
an example of a block code ( which is really a subset of the above set ) that forms a linear
code is
0000 0101 1010 1111
It is easy to verify that the addition of any two of these 4 code words in the code book can
only yield one of the other members of the code book and since the all-zero n-tuple is a
codeword this code is a linear binary block code.
Figure 5. 13 illustrates, with a simple geometric analogy, the structure behind linear block
codes. We can imagine the total set comprised of 2
n
n-tuples. Within this set (also called
vector space) there exists a subset of 2
k
n-tuples comprising the code book . These 2
k
codewords or points , shown in bold "sprinkled" among the more numerous 2
n
points,
represent the legitimate or allowable codeword assignments.
An information sequence is encoded into one of the 2
k
allowable codewords and then
transmitted. Because of noise in the channel, a corrupted version of the sent codeword
(one of the other 2
n
n-tuples in the total n-tuple set) may be received.
The objective of coding is that the decoder would be able to decide whether the received
word is a valid codeword, or whether it is a codeword which has been corrupted by noise (
i.e. detect the occurrence of one or more errors ). Ideally of course the decoder should be able
to decide which codeword was sent even if this transmitted codeword was corrupted by noise,
and this process is calld error-correction.
By thinking about it, if one is going to attempt to correct errors in a received word
represented by a sequence of n binary symbols, then it is absolutely essential not to allow the
use of all 2
n
n-tuples as being legitimate codewords.
If, in fact, every possible sequence of n binary symbols were a legitimate codeword, then in
the presence of noise one or more binary symbols could be changed, and one would have no
possible basis for determining if a received sequence was any more valid than any other
sequence.
Carrying this thought a little further, if one wished that the coding system would correct the
occurrence of a single error, then it is both necessary and sufficient that each codeword
sequence differs from every other codeword in at least 3 positions.
In fact, if one wished that the coding system would correct the occurrence of e errors, then it
is both necessary and sufficient that each codeword sequence differs from every other
codeword in at least (2e +1) positions.
DEFINITION
The number of positions in which any two codewords differ from each other is called the
Hamming distance, and is normally denoted by d .
For example:
Looking at the (n,k) = (4,2) binary linear block code, mentioned earlier, which has the
following codewords:
C
1
0000
C
2
0101
C
3
1010
C
4
1111
we see that the Hamming distance, d, :
between C
2
and C
3
is equal to 4
between C
2
and C
4
is equal to 2
between C
3
and C
4
is equal to 2
We also observe that the Hamming distance between C
1
and any of the other codewords is
equal to the "weight" that is the number of ones in each of the other codewords.
We can also see that the minimum Hamming distance ( i.e. the smallest Hamming distance
between any pair of the codewords), denoted by d
min
, of this code is equal to 2
( The minimum Hamming distance of a binary linear block code is simply equal to the
minimum weight of its codewords. This is due to the fact that the code is linear, meaning that
if any two codewords are added together modulo-2 the result will be another codeword. thus
to find the minimum Hamming distance of a linear block code all we need to do is to find the
minimum-weight codeword).
Looking at the above code again, and keeping in mind what we said earlier about the
"Hamming distance" property of the codewords for a code to correct a single error.
We said that, to correct a single error, this code must have any of its codewords differing
from any of the other codewords by at least (2e + 1), where e in our case is 1 (i.e. a single
error). That is the minimum Hamming distance of the code must be at least 3. Therefore the
above mentioned code cannot correct the result of occurrence of a single error, (since its d
min
= 2), but it can detect it.
To explain this further let us consider the following diagram in figure
C
1
C
2
x x x
b) Hamming sphere of radius e = 1 around each codeword
Hamming distance between codewords = 2
Code can only detect e = 1 error but cannot correct it
because d = e + 1 ( i.e. d < 2e + 1)
x x x x
C
1
C
2
a) Hamming sphere of radius e = 1 around each codeword
Hamming distance between codewords = 3
Code can correct a single error since d = 2e + 1
FIGURE 2
If we imagine that we draw a sphere ( called a Hamming sphere) of radius e= 1 around each
codeword. This sphere will contain all n-tuples which are at a distance 1 away from each
codeword ( i.e. all n-tuples which differ from this code word in one position ).
If the minimum Hamming distance of the code d
min
< 2e + 1 (as in figure 2b, where d = 2)
the occurrence of a single error will result in changing the codeword to the next n-tuple and
the decoder does not have enough information to decide if codeword C
1
or C
2
was
transmitted. The decoder however can detect that an error has occurred.
If we look at figure 2a we see that the code has a d
min
= 2e + 1 and that the occurrence of a
single error results in the next n-tuple being received and in this case the decoder can make
an unambiguous decision, based on what is called nearest neighbour decoding rule, as to
which of the two codewords was transmitted.
If the corrupted received n-tuple is not too unlike (not too distant from) the valid codeword,
the decoder could make a decision that the transmitted codeword was the code word "nearest
in distance" to the received the word.
Thus in general we can say that a binary linear code will correct e errors
if d
min
= 2e + 1 (for odd d
min
)
if d
min
= 2e + 2 (for even d
min
)
A (6 , 3) Linear Block Code Example
Examine the following coding assignment that describes a (6, 3) code. There are 2
k
= 2
3
= 8
information words, and therefore eight codewords.
There are 2
n
= 2
6
= sixty-four 6-tuples in the total 6-tuple set (or vector space)
Information digits, Codewords
C
1
,C
2
,C
3
C
1
C
2
,C
3
C
4
C
5
,C
6
parity check equations for this code are
c4 = c1 c2
000 000000 c5 = c2 c3
001 001011 c6 = c1 c3
010 010110 and its H matrix is
011 011101 110100
100 100101 011010
101 101110 101001
110 110011
111 111000
It is easy to check that the eight codewords shown above form a linear code (the all-zeros
codeword is present, and the sum of any two codeword is another codeword member of the
code). Therefore, these codewords represent a linear binary block code.
It is also easy enough to check that the minimum Hamming distance of the code is d
min
= 3
thus we conclude that this code is a single error correction code, since
d
min
= 2e + 1 (for odd d
min
) .
In the simple case of single-parity-check codes, the single parity was chosen to be the
modulo-2 sum of all the information digits.
Linear block codes contain several check digits, and each check digit is a function of the
modulo-2 sum of some (or all) of the information digits.
Let us consider the (6 , 3) code, i.e. n = 6, k = 3, and there are r = n-k = 3 chek digits.
We shall label the three information digits by C
1
,C
2
,C
3
and the three check digits as C
4
,C
5
and C
6
.
Lets choose to calculate the check digits from the information digits according to the
following rules: (each one of these equations must be indepent of any or all of the others)
C
4
= C
1
C
2
C
5
= C
2
C
3
C
6
= C
1
C
3
or in matrix notation
(
(
(
(
(
(
=
(
(
(
3
2
1
6
5
4
1 0 1
1 1 0
0 1 1
C
C
C
C
C
C
The full codeword consists of the digits C
1
,C
2
,C
3
, C
4
,C
5
,C
6
.
Generally the n-tuple codeword is denoted as C = [C
1
,C
2
,C
3
, C
4
,C
5
,C
6
]
Every codeword must satisfy the parity-check equations
C
1
C
2
C
4
= 0
C
2
C
3
C
5
= 0
C
1
C
3
C
6
= 0
or in matrix notation
(
(
(
=
(
(
(
(
(
(
(
(
(
(
(
0
0
0
1 0 0 1 0 1
0 1 0 1 1 0
0 0 1 0 1 1
6
5
4
3
2
1
C
C
C
C
C
C
which can be written a little more compactly as
(
(
(
=
(
(
(
0
0
0
1 0 0 1 0 1
0 1 0 1 1 0
0 0 1 0 1 1
t
C
Here C
t
denotes the column which is the transpose of the codeword
C = [C
1
,C
2
,C
3
, C
4
,C
5
,C
6
]
Even more compactly, we can write these parity check equations as
H C
t
= 0
where 0 is the three dimensional column whose components are all zeros and
H is called the parity-check matrix. Thus in our example
H =
(
(
(
1 0 0 1 0 1
0 1 0 1 1 0
0 0 1 0 1 1
Note that each row of the parity check matrix is independent of all othe other rows, we say
that these rows are linearly independent (i.e. we cannot obtain any row by the linear
addition of any combination of the other rows).
The 2
3
= 8 codewords in the code are
Information digits, Codewords
C
1
,C
2
,C
3
C
1
C
2
,C
3
C
4
C
5
,C
6
000 000000
001 001011
010 010110
011 011101
100 100101
101 101110
110 110011
111 111000
After the information sequence is encoded into the full codeword, the codeword is
transmitted across the noisy channel.
The channel adds to this codeword the "noise word", also called the error pattern,
E = [E
1
,E
2
,E
3
, E
4
,E
5
,E
6
]
0 if the channel does not change the ith digit
where E
i
={
1 if the channel changes the ith digit.
The received word is given by the sequence R = [R
1
,R
2
,R
3
, R
4
,R
5
,R
6
]
where R = C E (i.e. R
i
= C
i
E
i
)
( note that E = R C since addition modulo-2 is the same as subtraction modulo-2 )
for example say that the transmitted codeword was C = [ 110011 ]
and the received word was R = [ 110111 ]
We can say that the error pattern was E = [ 000100 ]
If we multiplied the transpose of the received word by the parity-check matrix H
what do we get ?
H R
t
= H (CE)
t
= H C
t
H E
t
= S
t
The r-tuple S = [ S
1
,S
2
,S
3
] is called the syndrome.
This shows that the syndrome test, whether performed on either the corrupted received word
or on the error pattern that caused it, yields the same syndrome
Since the syndrome digits are defined by the same equations as the parity-check equations,
the syndrome digits reveal the parity check failures on the received codeword. (This happens
because the code is linear. An important property of linear block codes, fundamental to the
decoding process, is that the mapping between correctable error patterns and syndromes is
one-to-one and this means that we not only can detect an error but we can also correct it.)
For example using the received word given above R =[ 110111]
H R
t
=
(
(
(
=
(
(
(
(
(
(
(
(
(
(
(
0
0
1
1
1
1
0
1
1
1 0 0 1 0 1
0 1 0 1 1 0
0 0 1 0 1 1
= S
t
,
where S = [ S
1
,S
2
,S
3
] = [100]
and as we can see this points to the fourth bit being in error.
Now all the decoder has to do ( after calculating the syndrome) is to invert the fourth bit
position in the received word to produce the codeword that was sent i.e C = [ 110011 ].
having obtained a feel of what channel coding and decoding is about, lets apply this
knowledge to a particular type of linear binary block codes called the Hamming codes.
HAMMING CODES
These are Linear binary single-error-correcting codes having the property that the columns of
the parity-check-matrix, H, consist of all the distinct non-zero r sequences of binary numbers.
Thus a Hamming code has as many parity-check matrix columns as there are single-error
sequences. these codes will correct all patterns of single errors in any transmitted codeword.
These codes have n = k + r , where n = 2
r
- 1 , and k = 2
r
- 1 - r .
These codes have a guaranteed minimum Hamming distance d
min
= 3 .
for example the parity-check-matrix for the (7,4) Hamming code is
H =
(
(
(
1 0 0 1 1 0 1
0 1 0 1 0 1 1
0 0 1 0 1 1 1
a) Determine the codeword for the information sequence 0011
b) If the received word, R, is 1000010, determine if an error has occurred. If it has, find the
correct codeword.
Solution:
a) since H C
t
= 0 , we can use this equation to calculate the parity digits for the given
codeword as follows:
(
(
(
(
(
(
(
(
(
(
(
(
7
6
5
4
3
2
1
1 0 0 1 1 0 1
0 1 0 1 0 1 1
0 0 1 0 1 1 1
C
C
C
C
C
C
C
=
(
(
(
(
(
(
(
(
(
(
(
(
7
6
5
1
1
0
0
1 0 0 1 1 0 1
0 1 0 1 0 1 1
0 0 1 0 1 1 1
C
C
C
=
(
(
(
0
0
0
by multiplying out the left hand side we get
1.0 1.0 1.1 0.1 1.C
5
0.C
6
0.C
7
= 0
0 0 1 0 C
5
0 0 = 0
i.e. 1 C
5
= 0 and C
5
= 1
similarly by multiplying out the second row of the H matrix by the transpose of the
codeword we obtain
1.0 1.0 0.1 1.1 0.C
5
1.C
6
0.C
7
= 0
0 0 0 1 0 C
6
0 = 0
i.e. 1 C
6
= 0 and C
6
= 1
similarly by multiplying out the third row of the H matrix by the transpose of the codeword
we obtain
1.0 0.0 1.1 1.1 0.C
5
0.C
6
1.C
7
= 0
0 0 1 1 0 0 C
7
= 0
i.e. 1 1 C
7
= 0 and C
7
= 0
so that the codeword is
C = [C
1
,C
2
,C
3
, C
4
,C
5
,C
6
, C
7
] = 0011110
b) to find whether an error has occurred or not we use the following equation
H R
t
= S
t
, if the syndrome is zero then no error has occurred, if not an error
has occurred and is pin pointed by the syndrome.
Thus to compute the syndrome we multiply out the rows of H by the transpose of the
received word.
(
(
(
(
(
(
(
(
(
(
(
(
0
1
0
0
0
0
1
1 0 0 1 1 0 1
0 1 0 1 0 1 1
0 0 1 0 1 1 1
=
(
(
(
1
0
1
because the syndrome is the third column of the parity-check matrix, the third position of the
received word is in error and the correct codeword is 1010010.
The Generator Matrix of a linear binary block code
We saw above that the parity-check matrix of a systematic linear binary block code can be
written in the following (n-k) by n matrix form
H = [ h I
n-k
]
The Generator Matrix of this same code is written in the following k by n matrix form
G = [ I
k
h
t
]
The generator matrix is useful in obtaining the codeword from the information sequence
according to the following formula
C = m G
Where,
C is the codeword [C
1
,C
2
,.........,C
n-1
,C
n
]
m is the information digit sequence [ m
1
, m
2
, ....., m
k
] , and
G is the generator matrix of the code as given by the formula for G above.
Thus if we consider the single-error-correcting (n,k) = (7,4) Hamming code disscussed
previously, its parity-check matrix was
H =
1 1 1 0 1 0 0
1 1 0 1 0 1 0
1 0 1 1 0 0 1
and thus its generator matrix would be
G =
1 0 0 0 1 1 1
0 1 0 0 1 1 0
0 0 1 0 1 0 1
0 0 0 1 0 1 1
now if we had an information sequence given by the following digits 0011 , the codeword
would be given by C = m G , i.e.
C = = 0 0 1 1
1 0 0 0 1 1 1
0 1 0 0 1 1 0
0 0 1 0 1 0 1
0 0 0 1 0 1 1
0011110
Thus the (n,k) = (7,4) Hamming code generator matrix and the code book:
H = [ h I
n-k
]
G = [ I
k
h
t
]
4
3
2
1
1 1 0 1 0 0 0
1 0 1 0 1 0 0
0 1 1 0 0 1 0
1 1 1 0 0 0 1
row
row
row
row
G
(
(
(
(
=
combinations
codeword
1 1 row1 1000111
2 2 row2 0100110
3 3 row3 0010101
4 4 row4 0001011
5
1 2 row
i
row
j
1100001
6
1 3
etc 1010010
7
1 4
. 1001100
8
2 3
. 0110011
9
2 4
. 0101101
10
3 4
. 0011110
11
1 2 3
. 1110100
12
1 2 4
. 1101010
13
1 3 4
. 1011011
14
2 3 4
. 0111000
15
1 2 3 4
. 1111111
16
1 1 or 2 2 or 3 3 or 4 4
0000000