Tesi
Tesi
October 2018
1|Page
Abstract:
Nowadays, the communication systems like telecom communication and etc. already become
inevitable in people's life. For providing effective and reliable communication, the error control
method must be applied in each communication system.
In the process of each communication system, the transmitted data might be corrupted and in this
situation, the signals which is received in the receiver side are different than the initial signal or
data which generated by the sender (transmitter) [1].
This master thesis project offered that how the error will be detected on the receiver side and also
how does receiver correct this detected error by a method called hamming code. So in this report,
there is illustrate with an example that how the receiver can find in which bit an error is occurred
and how the detected error will be corrected?
FEC (Forward Error Correction) can increase the ability to receive places to correct an error
during a transmission, so the throughput of a data link operation will be improved in a noisy
environment [2].
To indicate how the error correction works, the additional information must append to the data
bits in a form of parity bits, but with increasing the length of a frame, the transmission process
will slow down.
In hamming code method, a block parity mechanism is provided for FEC (forward error
correction) which can be implemented, cheaply. In this method, two errors can be detected, while
just one error can be corrected in each received codeword. In Hamming codes, a special principle
is used called parity principle to correct just one error and find two errors, but the hamming code
method is not able to do both error detection and correction at the same time. One can use
hamming codes as an error detector to obtain both single and double bit errors or use them to
correct single bit error. It will be done by applying more than one parity bits, and each of them
will be computed on different and various combination of bits in the data.
2|Page
Acknowledgements
Performing my graduation project and writing this thesis has been a long journey. I would like to
thank several people for their help and their support during this process.
I would like to express my sincere thanks to my dear supervisor, Professor Roberto Garello at
Politecnico di Torino for his continuous help, scientific guidance and valuable support throughout
the project. Moreover, I also owe a great deal of appreciation to my entire family, especially my
dear father and mother who always support me in my life, and most especially to my wonderful
friend Mrs. Alieh Lotfinejad.
3|Page
Contents
4|Page
4.1.5. Overview of BCH code design ............................................................................... 41
4.2. Reed Solomon Code Definition .................................................................................................. 42
4.2.1. Advantages of Reed Solomon Code ....................................................................... 44
4.2.2. Disadvantage of Reed Solomon Code .................................................................... 44
4.2.3. Example of Reed Solomon Code ............................................................................ 44
5. Alternatives for error correction ......................................................................................................... 45
5.1. N-modular redundancy and Triplication (N-modular redundancy with n=3) ............................. 45
5.2. N version programming (NVP)........................................................................................................ 46
6. Comparative Study (Between Hamming, BCH and RS Codes) ......................................................... 46
7. Verification and Validation of Hamming code ................................................................................... 47
7.1. Verification and Validation for Encoding part of Hamming Code ............................................. 47
7.2. Verification and Validation for Implementation of Check Matrix ............................................. 48
7.3. Verification and Validation for Decoding part of Hamming Code ............................................. 49
8. Direction for Future ............................................................................................................................ 50
9. Conclusion .......................................................................................................................................... 50
References ................................................................................................................................................... 52
5|Page
List of figures
6|Page
List of tables
Table 1. Dominant and information multiplicity ....................................................................................... 21
Table 2. A dimension of possible Hamming codes.................................................................................... 25
Table 3. Parity bits position ....................................................................................................................... 28
Table 4. Calculation method of parity bits ................................................................................................. 30
Table 5. Result of XORing of two single bits ............................................................................................. 30
Table 6. Bit composite word written into memory .................................................................................... 31
Table 7. Calculation of parity bits for hamming code example ................................................................. 37
Table 8. Shows the value of each bit in the final codeword ....................................................................... 37
Table 9. The total series of bits of Hamming code for a dimension of H (7, 4) ......................................... 38
Table 10. Comparative analysis among error correcting codes .................................................................. 47
7|Page
List of symbols
Symbol Description
n Number of total bits
k Size of the data bits
r Size of the parity bits
k/n Rate
n/k Overhead factor
G Generator matrix
H Check matrix
P Parity matrix
𝐏 𝐓 Transposed of parity matrix
𝐇𝐓 Transposed of check matrix
GF Galois Fields technique
S (Si) syndrome
𝐗𝐢 System input
𝐘𝐢 System output
XOR Exclusive OR
<< Shift the bit to the left
>> Shift the bit to the right
& Bitwise of AND
^ Bitwise of exclusive
| Bitwise of OR
R(x) Received codeword
8|Page
Chapter 1.
1. Introduction
So, the data can be corrupted during a transmission and dispatching from the transmitter
(sender) to the receiver, but during a data transmission, it might be affected by a noise, then
the input data or generated codeword is not the same as received codeword or output data
[1]. The error or bit changing which is happened in data bits can change the real value of
the bit(s) from 0 to 1 or vice versa.
In the following simple figure, a base structure of communication system is indicated. And
this figure indicates that how the binary signal can be affected by a noise or other effects
during a transmission on the noisy communication channel:
Noise
Binary signal
Transmitter Receiver
9|Page
Generally, there are three types of errors that can be corrupted in data transmission from
the sender to the recipient:
Single bit error: The error is called single bit error when bit changing or an error
happens in one bit of the whole data sequence [3].
Multiple bit errors: the occurred errors are called multiple bit errors, if there are a
bit changing or an errors in two or more than two bits of the sequence of forwarded
data [3].
Burst errors: if an errors or bits changing are happened on the set of bits in the
transmitted codeword, then the burst error is occurred. The burst error will be
calculated from the first bit which is changed until the last changed bit [3].
These types of errors will be discussed in chapter three of this report in detail.
The main method is using redundancy (parity) to recover messages with an error during
transmission over a noisy channel.
As a simple example, an error can happen in human language in both verbal and written
communication. For instance, if during a reading of this sentence: “this sentence is
miscake”, there is an error and wrong word in this sentence and the error should be found
that in this sentence in which word the mistake is occurred and then it must be corrected,
so two important things must be achieved here: error detection and error correction, and
the principles that must be used to achieve these goals are first in English language the
string “miscake” is not accepted word, so in this point, it is obvious that the error is
occurred, Secondly, the word “miscake” is closest to the real and correct word “mistake”
in English, so it is the closest and the best word which can be used instead of the wrong
word [4].
So, it shows how redundancy can be useful in the example of human language, but the goal
of this project is how the computers can use some of the same principles to achieve error
detection and error correction in the digital communication?
10 | P a g e
To get the best idea of correction by using a redundancy in digital communication, first of
all, it is necessary to model the main scheme contains two main parts called encoding and
decoding like the following figure and in the next parts all of these parts will be explained
in detail and implemented in C++ language.
Noise
Received
Source Encoder Channel Decoder Receiver
message
Figure 2. The main scheme of hamming code [2]
According to this figure [2] [3], first of all, the code will be generated by a source, and then
to do encoding part, the parity (redundancy) bits will be added by the encoder to the data
bits which sent from a source. After that, the generated codeword which is a combination
of data bits and parity bits will be transmitted to the receiver side, and during transmission,
the error or bit changing might be happened in the communication channel over produced
codeword. At the end, the corrupted error must be detected and corrected by decoder on
the receiver side.
Chapter 2.
2. Literature Review
One of the proper subset of information theory is called coding theory, but the concept of
these theories are completely different [2].
The main subject is began from a seminar paper which presented by Claude Shannon in the
mid of 20th century. And in that paper, he demonstrated that good code exist, but his
assertions were probabilistic. Then after Shannon’s theorem, Dr Hamming [1] [3] and
Marcel Golay [5] presented their first error correction codes which called Hamming and
Golay codes [2].
11 | P a g e
In 1947, Dr Hamming introduced and invented the first method and generation of error
correction code called hamming code [1] [6]. Hamming code is capable to correct one error
in a block of the received message contains binary symbols [7]. After that, Dr Hamming has
published a paper [1] in the Bell technical journal with a subject of error detection and error
correction code.
In 1960, other methods for error detection and error correction codes were introduced and
invented by another inventor, for example, BCH code was invented by Bose, Chaudhuri and
Hocquenghem who are a combination of the surname of the initial inventors' of BCH code
[7].
Another error detection and error correction code which presented in 1960 was Reed
Solomon (RS) code that invented by two inventors called Irving Reed and Gustave Solomon
and this method was developed by more powerful computers and more efficient algorithm
for decoding part [8].
In this type of hamming code (EH), the minimum distance will be increased to have
one more than the standard form of hamming code, so the minimum distance is equal
to four among every two codewords. The main frame and structure of the Hamming
code is the same for both binary and extended Hamming code.
12 | P a g e
In fact, in the extended Hamming code there is an extra bit which is added to the
redundant (parity) bit that allows the decoder to recognize between single and double
bit errors. Afterwards, on the receiver side, the decoder can detect and correct an error
with one bit changing and also a double bit errors can be detected (not corrected) at
the same time, and if there is no attempting by a decoder to correct this single bit error,
then it also can detect maximum three errors [10].
In the last example above, the extended hamming code defined as H (8, 4) and here
there are 4 parity bits which are calculated by a subscription among 8 total bits and 4
data bits.
There are two more important schemes for coding which has a special performance
and proficiency that is very close to Shannon limit, and they are called turbo codes
[11], And low-density parity check codes [12]. So the product codes can be more
competitive, therewith, this kind of codes can be used for the implementation of the
fast parallel decoder.
One of the most substantial and prosperous works and paper to accede the Shannon
limit was published in 1993 by three researchers called Berrou, Glavieux and
Thitimajshima, at the same time [14]. They also introduced and stated turbo codes,
which also known as PCCC (PCCC is an abbreviation of parallel concatenated
convolutional codes).
The turbo codes is a special technique and method of the coding theory which used to
prepare a reliable and reputable communication over a noisy or messy communication
channel. The turbo codes are a special class of FEC (forward error correction) codes,
and they are used in 3G or 4G mobile communications, for instance, in LTE. The turbo
codes gain their considerable efficiency and performance with relatively low
complication algorithms for encoding and decoding parts. The turbo codes can attain
BER or bit-error-rate levels which should be around 10−5 at the code rate which is
completely close to the specifically related capacity with advisable complexity and
13 | P a g e
convolution for decoding. And the most important key that made it to the successful
algorithm was using decoding algorithm which is called soft-in soft-out [14] [15]. In
the last years, other similar codes such as SCCCS, low-density parity check codes and
also the block product codes are introduced and studied, but the product codes are
using a high level of rating and degree in parallelization, for instance, PCCC [15].
In this method (turbo codes), the main goal is preparing a perfect and complete set of
techniques and analytical methods to have the performance related to the low-error-
rate for the extended Hamming product codes. For doing analytical approximation
three important parameters are required which must be evaluated for the extended
Hamming (EH) product codes, these parameters are called the code performance at
low-error-rates, the exact knowledge of the code minimum distance and its
multiplicities, respectively [16].
Linear codes are determined by the special alphabets called Σ which are finite
fields. All over, it will be denoted by 𝐹𝑞 which means the finite fields with q
elements (q is a primer power and 𝐹𝑞 is {0, 1, . . . , q − 1}) [16].
14 | P a g e
A. Weight Enumerating Functions (WEF)
The third significant function is IOWEF (or the input output weight
enumerating function) which is written like the underneath formula:
15 | P a g e
B. BER and FER Performance for Maximum Likelihood
Decoding:
In this part, the main foundation related to the evaluation of analytical code
performance is at the SNR like, low error rates. According to the binary
linear codes C (n, k) which can be transmitted by a binary averse
constellation, for example, a 2-PAM, Gray labeled 4-PSK and etc. upon the
increasable White Gaussian Noise channel. So it will be so clear that BER
and FER performance for maximum likelihood decoding which are
corresponded to the specific ratio among the energy of data bits and the
spectral density.
The bit error rate or BER is the number of bits containing an errors in each
time, so the ratio of bit error will be calculated by the number of bits containing
an error over the total number of bits which are transferred over a
communication channel during the time interval (the result can be expressed
as a percentage).
The frame error rate (FER) is a ratio of errors for a received data bits, it can be
used for evaluating a quality of the signal connection. If the result of FER is
so high, it means there are lots of errors among the whole received bits, and in
this situation, the connection can be rejected and dropped [16].
1 𝑘𝐸
FER < = ∑𝑛𝑖=𝑑𝑚𝑖𝑛 2 𝐴𝑖 𝑒𝑟𝑓𝑐 (√𝑖 𝑛 𝑁𝑏 )
0
1 𝑤𝑖 𝑘𝐸
BER < = ∑𝑛𝑖=𝑑𝑚𝑖𝑛 2 𝑒𝑟𝑓𝑐 (√𝑖 𝑛 𝑁𝑏 )
𝑘 0
Where 𝐸𝑏 is the energy of each data (information) bit and 𝑁0 is the noise of
𝐸
spectral density and the ratio between them (𝑁𝑏 ) is significant and related to
0
the BER and FER performance for maximum likelihood decoding.
When the SNR is very high, then the error rate will be very low and actually
the code performance will be concurred with the union band truncated for
contribution of 𝑑𝑚𝑖𝑛 , so the following formula can be written according to the
mentioned condition and the above formulas for very high SNR and 𝐹𝐸𝑅𝐸𝐹
and 𝐵𝐸𝑅𝐸𝐹 are called the code error floor [16]:
1 𝑘𝐸
FER≈ 𝐹𝐸𝑅𝐸𝐹 ≜ 2 𝐴𝑚𝑖𝑛 𝑒𝑟𝑓𝑐 (√𝑑𝑚𝑖𝑛 𝑛 𝑁𝑏 )
0
1 𝑤𝑚𝑖𝑛 𝑘𝐸
BER ≈ 𝐵𝐸𝑅𝐸𝐹 ≜ 2 𝑘
𝑒𝑟𝑓𝑐 (√𝑑𝑚𝑖𝑛 𝑛 𝑁𝑏 )
0
16 | P a g e
C. BER properties:
There are some main problems which are related to the computation of
multiplicity, so the new theoretical results are indicated in the below for
solving these problems. A value of 𝑑𝑚𝑖𝑛 (minimum distance) and its
multiplicity or 𝐴𝑚𝑖𝑛 are explicit and clear for many codes, but the value of
𝑤𝑚𝑖𝑛 is very difficult to compute.
wmin
So, pursuant to the above formula correspond to 𝐵𝐸𝑅𝐸𝐹 , we will have: ≈
k
dmin
Amin . then the mentioned error floor is connected by BER EF ≈
n
dmin
FER EF . (in fact, it’s a relation between BER EF and FER EF error floor).
n
dmin
BER EF ≈ FER EF . will be satisfied by some codes with equality, so in this
n
situation, they satisfy and process 𝐵𝐸𝑅 property, and if all of the multiplicities
which called 𝐴𝑖 and the data multiplicities which called 𝑤𝑖 can be connected
k
by this property: wi = Ai . i. n , but both multiplicity and the properties
correspond to BER are still unsolved and open problem, in the next parts some
solution called extended hamming code and extended hamming product code
will be explained for these properties [16].
In the extended Hamming code EHr (n, k), the minimum distance will be increased to
have one more than the standard form of the Hamming code, so the minimum distance
is equal to four among every two codewords. The main frame and structure of the
Hamming code is the same for both binary and extended Hamming code. In fact, in
the extended Hamming code there is an extra bit which is added to the redundant
(parity) bit that allows the decoder to recognize between single and double bit errors.
So as mentioned above by adding an additional parity bit to the Hamming code,
EHr (n, k) will be characterized by n = 2𝑟 , k = 2𝑟 − 𝑟 − 1 and r is a parity bit which
must be an integer numbers greater than two. Also, the form of multiplicity for
extended Hamming code can be found by the following lemma [16]:
n
n
(2i ) + (−1)i × (n−1) × ( 2 )
i
A2i = , i =2, 3, …
n
17 | P a g e
For introducing an extended hamming product codes, first of all, if C1 is a block code
like (𝑛1 , 𝑘1 ) and 𝐶2 is a block code with a form of (𝑛2 , 𝑘2 ), then a proper product
code which is equal to the multiplication between first and second block
codeCP (𝑛𝑃 , 𝑘𝑃 ) = (C1 × 𝐶2 ), so the result will be equal to: (𝑛1 𝑛2 , 𝑘1 𝑘2 ) code [15].
Figure 3. Relation among data and parity bits in extended hamming product code [15]
1) First of all the proper matrix contains data bits must be written, to create this
matrix, first the data symbols 𝑘1 𝑘2 will be arranged into 𝑘2 × 𝑘1 array.
2) At the second step, 𝑘1 rows will be encoded by using code C2 and then (𝑛2 − 𝑘2 )
parity bits can be added to each row of this matrix.
3) Finally, all 𝑛2 columns must be encoded by using code C1 which can add
(𝑛1 − 𝑘1 ) parity bits to the end of each column in this matrix.
Then it’s so clear that the minimum distance of the product code CP (𝑛𝑃 , 𝑘𝑃 ) = (C1 ×
C2 ) = EH𝑟1 (𝑛1 , 𝑘1 ) × EH𝑟2 (𝑛2 , 𝑘2 ) is dPmin = d1min × d2min and the values of
its multiplicity 𝐴𝑃𝑚𝑖𝑛 and 𝑊𝑚𝑖𝑛
𝑃
are the product of C1 and C2, so the minimum distance
of product code is equal to 16 (𝐴𝑃𝑚𝑖𝑛 = 𝐴16 𝑃
= 𝐴14 × 𝐴24 ). Also, each column of a
matrix is a codeword of C1. But if both C1 and C2 are the linear codes, then all rows
in this matrix are codewords of C2. So according to these definitions, systematic
encoders for C1 and C2 are assumed. And according to this property.
As a proper conclusion for a product code which is a construction of placing the data
bits into the matrix, the rows and columns of this matrix will be encoded separately
by using the linear block codes, this kind of encoder for the product code is drawn in
the underneath figure which shows a typical encoding procedure for a product code
when a block code is used for encoding rows and columns of a matrix [15]:
18 | P a g e
Data bits Row parity
Data bits
Encode rows
bits
Encode columns
In this part, the goal is evaluation and proofing that when a code has a transitive
automorphism group, then the specific multiplicities and the property of BER will
be a part of this code. After that, another issue must be proved which is the issue
that the extended Hamming product codes and the paronymous and derived form
statement for their data multiplicity [16].
A group of transitive automorphism is a group with a special property that any two
specified non-identity elements of the group, there is an automorphism of this
group which is sending the first to the second. According to the binary code C (n,
k) which is described completely in the last part, a permutation of the coordinates
is a symmetry of C, if it maps one codeword in another codeword [16].
19 | P a g e
Theorem A: A binary codes has C (n, k) will satisfy the multiplicity property(𝑤𝑖 ),
𝑖 𝐴𝑖 𝑘
if it has a transitive automorphism group, so: 𝑤𝑖 = .
𝑛
There are codewords which called 𝐴𝑖 where I is a weight of the codewords. First
of all, they should be put in a special matrix called M which the number of rows
and columns of matrix M are called 𝐴𝑖 and n, respectively. Also, the first k
columns of this matrix are contained the number of ones because C is defined as a
systematic [16] [17].
If i and j are two different coordinates (i≠j and 1 <= i <= n) and then the
permutation p is a member of Aut (C) which can map i into j where Aut (C) is
transitive, and the main responsibility of permutation p is mapping any row and
column of a matrix into another row and column.
Transitive automorphism group also exist in the extended Hamming code, so
after that they will contain the multiplicity and BER property, so the data
multiplicity for EH𝑟 (𝑛, 𝑘) or an extended hamming code is:
n
n
2𝑖𝑘 [(2i ) + (−1)i × (n−1) × (2 )]
i
w2i = where i = 2, 3 , …
n2
Theorem B: if there are 2 binary codes C1 and C2 , then it must be proved that the
transitive automorphism group will be like Aut (C1 × C2 ) [38] [39].
According to CP (𝑛𝑃 , 𝑘𝑃 ) = (C1 × C2 ) = EH𝑟1 (𝑛1 , 𝑘1 ) × EH𝑟2 (𝑛2 , 𝑘2 ) = (𝑛1 𝑛2 ,
𝑘1 𝑘2 ), any codeword will be contained some coordinates (xi , yi ) related to its
position in this matrix [16][17].
Then for simplicity, if 1 <= i <= 𝑛𝑃 , then i ≜ (xi , yi ) and j ≜ (xj , yj ) and for each
of them, there are two permutation symmetry p1 of C1 which will map xi in xj and
permutation p2 of C2 that map yi into yj , then the first permutation symmetry will
be applied to the rows of specified matrix and second permutation symmetry will
be applied to the columns of this matrix, so for each couple of coordinates, the
proper permutation symmetry will be built to map coordinate i into coordinate j
and after that, it’s possible to create transitive automorphism group [16] [17].
So, the dominant multiplicity for CP (𝑛𝑃 , 𝑘𝑃 ) = EH𝑟1 (𝑛1 , 𝑘1 ) × EH𝑟2 (𝑛2 , 𝑘2 ) is
𝑃 𝑘1 (𝑛1 −1)(𝑛1 −2)𝑘1 (𝑛2 −1)(𝑛2 −2)
𝑊𝑚𝑖𝑛 = . In the following table all dominant
36
and information multiplicity of square extended Hamming product codes are
shown and by looking this table, it’s obvious that product codes are contained a
large minimum distance by using r which is in the range among 3 to 9 and also
they have very large multiplicities [16].
20 | P a g e
𝑃
CP (𝑛𝑃 , 𝑘𝑃 ) 𝑘𝑃 𝑑𝑚𝑖𝑛 𝐴𝑃𝑚𝑖𝑛 𝑃
𝑊𝑚𝑖𝑛
RP =
𝑛𝑃
(𝐸𝐻3 )2= (8, 4)2 (64, 16) 0.250 16 196 784
(𝐸𝐻4 )2= (16, 11)2 (256, 121) 0.473 16 19600 148225
(𝐸𝐻5 )2=(32, 26)2 (1024, 676) 0.660 16 1537600 16240900
… … … … … …
(𝐸𝐻9 )2 =(512, 502)2 (262144, 252004) 0.961 16 30910041702400 475430551096900
21 | P a g e
The main goal of the BCJR algorithm is minimizing the BER or bit error rate by
calculating APP (a posteriori probability) of a special bits among the bits of the
codeword (in fact, minimizing BER will be done by maximizing APP and exactly for
this reason BCJR decoder is called MAP which is abbreviation of Maximum Posteriori
Probability decoder) [17]. In the underneath figure the proper performance of BER and
FER related to the extended Hamming code is drawn for (EH5 )2 =(32, 26)2 as an
example by applying both BCJR and chase algorithms [15] [16].
Figure 6. BER and FER by applying BCJR and Chase algorithms [16]
In this figure, the drawn curves are obtained with 15 iterations and to progress
iterative decoding of this kind of hamming code a fixed coefficient (multiplier)
weighting outer data is applied during these iterations.
In this case, two more significant operations are considered which are called
shortening or puncturing. If C is a linear binary code with a length of n. then a
shortened code is a special collection of whole codewords of C that are equivalent
to zero at the constant coordinate with the coordinate which is eliminated. So the
codewords in C which are with one at that coordinate must be eliminated from C.
Thus the coordinates which are non-zero for whole codewords must be deleted
from C. Matching to binary linear code C (n, k) and an integer number (s) which
is less than the number of data bits (k), then 𝐶𝑆 (𝑛𝑆 , 𝑘𝑆 ) is a shortened code where
𝑘𝑆 = 𝑘 − 𝑠 and 𝑛𝑆 = 𝑛 − 𝑠, also encoding and decoding for the shortened code is
so easy by using C (n, k) circuits, so it is a sub-code of binary linear code, exactly,
for this reason, the original minimum distance will be kept by this kind of code
[16] [17] [18].
22 | P a g e
The main drawback of shortened extended Hamming codes is that by using this
code, a transitive automorphism group and the multiplicity property never reach
and hold. Then the algorithm called extended McWilliams theorem [18] to dual
code IOWEF will be introduced and stated for computing the data multiplicity for
them.
In fact, C (n, k) is a code with a generator matrix and 𝐶 ⊥ (n, n-k) is a dual of C
with a proper check matrix, then the extended weight of 𝐶 ⊥ will be appointed and
determined by the extended weight of C and vice versa by using the following
formula [16]:
1
IOWC⊥ (x, y, X, Y) = |𝐶| IOWC (x + y, x − y, X + Y, X − Y) where |𝐶| is the number
of codewords, so the underneath algorithm will be used for computing the
multiplicity of a shortening code. So, consider SC: 𝐶 ⊥ (n, n-k), first of all, the
IOWC⊥ which is an abbreviation of input or output weight of enumerating function
must be specified and calculated. Then for computing the IOWSC the extended
MacWilliams identity should be used, and at the end, compute the coefficients of
SC which are 𝐴𝑖 and 𝑊𝑖 [16] [18].
The most significant famous way for incrementing the rate of convolutional codes
is called puncturing. Its process will be done by a particular pattern of puncturing
to mother code C (n, k) which is the original code and the pattern of eliminating
symbols is known as a puncturing pattern [19]. So consider a mother code, a
puncturing code 𝐶 ′ (𝑛′ , 𝑘) will be reached by applying a special puncturing pattern
to each codeword and it’s able to remove d bits which is equal to 𝑛 − 𝑛′ [16] [19].
It is very useful for applications that are reconfigurable which are required for
Reiterated changes of code rates, so for this reason, it can enhance the amount of
code rate without changing the length of a data-rate. And the minimum distance
or dmin can be decreased by puncturing, and according to the following lemma,
this important issue will be proved [16].
Lemma: According to C (n, k) which its minimum distance is equal to 16 and the
puncturing code 𝐶 ′ (𝑛′ , 𝑘) with d = n - 𝑛′ bits, for example for d=1, 2, 3, the
minimum distance for punctured code will be equal to 16 – d [16].
An EH code is a dual of Reed-Muller code which has a transitive automorphism
group and for each triplex of coordinates, then the weight will be equal to -4
codewords. If d ≤ 3, then there are d bits with a clear weight -16 codewords, but if
d > 3, then the minimum distance will be computing according to the puncturing
pattern. The new notion of uniform puncturing in needed for analyzing a
performance of a code [16].
23 | P a g e
As it is told puncturing method is a special process to eliminate certain parity bits
in whole bits of the codeword relevant to the matrix called puncturing matrix [20].
And by using a puncturing method, the code rate will be incremented, but without
growing the complexity of code-rate [20]. But by using the uniform puncturing,
the average multiplicity and also the curves of the average analytical error floor
will be calculated, analytically [16].
In the following, the specific analytical formula is provided, and the multiplicity
of a puncturing code 𝐶 ′ (𝑛′ , 𝑘) will be calculated by this formula:
p′ +d
1 p r−p
A′(wp′ ) = ∑ A(wp) ( ) ( )
(dr ) p′ t − p′
p=p′
Where 0 ≤ w ≤ k, 0 ≤ p′ ≤ t and parity bit r = n – k and other transmitted bits to the
punctured code t = r – d and A′(wp′ ) is the average IO multiplicity of punctured
code upon all available pattern of puncturing which is(dr ) [16].
1 ′
The average multiplicity or A′i = ( r ) ∑𝑤+𝑝′ =𝑖 ∑𝑝𝑝=𝑝′
+𝑑 p r−p
A(wp) (p′) (t−p′) and the
d
Chapter 3.
3. Theoretical Description of Hamming Code
A hamming code is a simple method of error detection and error correction which is used
frequently [22]. A hamming code always check the error for all the bits which exist in the
codeword (in fact, it checks all bits of a codeword from the first bit to the last available bit)
[22]. And exactly for this reason the hamming code is called linear code for error detection
and error correction that can detect maximum two synchronic bit errors and it is capable to
correct only single bit error ( can correct just one bit error) [3].
This method works by appending a special bits called parity or redundancy bits. Several piece
of these extra bits is installed and inserted among the data bits at the desired positions, but
the number of these extra bits is depend on the number of data bits [22].
24 | P a g e
The hamming code initially introduced code that enclosed [1], for example, to construct the
Hamming (7, 4) that the total bits are equal to seven, which four bits are data bits into seven
bits by adding three parity bits. And the number of each bit must start from one, like 1, 2, 3,
4, 5, 6, 7 and to write them in binary: 001, 010, 011, 100, 101, 110, 111.
The parity bits are calculated at the proper positions that are calculated by powers of two: 1,
2, 4 and etc. And the data bits must be located at another remained positions which in this
example are: 3, 5, 6, 7.
Each data bit is contained in the calculation of two or more parity bits. In particular, parity
bit one (r1) is calculated from those bits that their positions has the least considerable or
important set of bits which are: 1, 3, 5 and 7 (or in binary 001, 011, 101 and 111).
Parity bit two or r2 (at index two, or 10 in binary) is calculated from the bits that their index
has the second least important set of bits which are: 2, 3, 6, 7 (or 010, 011, 110, 111 in
binary).
Parity bit three or r3 (which must be located at position four or 100 in binary) is calculated
from the bits where their positions has the third least considerable set of bits which are: 4,
5, 6 and 7 (or 100, 101, 110, 111).
The code sends message bits padded with specific parity or redundancy bits in the form of
is the block size or a whole number of bits and k is the number of data bits in the generated
codeword [1]. All the procedure which is required for adding parity bits to the data bits to
encode and create a proper codeword will be explained in next parts of this report.
In the following table, all the possible Hamming codes are indicated:
25 | P a g e
According to table 1, if there are r parity bits, it can cover bits from 1 up to 2𝑟 − 1 which
called total bits (or n), and also the number of parity bits should be more than one (r > 1).
For each dimension of hamming code, there is a rate which is equal to a division of the number
𝑘
of data bits and number of total bits (rate = 𝑛 ) and always its result will be less than 1,
another important factor is called overhead factor which is calculated by a division among
𝑛
total bits or n and data bits or k (overhead factor = 𝑘 ), and its result is always more than one
[2] [3].
In the following figure which indicated another description of the Hamming code. There are
three nested circles in this figure and they are related to the three parity equation defining
the Hamming code, also there are seven areas among these available circles in this figure
that are related to the seven bits in a final codeword [2]. The number of the circle can be
extended for each dimension of hamming code.
When the single bit error happens, during a transmission process, this error will be fixed by
flipping this bit (single bit) in the proper area, related to the position where the error
happens.
X7
X2 X4 X3
X6 X1 X5
For example: For H (7, 4) which encodes four data bits by appending three parity or
redundancy bits to generate a proper codeword which is a combination of both parity and data
bits.
26 | P a g e
r1
k1 k4 k2
r2 k3 r3
Figure 8. Graphical description of H (7, 4) with 4 data bits (k) and 3 parity bits (r) [2]
In the upper figure which describe [7, 4] Hamming code, graphically, each parity bits can
cover just its adjacent bit positions which can be common with other parity bits in this figure:
For instance, parity bit 1 (r1) covers data bits: k1, k2, k4.
And parity bit 2 (r2) covers data bits: k1, k3, k4.
And parity bit 3 (r3) covers data bits: k2, k3, k4.
Hamming code is a specific linear code which can correct just one error by adding r parity
bits to k data bits that generated by the source to have a codeword with a length of n which
is equal to k + r. And the data bits or k is equal to 2𝑟 − 𝑟 − 1 to generate a codeword with
a length of 2𝑟 − 1 [1] [6] [7].
General algorithm for the encoding part of hamming code is described in the following:
1. r parity or redundancy bits are combined to k data bits to creating a proper codeword
which is contains r + k bits.
So the bit position sequence is from the position number 1 to r + k.
In fact, for decoding part on the receiver side which is contained detection and
correction step for an occurred error, extra bits is needed to send some extra bits with
data bits which called parity (redundant) bits and these parity bits are added by the
sender (by encoding) and they always removed by the receiver on the receiver side (by
decoding) [23].
27 | P a g e
But how to merge the data bits and parity bits into a codeword?
The parity bit positions are always numbered in powers of two, reserved and prepared
for the parity bits and another bit positions are related to the data bits [23].
In the following simple table, the position of each parity bits (r) presented in a grey
colored cells and they are reserved for the parity purpose.
Bit position 1 2 3 4 5 6 7 …
Parity bits r1 r2 r3 …
After that, the data bits (k) are copied to the other free and remaining positions where
they are not reserved before. And the data bits will be appended in the same order as
they are appeared in the main data bits which generated by source.
k1 k2 k3 k4 …
r1 r2 k1 r3 k2 k3 k4 …
So, the transmitter adds parity bits through a process that creates a relationship between
parity bits and specified data bits.
Then the receiver will check the two set of bits to detect and correct the errors which
will explain in the decoding part [23], but the following figure can present the main
idea of coding that is used in the hamming code.
28 | P a g e
Encoder Decoder
Generator Checker
Unreliable transmission
Message + parity = Received
codeword (n bits) codeword (n bits)
Transmitter (Sender) Receiver
Figure 10. The Structure of Encoder and Decoder [23]
2. The value of parity bits are calculated by XOR operation of some combination of data
bits [24].
A combinational of data bits are indicated in the downward table which all parity bits and
data bits and their position that should be calculated according to the rules of encoding part
of the hamming code.
For example, for calculating the value of parity bit number one which called r1, the XOR
calculation must begin from r1, then check one bit, and skip one bit until the last bit which
exists in the sequence of bits in the codeword.
29 | P a g e
Bit position 1 2 3 4 5 6 7 …
Bit type r1 r2 k1 r3 k2 k3 k4 …
r1 * * * *
For the first parity bit (r1): Begin from r1, then check 1 bit, skip 1 bit,…
(This process will be continued until the last available bit).
r1=XOR of bits 3, 5, 7, ... (r1=k1⊕k2⊕k4⊕…)
r2 * * * * …
For the second parity bit (r2): Begin from r2, then check 2 bits, skip 2 bits,…
(This process will be continued until the last available bit).
r2=XOR of bits 3, 6, 7, … (r2=k1⊕k3⊕k4⊕…)
r3 * * * * …
For the third parity bit (r3): Begin from r3, then check 4 bits, skip 4 bits,…
(This process will be continued until the last available bit).
For r3, 4bits must be checked, because r3 is located on 4th bit of codeword.
r3=XOR of bits 5, 6, 7, … (r3=k2⊕k3⊕k4⊕…)
X Y X⊕Y
0 0 0
0 1 1
1 0 1
1 1 0
Table 5. Result of XORing of two single bits
The XOR operation in table 4 indicates the odd function. If the number of 1’s among the
variables X and Y are odd number, then the result of XORing among these two single bits
are equal to one, otherwise if the number of 1’s are even numbers, then the result will be
zero.
30 | P a g e
3.4. Theoretical description for decoding part of Hamming Code
In block coding, the message is divided into blocks and each block in contains a data bits.
According to encoding part of hamming code in the last part, r parity bits will be added to
each block and their data bits, so the total length of each block (n) is equal to the summation
of data bits (k) and parity bits (r) and the resulting n bits block is called codeword.
For instance: The 4 bits data word with the three parity bits as a seven bits combined word
containing binary numbers which they should be written in the specific memory. (For
replacing the three parity bits in their proper positions, the seven bits mixed word written
into memory must be catch) [3] [24].
After all definitions of encoding part and calculating a proper codeword, In the decoding
part, two important steps are desired called error detection and error correction.
Bit position 1 2 3 4 5 6 7 …
Bits r1 r2 k1 r3 k2 k3 k4 …
1. The first required matrix for decoding part of the hamming code is a generator matrix
(G) that the standard form for this matrix is G=(IK |P) where IK is identity matrix of k ×
k and P is a parity matrix of k × r.
Parity matrix (P) is a matrix extracted from the last three columns of the generator matrix
and it will be calculated according to the bits in each row of generator matrix, contains
data bits [23].
In each rows of this matrix the codewords are the linear combinations of the rows of this
generator matrix, in fact, it means each row of this matrix which is a combination of data
bits and parity bits is the codeword, so the three last binary numbers of each row are the
parity bits which are calculated according to the data bits which are in the first four bits
in each row.
1 0 0 0 1 1 0 1 1 0
0 1 0 0 1 0 1 1 0 1
For instance: G = (IK |P) = [ ] where P = [ ]
0 0 1 0 0 1 1 0 1 1
0 0 0 1 1 1 1 1 1 1
31 | P a g e
2. The second required matrix for decoding part of hamming code is check matrix (H).
This matrix describes the linear relevance that must be satisfied by the components in
each codeword [25]. It can be used to decide whether a particular vector is a codeword
and is also used in decoding algorithms, also check matrix is given by H=(−P T |In−k )
where P T is the transposed matrix of the parity matrix with exchanging rows and column
of this matrix [25].
The following two matrices are the available types of check matrix for [7, 4] Hamming
codes:
1 1 0 1 1 0 0
First type of check matrix: H = (−P T |In−k ) = [1 0 1 1 0 1 0] and the parity
0 1 1 1 0 0 1
1 1 0 1
matrix or P T = [1 0 1 1]
0 1 1 1
This kind of check matrix which is presented above is the standard form of check matrix
(H), And It has among its columns each non-zero triple from exactly once [26].
But in this project another kind of check matrix is used like the next matrix:
0 0 0 1 1 1 1
Second type of check matrix: H = [0 1 1 0 0 1 1] and this matrix is a binary
1 0 1 0 1 0 1
lookup table in vertical order which the column contains all zero numbers is eliminated.
Among these two check matrixes which showed above, the first matrix is the check
matrix for a code which is contained a standard form of generator matrix (G). And the
second matrix checks a code is not contained a generator matrix (G) which is exist in the
standard form [26].
There are three kinds of errors which may occur during a transmission of codeword or
data from the sender to the receiver.
32 | P a g e
Sent 1 0 1 1 0 1 0
Received 1 0 1 1 0 0 0
Sent 1 0 1 1 0 1 0
Received 1 0 1 1 1 0 0
Sent 1 0 1 1 0 1 0
Burst error
Received 1 0 0 1 1 0 0
33 | P a g e
3.4.3. Error Detection and Error Correction
As described in the last part, in any communication system, first of all, the data (message)
in the sender side must be generated and then the generated data bits must be encoded in
the block of binary bits containing a value of zero and one which called codeword which
the procedure and the rules for creating a proper codeword were discussed before, after
that a codeword which is a binary vector, should be forwarded and transmitted to the
receiver side and the generated message must pass from a communication channel
between transmitter (sender) and the receiver and during a transmission on the channel,
an error or bit changing may happens [7].
If a codeword which generated on the transmitter side and the received codeword on the
receiver side are both the same, then the received codeword is accepted and there is no
error, otherwise, the detected error must be corrected [25], for this reason in any
communication system with a variety, the error correction codes are used for detecting
and correcting a probable errors in a transmitted codeword [1] [25]. But how to detect and
correct in decoding part?
For a decoding part of a hamming code, there are two significant matrices called generator
matrix (G) and check matrix (H) that are presented in the following respectively:
0 0 1
0 1 0
1 0 0 0 1 1 0
0 0 0 1 1 1 1 0 1 1
0 1 0 0 1 0 1
G =[ ], H = [0 1 1 0 0 1 1], H T = 1 0 0
0 0 1 0 0 1 1
1 0 1 0 1 0 1 1 0 1
0 0 0 1 1 1 1
1 1 0
[1 1 1]
In this project for decoding a received codeword (C), just check matrix (H) and its
transposed matrix (H T ) is used and they will be enough for syndrome calculation. So,
when the codeword with an error received by the receiver, first the received codeword
must multiply by a transposed of check matrix to do error detection which this
multiplication is called syndrome. If the syndrome result is equal to the zero vector (the
vector with all zero elements), there is no error, but if there is an element(s) with a value
equal to one, there is error occurred in received codeword [13] [25].
34 | P a g e
0 0 1
0 1 0
0 1 1
Syndrome (S) = [𝐶] . [H T ] = 0 where H T = 1 0 0 and the codeword (C) is given by
1 0 1
1 1 0
[1 1 1]
the standard matrix product C = m * G = 𝑚 ∗ (IK |P) = [𝑐1 , 𝑐2 , … . , ck ,
ck+1 , … , cn ] which G is generator matrix that is equal to k * n. And m is message part
with k bits and p is parity matrix with n - k bits and 𝑐1 , …, 𝑐𝑘 is message part and
ck+1 , … , cn is parity part.
For error correction, first must look at the syndrome result, and then the result must be
compared to the columns of check matrix. Then the error will be corrected and fixed, just
by changing a value of bit where the error occurred in corresponding bit in the received
codeword [24].
Hamming code has a capacity to detect maximum two errors, but just can correct one error
in each received message that means the Hamming code cannot correct burst errors if
more than one error occurs during transmission of data and this issue is a disadvantage of
hamming code, also another disadvantage of hamming code is that parity bits are also send
to the receiver side by appending to data bits therefore more bandwidth is needed to send
the generated data [24] [25].
As an example for Hamming code, the encoding and decoding procedure of H (7, 4) will be
evaluated in the following parts.
An Encoding of Hamming (7, 4) will be done by encoding procedure of the Hamming code
that is a composition of logical functions which can convert an incoming binary message
that here is equal to 4 binary digits to the proper codeword before transferring to the
receiver side [27].
There are two kinds of bits for the hamming code encoding:
35 | P a g e
a) Data bits that are generated and transmitted from the transmitter (sender) to the
receiver, for example: 1 0 0 1.
b) Parity bits (redundant bits) which is extra bit stream or extra binary digits that are
generated in special way and combined with data bits (the combination of data bits and
parity bits is called codeword) and then the codeword must be transferred to the
receiver.
To calculate the number of parity bits the following method must be used:
2𝑟 > = k + r + 1 where (r = parity bit which is more than 1, k = data bit) [28].
If r = 2 then: (22 > = 4 + 2 + 1) = (4 > = 7) that is not correct, so certainly this value
is refused. Then the value of r must be increased.
Total number of bits (n) = Number of data bits (k) + number of parity bits (r) = 4 + 3 =
7.
c) After specifying the number of parity bits, then the position of each parity is calculated
by 2𝑛 like the following where (n = 0, 1, 2, 3, …, n) [28].
In the next figure, the combination of data bits and parity bits which explained in the
last chapter is shown in the frame of this example for H (7, 4) that the sequence of data
bits is 1 0 0 1.
Codeword r1 r2 1 r3 0 0 1
36 | P a g e
Afterwards, the value of each parity bit will be calculated by XOR operation which
explained in the section 3.3.
1 2 3 4 5 6 7
r1 r2 k1=1 r3 k2=0 k3=0 k4=1
r1 * * * *
For calculating a value of r1: begin from r1, then check 1 bit, skip
1bit, etc. , so: (r1 = 1 ⊕ 0 ⊕ 1 = 2 (even) = 0)
r2 * * * *
For calculating a value of r2: begin from r2, then check 2 bits, skip
2 bits, etc. , so: (r2 = 1 ⊕ 0 ⊕ 1 = 2 (even) = 0)
r3 * * * *
For calculating a value of r3: begin from r3, then check 4 bits, skip
4 bits, etc. , so: (r3 = 0 ⊕ 0 ⊕ 1 = 1 (odd) = 1)
Bit Position 1 2 3 4 5 6 7
Bit name r1 r2 k1 r3 k2 k3 k4
Value of each bit 0 0 1 1 0 0 1
The total series of bits of Hamming code for a dimension of H (7, 4) is shown in the
following table, in truth, correspondent to the lookup table which contain all
combination of data bits, when there are four generated data bits, in the lookup table
there are fifteen different cases and states which are contained different combinational
of binary numbers (as a underneath table in the column of data bits), then the proper
parity bits will be located at the proper place among data bits and the whole bits are
displayed in the column called codeword:
37 | P a g e
Bit Data bits Parity bits Codeword (data bits + parity bits)
# k1 k2 k3 k4 r1 r2 r3 r1 r2 k1 r3 k2 k3 k4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 1 1 1 1 1 0 1 0 0 1
2 0 0 1 0 0 1 1 0 1 0 1 0 1 0
3 0 0 1 1 1 0 0 1 0 0 0 0 1 1
4 0 1 0 0 1 0 1 1 0 0 1 1 0 0
5 0 1 0 1 0 1 0 0 1 0 0 1 0 1
6 0 1 1 0 1 1 0 1 1 0 0 1 1 0
7 0 1 1 1 0 0 1 0 0 0 1 1 1 1
8 1 0 0 0 1 1 0 1 1 1 0 0 0 0
9 1 0 0 1 0 0 1 0 0 1 1 0 0 1
10 1 0 1 0 1 0 1 1 0 1 1 0 1 0
11 1 0 1 1 0 1 0 0 1 1 0 0 1 1
12 1 1 0 0 0 1 1 0 1 1 1 1 0 0
13 1 1 0 1 1 0 0 1 0 1 0 1 0 1
14 1 1 1 0 0 0 0 0 0 1 0 1 1 0
15 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Table 9. The total series of bits of Hamming code for a dimension of H (7, 4)
38 | P a g e
0 0 1
0 1 0
0 1 1
Then syndrome (S) = [𝐶] . [H T ] = [0 0 0 1 0 0 1] . 1 0 0 = [2 1 1] = [0 1 1] and this
1 0 1
1 1 0
[1 1 1]
vector is non-zero vector, so it means during a transmission from sender to the receiver
an error or bit changing is occurred, and then all the rows of matrix H T should be checked
to find [0 1 1] among the rows of H T . In this example [0 1 1] is exist on the third row
of H T , after that for correcting an error the third position of matrix C = [0 0 0 1 0 0 1]
must change to: C = [0 0 1 1 0 0 1].
Chapter 4.
4. Alternatives for Hamming Code
A BCH code is used to correct a multiple random errors, and this code is a multi-level cyclic
digital error correcting code, so BCH code is powerful multiple error correction code with
a mathematical properties. And the main advantage of BCH code is flexibility for block
length and code rate [29] [30].
For positive pair of integer’s r > = 3 and t, (n, k) BCH code is contained the parameters like:
Total bits (n) is: n = 2𝑟 − 1
Number of parity or redundancy bits: n – k < = r * t
Minimum distance (which is called dmin ) : dmin > = 2t + 1
Capability of correcting an error for the BCH code: t errors
And t < (2𝑟 − 1) / 2 which is random error detected and corrected which also called t error
correcting BCH code [29].
39 | P a g e
4.1.1. Advantages of BCH code
BCH code has a strong capability for correcting an errors which is ability to find
(detect) and correct an errors at the same time, and this is the main and most
significant and substantial property of BCH codes [30] [31].
Also, a process of coding is simpler than other methods and finding an efficient
method for decoding part of BCH is simple [32].
The considerable features for the BCH codes is that the accurate and exact control
exist over the number of error bits by this code, specially, it is possible to implement
a BCH code (in binary) which the multiple bit errors can be corrected by this code
[32].
In BCH code, when the code length increases, then the process of decoding part will
be more complex [31].
In (15, 7) BCH encoder, for instance, if the message or the codeword contains seven
bits [𝑚0 , 𝑚1 , … , 𝑚6 ] are used and applied in parallel to have a serial shift register
[21].
Parity bits are computed and then send to these serial parallel shift register by using
these message bits and then these parity bits are appended to the original message
bits to have encoded data contains 15 bits [29] [33].
First of all, a syndrome (Si) where (i = 1, 2, 3, …, 2t) will be calculated from the
received codeword r(x).
40 | P a g e
At the second step of BCH decoding, the error location polynomial S(x) will be
determined.
And at the end, a root of S(x) will be found, and then the occurred error will be fixed
and corrected [33].
The figure below represents the proper overview of BCH code design which contains
an example, and its good pattern for implementing this code [31].
Error
Introduction
Module
In above figure the number of generated data bits are equal to seven bits, the reason of
choosing seven bits is an indication of ASCII characters will be easier. Then these
seven bits will be encoded by BCH encoder to create a proper codeword which is
contained fifteen bits [32].
Thereupon, the generated codeword will be transmitted to the channel, and the channel
might be affected by a module which is called error introduction module that creates
and inject an errors to one or more bits of a codeword, randomly. Then, a codeword
with one or more errors is reached to the BCH decoder [32].
41 | P a g e
In the decoding module, the syndrome formula will be calculated to find and
distinguish the position where an error bits are located there. At the end, the detected
errors will be corrected by flipping the error bits and at the output of the decoder, the
main data bits which were generated at the first step will be retrieved [32].
In the underneath figure the structure of error introduction module is drawn and
displayed.
Reed Solomon (RS) codes are another kind of error correction codes which are block-based
code and the applications of RS codes are so wide and large range in digital communications
and storage. And they are used to correct errors in some systems including Wireless or
mobile communications, Satellite communications and etc. [8] [34].
RS code is non binary linear code and they are used for burst error correcting. A typical
system of RS code is shown in the following figure:
Noise / errors
42 | P a g e
So, the RS codes are written according to the following formula [35]:
Where k is the length of symbol, n is the length of block which n = (2𝑟 − 1), There are n-
k parity symbols of s bits each. Also, up to t symbol errors can be corrected by A decoder
𝑛−𝑘
of RS code where t = 2 that contain errors in a code word, so 2t parity bits are needed to
correct t errors (t is the number of true symbols) : 2t = n-k [34] [35].
For encoding and decoding parts of Reed Solomon code, applying a special mathematics
called finite fields or Galois Fields (GF) are needed [4] [35]. There is a particular feature
for a finite field which the specific arithmetic operations like: addition (+), subscription (-),
multiplication (*) and division (/) on the finite elements will have an outcome in the field.
Therefore, for this reason, the encoder and decoder part of RS code need to perform these
operations, and a particular software or hardware functions are required for implementing
these arithmetic operations.
DATA PARITY
k 2t
n
RS code is a subset of a BCH codes and linear block codes that are contained s bit symbols
specified as RS (n, k) which n is the total number of surrounded symbols (the length of the
codeword) and k is the number of data. It means that the encoder catches k data symbols
of s bits and then it appends the symbols correspond to the parity bits for
generating n symbols which called codeword [36].
All the procedure and instructions for the encoding step of Reed Solomon code and BCH
code are the same and there is no difference among them [31].
43 | P a g e
The only difference between RS code and BCH code is that in RS code there are several
kinds of ways and methods for decoding part, like, iterative and Euclid algorithms [33].
A Reed Solomon code has a special features and characteristics and because of these
special positive points, RS code will be so popular and unique.
In the Reed Solomon, code an efficient and powerful algorithm is used which is called
Berlekamp Massey algorithm that is a bounded distance decoding algorithm [33].
Also, there is a significant ability for RS code to correct both random error and burst
error [34].
A Reed Solomon code has a very high and superior coding rate, and this property is
suitable for using in several applications, for instance, transmission, storage and etc.
Thus because of the high coding rate of Reed Solomon code, RS code can be more
effective and more powerful than hamming code for a data transmission in the
communication systems channels [33] [34].
𝑘
Coding rate =
𝑛
44 | P a g e
Chapter 5.
5. Alternatives for error correction
To build fault tolerant system, there is a popular technique which called TMR (triple
modular redundancy). In this technique there are three module units, and the output of
these three units must be comprised by a voter [37].
The fault-tolerant structure which used is given in the following Figure. The result of a
vote of the outputs of redundant components C1, C2 ... Cn for each input is system output
where n = 3, 5, 7, … .
C1 (digital
circuit 1)
Cn (digital
circuit n)
The original idea of TMR is naive and simple, a triple modular redundant or TMR R (3,
0) is a typical and usual N modular redundant example which exist three modules,
without any spares. So these three modules are used with the serial voter [38] [39].
Also, for TMR in the last figure, there are three parallel modules (components) after the
three parallel components a voter (serial voter) exist. And these three parallel systems
indicate a process and the result will be processed by a system called voting system to
generate and produce a single output. In this system, if one of these three systems fails
or drop, then the error will be corrected and masked by other two systems which exist
correctly [37] [39].
45 | P a g e
5.2. N version programming (NVP)
N-version (or multi-version) programming is a proposed method which can provide
fault tolerance in software [28]. And NVP is a software analogy of N-modular
redundancy which used in fault-tolerant that defined the last part and can tolerate both
software and hardware faults [40].
For NVP there are some evidence which the concept of all of them are the same and
they use a different algorithm in their systems, but the result must be the same.
In the structure of NVP, there are N implementation like N-versions of an application
which developed separately and executed in parallel (specification of a number of
versions are necessary to ensure acceptable levels of software reliability) and each
version is a complete implementation of a specification and then all of their outputs
will compared by decider ( or voter) [39] [40].
Version 1 Decider
Version 2 Voter
Input Output
Version 3
Chapter 6.
6. Comparative Study (Between Hamming, BCH and RS Codes)
Hamming code can only correct a single bit errors, In fact, hamming code has a capability to
detect up to two errors (or maximum three parallel and adjacent errors), but can correct just
one error in each message, and this inefficiency of hamming code that cannot handle to
correct multiple bit errors can be compensated by Reed Solomon code which can correct
more than one error and can be used on many of the current controllers, and BCH code is
powerful error correcting code which can correct multiple bit errors and is going to become
more popular, because their efficiency improved over RS code. Thus both hamming and RS
codes are kinds and under the category of the BCH code.
46 | P a g e
The following table displays the comparative analysis among these error correcting codes:
Chapter 7.
7. Verification and Validation of Hamming code
The code of the proposed implementation has been written in C++ programming language
and tested and simulated using visual studio software (version 2017). The result of the
Hamming code implementation, for instance, Hamming (31, 26) is given as the following
figures and for another dimension of hamming code, the same codes are replaced and just
some values are changed, like the number of data bits, the number of rows in the check matrix
and some other values and the result of all dimensions are working well.
In the following screenshot of encoding part result, first a generated random binary
numbers for H(31, 26) is printed out, so the input information (data) bit has a width of 26
bits ( 26 random binary numbers), and after that, the next steps are calculated according
to this generated sequence of binary numbers, like calculation of the number of
redundancy bits, the calculated parity bits and their proper positions, a calculation of total
number of bits in the generated codeword which is consist of generated binary data bits
47 | P a g e
and calculation of parity bits. And at the end, the final codeword which is ready to transmit
to the receiver side will be printed out in the local windows debugger, correctly.
Also, the bits of final codeword is arranged and ordered from the left side to the right side.
Conforming with all definitions and the steps of implementation for the check matrix, the
subsequent result which presents a required check matrix in the receiver side for decoding
is printed out, in fact, the check matrix (H) is a binary lookup table which always using in
hardware engineering and the logical circuit, but it is designed and implemented in
vertical, and also the first column of this matrix which contains all zero elements is
removed to reach a desired check matrix.
Figure 22. The result of check matrix for Hamming (31, 26)
48 | P a g e
Refer to a section 7.2.2.3, in the following screen capture, the desired output is printed out
for implementation of both check matrix (H) and transposed of check matrix (H T ) which
is explained in the section of implementation of check matrix.
Figure 23. The result of check matrix (H) and transposed of check matrix for Hamming (31, 26)
The verification and validation of this part is totally depended on applying the
framework and error injection part, but all the codes which are written and appended to
the decoding part are tested and compiled in another file of visual studio by inserting
49 | P a g e
some extra variables and printing some output for checking the working reliability of
this part of code, and all functions are worked, correctly.
In this part, an error will be injected on the desired position in the transmitted codeword
and then the syndrome will be calculated to find a position where an error is occurred,
then the error will be corrected with flipping the position of this error. And at the end of
the code, an initial generated data bits which were generated by a source in the sender
side will be printed out in the output of decoding part.
Chapter 8.
8. Direction for Future
In the hamming code method which is a simpler system of error detection and error correction
code that uses a special bits called parity or redundancy bits to correct an error or bit changing
[28] [44], the main and considerable drawback of hamming code which can be improved in
the next research in the future work is extending the capability of error correction from the
single bit error correction in hamming code to the larger number of error correction by using
another codes or methods, like BCH, Reed Solomon (RS) and some other designed codes,
there are several kind of systems for correcting an error(s) in a data bits which are more
efficient than hamming code, because the hamming code is limited to correct just one bit error
or bit changing and multiple errors and burst error are not supported by this error correction
code, and this inefficiency of hamming code can be improved and compensated by these
alternative methods.
Chapter 9.
9. Conclusion
In this thesis project, the structure of hamming code and the evaluation of its construction are
tested and examined successfully and the implementation of hamming code is done in the
software environment of Visual Studio 2017 and C++ language.
From the content of this report, it is clearly indicated that how to detect an error and bit
changing in the received sequence of bits (codeword) by checking the value of parity or
redundancy bits. If the bits of a codeword in the sender side are not the same and matched
with the value of a received sequence of bits in the receiver side, it shows the received
codeword has an error and if the values are matched means the received codeword or signal
has no error.
50 | P a g e
After detecting an error, the bit containing an error will find by adding the sequence numbers
of parity bits which calculation of the value and the position of each parity bits has specific
procedure which is explained before in encoding part of this report, and on the receiver side,
to detect an error, the more significant point is check matrix (H) and transposed of check
matrix ( H T ) which is used in the syndrome calculation for multiplying with received
codeword, the result shows the sequence number contains an error and incorrect bit. After
finding the sequence number of the incorrect bit, the detected error must be corrected by
changing the value of a wrong bit.
51 | P a g e
References
[1] HAMMING, R. W. “Error Detecting and Error Correcting Codes.” Bell System
Tech. Jour., 29 (1950): 147-160.
[2] Aydin Nuh, "An Introduction to Coding Theory via Hamming Codes: A
Computational Science Model" (2007).
[3] Hamming, Richard Wesley (1950). "Error detecting and error correcting codes". Bell
System Technical Journal. 29 (2): 147–160.
[4] Isaac Woungang, Sudip Misra, Subhas Chandra Misra, “Selected Topics in
Information and coding theory” Shetter, W. Z. 2000. This essay is redundant.
[5] Golay, M. J. E. 1949, “Notes on digital coding”, Proc. IRE. 37: 637
52 | P a g e
[11] Yaqi Wang, Jun Lin, Zhongfeng Wang “A New Soft-input Hard-output decoding
algorithm for Turbo Product Codes,” IEEE Trans. Inf. Theory, pp. 192-197, 06 August
2002.
[13] Xiaoling Huang, N. Phamdo, Li Ping, “Recursive method for generating weight
enumerating functions of trellis codes”, IEEE Trans. Inf. Theory, pp. 773-774, Vol. 37 No.
12, 7th June 2001.
[15] Orhan Gazi, Ali Özgür Yılmaz, “Turbo Product Codes Based on Convolutional
Codes”, ETRI Journal, Volume 28, Number 4, August 2006.
[17] L. R. Bahl, J. Cocke, F. Jelinek, and J. Raviv, “Optimal decoding of linear codes
for minimizing symbol error rate,” IEEE Trans. Inform. Theory, vol. 20, pp. 284–287,
Mar. 1974.
53 | P a g e
[20] Ravindra M. Deshmukh and 2 S.A. Ladhake, “Analysis of Various Puncturing
Patterns and Code Rates: Turbo Code”, International Journal of Electronic Engineering
Research ISSN 0975- 6450 Volume 1 Number 2 (2009) pp. 79–88.
[22] Wirda Fitriani, Andysah Putera, Utama Siahaan, “Single-Bit Parity Detection and
Correction using Hamming Code 7-Bit Model”, International Journal of Computer
Applications (0975 – 8887), Volume 154 – No.2, November 2016.
[23] Behrouz A Forouzan, “Data communication and networking”, 4th edition Tata
McGraw-Hill Publication
[24] A. K. Singh. “Error detection and correction by hamming code.” In Proc. Information
Computing and Communication (ICGTSPICC) 2016 Int. Conf. Global Trends in Signal
Processing, pages 35-37, December 2016.
[26] Stefan Scholl, Norbert When, “Efficient architectures for parity check matrix
generation” Signal Processing and Information Technology (ISSPIT) 2016 IEEE
International Symposium on, pp. 280-285, 2016.
[27] Barry, Paton, (March 1998 Edition). Fundamentals of Digital Electronics (pp. 2 -
3). Dalhousie University.
[28] Debalina Roy Choudhury, Krishanu Podder, “Design of Hamming Code Encoding
and Decoding Circuit Using Transmission Gate Logic”, IRJET, volume: 02, Issue: 07, Oct.
2015.
[29] D. Augot, P. Charpin, and N. Sendrier, “Studying the locator polynomials of minimum
weight code words of BCH codes”, IEEE Trans. Inf. Theory, vol. 38, no. 3, pp. 960–973,
May 1992.
[30] W T Penzhorn, “A Fast Algorithm for the Decoding of Binary BCH Codes”, Dept.
of Electr. & Electron. Eng., Pretoria Univ., South Africa, Aug. 1993
54 | P a g e
[31] Zhang Xinyu, “A basic research on Forward Error Correction”, IEEE Trans. Inf.
Theory, pp. 462-465, 08 September 2011.
[32] Eshtaartha Basu1, Dhanush.P2, Kishor S3, Geethashree A4, “ERROR CONTROL
CODING USING BOSE-CHAUDHURIHOCQUENGHEM (BCH) CODES”,
International journal of electronics and communication engineering and technology
(IJECET), Volume 5, Issue 8, pp. 86-96, August (2014),
[34] Sanjana P. Choudhari and Megha B. Chakole, “Reed Solomon Code for WiMAX
Network”, IEEE Transaction on information theory, April 6-8, 2017.
[35] J. Chen and P. Owsley, “A burst error correcting algorithm for Reed Solomon
codes,”, vol. 38, IEEE Transaction on information theory, Nov.1992, pp. 1807-1812.
[37] Masashi Hamamatsu, Tatsuhiro Tsuchiya, Tohru Kikuno, “On the Reliability of
Cascaded TMR Systems”, IEEE Transaction on information theory, pp. 184-190, 28
January 2011.
[38] Umar Afzaal, Jeong A Lee, “A Self-Checking TMR Voter for Increased Reliability
Consensus Voting in FPGAs”, IEEE Transaction on information theory, 09 April 2018.
[39] Banki H., Babamir S., Farokh A., Morovati M., "Enhancing Efficiency of
Software Fault Tolerance Techniques Satellite Motion System", Journal of
Information Systems and Telecommunication, Vol. 2, September 2014.
55 | P a g e
[40] Liming Chen; Avizienis, A. “N-Version Programming: A Fault-Tolerance
Approach to Reliability of Software Operation, Fault-Tolerant Computing.”, 1995, '
Highlights from Twenty-Five Years'., Twenty-Fifth International Symposium on, Vol.,
Iss., 27-30 Jun 1995.
[41] Karla Steinbrugge Chauveau, “Working with C++”, IEEE Trans. Inf. Theory, pp.
192-197, 06 August 2002.
[42] Leendert Ammeraal, “C++ for Programmers”, John Wiley & Sons Ltd., England,
1991.
[43] Naba Barkakati, "Object-Oriented Programming in C++", SAMs, Carmel, IN, 1992.
56 | P a g e