Final
Final
BEAUTY OF ERROR
CORRECTION
MATHS IS BEAUTIFUL
Instructor:
Prof. Manish K. Gupta
Prof.Manoj Raut
Prof. Prosenjit Kundu
Group Members:
5. Error-Detecting Codes
6. Error-Correcting Codes
7. Hamming Codes
BEAUTY OF ERROR CORRECTION
1. Introduction:
Welcome to the fascinating world of error-correcting codes! In an
increasingly interconnected digital landscape, where data trans-
mission and storage play vital roles, the integrity and accuracy
of information become paramount. This is where error-correcting
codes come into play. Error-correcting codes are powerful algo-
rithms designed to detect and correct errors that occur during
data transmission or storage. By employing various mathematical
techniques and encoding schemes, error-correcting codes ensure
reliable and error-free communication, safeguarding data integrity
and enabling seamless information exchange.
In this PDF we are mainly discussing hamming code which is a
very fundamental method for error detecting and error correcting
and also discussing various types of error correcting and detecting
methods.
3.Reed-Solomon Codes: In
the 1960s, Irving S. Reed and
Gustave Solomon independently
developed Reed-Solomon codes.
This type of code is used
in case of a burst error.
Hamming code is not used
when multiple errors occur.
Thus, Reed-Solomon codes were
invented.
Figure 2: Fig 3.3 Reed-Soloman
Even though many error correcting methods are invented, but all
of them are interconnected and have some special ability. For
example, turbo code is an extended version of Reed Solomon that
has a speciality of brilliant error correction capability. After
that shore codes came into the market of error detecting and correcting
codes. There are some more error-correcting methods like BCH (Bose-Chaudhuri-H
and LDPC (Low-Density Parity Check), and many more. But overall
every method’s motive is always to improve and secure data communication
for digital networks.
BEAUTY OF ERROR CORRECTION
4. Types of errors and codes:
4.1 Types of Errors:
=>Single Bit Error: Single-bit errors are the most frequently occurring
errors and our project will mainly focus on these errors.
=>Random Bit Errors: Random bit errors occurs irregularly and in-
dependently throughout the transmitted data stream. These errors can
be caused by noise, interference, or other random disturbances in the
communication channel.
1. Block Codes: Block codes divide the message into fixed-size blocks,
and redundant bits are added to each block to provide error detection and cor-
rection capabilities. Examples of block codes include Hamming codes, Reed-
Solomon codes, and BCH codes.
Below is an example of a Block Code. Encoding is done using parities which we
will discuss later.[3]
>:
1.Hamming Codes: Hamming Codes are generally used to detect the error
which is generated by the flipping of a maximum of two bits. It can correct
one-bit errors and detect two-bit errors.
2.Tree Codes: The major difference between block codes and tree codes
is that tree codes don’t take the block of code as an input for error correction
and detection but take the data stream as the input. So, it is a very practical
method for wireless communication systems or satellite transmission. This type
of code is also known as Convolutional code.[1]
There are many more error-correcting codes than these and we can also
create our error-creating methods but "It should be optimal and more
generalise so that all machines can apply that thing".
BEAUTY OF ERROR CORRECTION
5. ERROR-DETECTING CODES:
5.2 CRCS:
CRC stands for Cyclic Redundancy Check and is frequently used in
communication systems such as Ethernet. A checksum is generated
using a polynomial division technique and attached to the data in CRC.
Using the incoming data and the generating polynomial, the receiving
end does the same polynomial division. An error is discovered if the
remainder is non-zero.
BEAUTY OF ERROR CORRECTION
>In the term polynomial, we mean
that the power of that term is the
position of the bit that string has.
>Here we will choose a generator
polynomial of any of your choice(not
degree 0 )
>Then we will multiply that with our
message polynomial and that message
will be sent to the receiver side.
>There decoder will have that
same(obviously) generator polynomial
and then the decoder will divide the
received polynomial by the generator
polynomial.
>After that it will check the
remainder. If the remainder is
not zero, then an error must have
occurred.
[5]
6. ERROR CORRECTING-CODES:
-> Hamming codes are useful in single or double-bit errors only. They
correct only one-bit errors and detect up to two-bit errors. It uses basic
parities to do the same. It includes encoding and decoding, two main
functions to secure or correct the data.[2]
2k >= n+k+1
By that formula, we can calculate the number of parity bits required for a fixed
number of bits. For example, for a (7,4) code we need 3 parity bits and for a
(11,7) code we need 4 parity bits. These numbers can be verified by the above
formula.
Step-1:
In the above formula of n and k, we can calculate how many parity bits you have
to choose by r = n-k. For example (7,4) there are three parity bits. So, if you
have 4 bits of information code then you have to attach 3 more bits (parity bit)
at a particular place so it can correct the error.
Step-2:-
In this section we arrange the parity bit at some decided place such that at the
time of the decoding process, we do some mathematical operations and find
error bits. Hamming did all arrangements and then he concluded by saying that
all parity bits will be placed at the power of two, like 1,2,4,8.....and more. For
example
Just like shown in the image, we have to start calculating the position of any
message from the end. and parity will always be placed at position like 1,2,4,8,16.
Step-3:
Now, we decide the value of parity according to parity types. We have two types
of parity: 1) Even parity and 2)Odd parity. First, you have to count the number
of 1s in the binary code and then you can apply any of the two, odd parity or
even parity. In even parity, if the number of 1s is odd, the parity bit is 1, and
if the number of 1s if even, the parity bit is 0. The odd parity method works
vice-versa. We generally use the even parity method in hamming code.
Now, to decide which information bit to use for a particular parity bit, we follow
BEAUTY OF ERROR CORRECTION
a simple rule. Each parity bit covers all bit positions whose binary representation
includes a 1 in the ith position except the position of ri .
For example, for a (7,4) code the parity bits are calculated like::
The above image explains to you about each and every EXOR operation
that happened for each parity.
After that we can say that the final encoded message is :
Thus, from this we can say that "110" is the place where the error has occurred.
Therefore, the actual code is "1101111" which was encoded by the machine.
That’s how data decoding works and it is very useful for the detection and
correction of single-bit error.
BEAUTY OF ERROR CORRECTION
2. Hamming code with the help of table(matrix) ::
This method is only a 2-D version of linear hamming code. Its basic function
is similar to the linear codes. Follow the below pictures carefully and you will
understand the process:
Binary: 11110111110
In this type of code we have to calculate parity first. So, we are
arranging the information bits in a 4x4 matrix in such a way that
they do not occupy the positions for parity bits( power of two).
After arranging ::
In this matrix we have two choices for choosing the value of parity. You have to
decide whether you want odd parity or even parity. For now, we are working on
even parity. In that, we have to count 1 in the block of bits and choose parity
BEAUTY OF ERROR CORRECTION
accordingly. For example, the number of 1s is odd so parity is 1. Thus p1 became
1.
In the above image we can see that there is a shaded blue part. Those are parity
spots and we have to decide the value for them. So you have to go two columns
and two rows at a time for deciding parity. We compute four local parities and
one global parity.
STEP 1 - second and fourth columns
->Here, we are selecting parity value 1 as we are following the even parity method.
BEAUTY OF ERROR CORRECTION
STEP 2 - third and fourth columns
-Now, the parity value is 0 from the 3rd and 4th column, following the even parity
method..
BEAUTY OF ERROR CORRECTION
STEP 3 - second and fourth row
->Now, the parity value is 0 from the 2nd and 4th row.
BEAUTY OF ERROR CORRECTION
STEP 4 - third and fourth row
->Now, the parity value is 1 from the 3rd and 4th row.
BEAUTY OF ERROR CORRECTION
STEP 5 - Global parity
->For finding the global parity, find the parity bit according to all the remaining
15 bits. In this example, we are considering the global parity bit as 1 following
the even parity method.
BEAUTY OF ERROR CORRECTION
This binary table is encoded successfully and it is transmitted. Now
suppose, that there is one error due to noise and cosmic-ray in commu-
nication technology as marked red in the figure::
Hamming codes can also find the error. It follows the below mentioned
techniques:
1-) Logical-Methods::
In this method, we go column by column and row by row. So, you
check the second and fourth columns. Does it have an odd parity? In
our example "NO" then C0 =0;
After that you check the third and fourth columns. Does it have odd
parity? In our example "YES". Thus, C1 =1.
Similarly, you check the second and fourth rows. Do they have odd
parity? In our example "NO"; so, C2 =0
BEAUTY OF ERROR CORRECTION
Finally, check the third and fourth rows. Does it have odd parity? In
our example "YES", thus C3 =1.
Now arrange C0 ,C1 ,C2 and C3 as [C3C2C1C0]. In our example, we can
say that it is [1010] which means that the 10th box i.e. (3,3) element in
the matrix has an error. You can correct the error and get your original
message.
If you have a two-bit error, in that case, you will find that for our
example, the total number of 1s remains the same. So you might think
there is no error. But in that case, you also have to check for columns
by column and row by row. You will find that there is no match with
even the parity of that row or column. In that case, you can say that it
has a two-bit error. Let’s take one example in which you have to find
the number of errors::
-> In the above image you see that the total no of 1s is even, so you
think it has no error But if you look at the second and fourth columns,
third and fourth columns, second and fourth row and third and fourth
row, you will find that number of 1s is odd. This is contrary to the fact
BEAUTY OF ERROR CORRECTION
that there are even numbers of 1s in total. This indicates that there is
a Two-bit error.
->Drawback of this theorem is that you can’t find the second-bit error
location. You can only find one-bit error location.
->Due to this drawback of Hamming Code, Reed Solomon was invented
which can correct multiple errors.
BEAUTY OF ERROR CORRECTION
References
[1] Gil Cohen, Bernhard Haeupler, and Leonard J Schulman. Explicit binary tree
codes with polylogarithmic size alphabet. In Proceedings of the 50th Annual
ACM SIGACT Symposium on Theory of Computing, pages 535–544, 2018.
[3] Douglas J Muder. Minimal trellises for block codes. IEEE Transactions on
Information Theory, 34(5):1049–1053, 1988.
[4] IS Reed. A brief history of the development of error correcting codes. Com-
puters & Mathematics with Applications, 39(11):89–93, 2000.
[5] Jacobus Hendricus Van Lint. Introduction to coding theory, volume 86.
Springer Science & Business Media, 1998.