Error Correcting Codes
Error Correcting Codes
Department of ECE
Sathyabama Institute of Science and Technology
Chennai-600119
Information Transmission
Transmission
Encoded Encoded
Message Sent Received Message
100 1000 100 1000
110 0101 110 0101
Hello 110 1100 110 1100 Hell~
110 1100 110 1100
110 1111 110 1110
Information Transmission
Transmission
Encoded Encoded
Message Sent Received Message
100 1000 100 1000
110 0101 110 0101
Hello 110 1100 110 1100 Hell~
110 1100 110 1100
110 1111 110 1110
Error!
Information Transmission
with Parity Bit
Transmission
Encoded Encoded
Message Sent Received Message
0100 1000 0100 1000
0110 0101 0110 0101
Hello 0110 1100 0110 1100 Hell~
0110 1100 0110 1100
0110 1111 0110 1110
Information Transmission
with Parity Bit
Transmission
Encoded Encoded
Message Sent Received Message
0100 1000 0100 1000
0110 0101 0110 0101
Hello 0110 1100 0110 1100 Hell~
0110 1100 0110 1100
0110 1111 0110 1110
Error Detected
Error-Detecting codes
Whenever a message is transmitted, it may get scrambled by
noise or data may get corrupted.
To avoid this, we use error-detecting codes which are
additional data added to a given digital message to help us
detect if an error occurred during transmission of the message.
A simple example of error-detecting code is parity check.
In odd parity check, total no. of ones in transmitted codeword
is always odd.
In even parity check, total no. of ones in transmitted codeword
is always even.
Use of Parity Bit
• The parity bit can be set to 0 and 1 depending on the type of the
parity required.
• For even parity, this bit is set to 1 or 0 such that the no. of "1
bits" in the entire word is even. Shown in fig. (a).
• For odd parity, this bit is set to 1 or 0 such that the no. of "1 bits"
in the entire word is odd. Shown in fig. (b).
Error Correction codes
In the digital world, error correction can be done in two
ways:
•Backward Error Correction: When the receiver detects an
error in the data received, it requests back the sender to
retransmit the data unit (Also automatic repeat request
(ARQ)).
•Forward Error Correction (FEC): When the receiver
detects some error in the data received, it executes error-
correcting code, which helps it to auto-recover and to
correct some kinds of errors.
Hamming Codes
• This error detecting and correcting code technique is
developed by R.W.Hamming .
• This code not only identifies the error bit, in the
whole data sequence and it also corrects it.
• The Hamming codes were originally designed with
dmin = 3, which means that they can detect up to two
errors or correct one single error.
• But there are some Hamming codes that can correct
more than one error.
Hamming Code Example
• First let us find the relationship between n and
k in a Hamming code.
• We need to choose an integer m >= 3. The
values of n and k are then calculated from mas
n = 2m – 1 and k= n-m.
• The number of check bits r=m.
For example, if m=3, then n= 7 and k= 4.
• This is a Hamming code C(7, 4) with dmin =3.
Detection and Correction
Syndrome and Error
A copy of a 4-bit data word is fed into the generator that creates three
parity checks r0, r1 and r2 as shown below:
r0=a2+a1+a0 (modulo-2)
r1 =a3 + a2 + a1 (modulo-2)
r2=a1 +a0+a3 (modulo-2)
In the non-systematic encoding, the redundant bits and data bits are
interspersed.
Constructing (7,4) Hamming code
Encoder
Generated Codeword of 7,4
Hamming Encoder
Constructing (7,4) Hamming code
Decoding
S0= R1+R2+R3+R5
S1=R1+R2+R4+R6
S2= R1+R3+R4+R7
S0
S1
S0= R1+R2+R3+R5 S3
S1=R1+R2+R4+R6
S2= R1+R3+R4+R7
Convolutional Codes
• Notice that there are four states [00] , [01], [10], [11],
corresponding to the (K-1) =2 binary digit tuple.
•We may assume the encoder starts in the all-zero state [00]
State Table of convolutional
Encoder with G0=111 and G1=101
OUTPUT
INPUT DIGIT INTIAL STATE FINAL STATE
CODEWORD
0 00 00 00
1 00 10 11
0 01 00 11
1 01 10 00
0 10 01 10
1 10 11 01
0 11 01 01
1 11 11 10
State diagram of the Encoder