0% found this document useful (0 votes)
7 views

Error Correcting Codes

Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Error Correcting Codes

Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

UNIT – IV 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)

The checker in the decoder creates a 3-bit syndrome (s2s1s0) in which


each bit is the parity check for 4 out of the 7 bits in the received code
word.
S0=b2+b1+b0+ q0 (modulo-2)
S1 =b3 +b2 + q1 (modulo-2)
S2=b1 +b0+q3 (modulo-2)
Characteristics of a
generic (n,k) Hamming code
Systematic & Non-systematic
encoding
 Hamming codes are also classified into two categories that differ in
terms of structure of the encoder output:
● Systematic encoding
● Non-systematic encoding
 In systematic encoding, just by seeing the output of an encoder, we can
separate the data and the redundant bits (also called parity bits).

 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

The equations for the error syndrome is obtained from H Matrix as


follows:

S0= R1+R2+R3+R5
S1=R1+R2+R4+R6
S2= R1+R3+R4+R7

Note: All additions are modulo 2 additions

The received code word is multiplied with the Transpose of H matrix to


obtain the error syndrome.
Constructing (7,4) Hamming code
Decoder circuit
R1 R2 R3 R4 R5 R6 R7

S0

S1

S0= R1+R2+R3+R5 S3
S1=R1+R2+R4+R6
S2= R1+R3+R4+R7
Convolutional Codes

 The rectangular box represents one element of a serial shift register.


 The contents of the shift registers is shifted from left to right.
 The circle with a plus sign inside it represents XOR operation.
 For every binary digit that enters the encoder, two code digits are output.
 Hence code rate = 1/2.
 The constraint length K of a convolutional code is defined as the number of
shifts over which a single message bit can influence the encoder output.
State of Convolutional Encoder

• 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

You might also like