Error Detection
Data can be corrupted during transmission.
Some applications require that errors bedetected and corrected.
An error-detecting code can detectonly the types of errors for which it is designed;other types of errors may remain undetected.
Types of ErrorsRedundancyDetection Versus CorrectionForward Error Correction Versus RetransmissionCoding
Topics discussed in this section:Topics discussed in this section:
Single-bit error
In a single-bit error, only 1 bit in the dataunit has changed.
Burst error of length 8
A burst error means that 2 or more bitsin the data unit have changed.
Error Detection
Two main methods of Error Correction
Forward Error Correction (FEC) – adding redundancy bits
Retransmission – resending of data
FEC is used when the potential error is small.
Redundancy in FEC is achieved by means of Coding,means adding control bits to data.
Block codes and Convolutional Codes. Only simpleBlock code will be discussed
The ability to detect an error and the ability to correctan error is two different thing.
Determined by the min Hamming Distance, dmin
To detect or correct errors, we need tosend extra (redundant) bits with data.
Using  XOR logic of two single bits or two words
BLOCK CODINGBLOCK CODING
In block coding, we divide our message into blocks,each of bits, called datawordsWe add redundantbits to each block to make the length r. Theresulting n-bit blocks are called codewords.In block coding, we divide our message into blocks,each of bits, called datawordsWe add redundantbits to each block to make the length r. Theresulting n-bit blocks are called codewords.
Error DetectionError CorrectionHamming Distance
Minimum Hamming Distance
Topics discussed in this section:Topics discussed in this section:
Figure 10.5  Datawords and codewords in block coding
Process of error detection in block coding
A code for error detection; k =2, n=3
A code for error correction; k=2, n=5
The Hamming distance between twowords is the number of differencesbetween corresponding bits.
Find the Hamming distance between two pairs of words.
1. The Hamming distance d(000, 011) is 2 because
2. The Hamming distance d(10101, 11110) is because
The minimum Hamming distance dmin
is the smallest Hamming distance
between all possible pairs in a set of codewords.
dmin = 2
dmin = 3
To guarantee the detection of up to
errors in all cases, the minimum
Hamming distance in a blockcode must be dmin = s + 1.
s is the number of detectable error
If dmin = 2, then s = 1
If dmin = 3, then s = 2
Detectable Error (s)
To guarantee correction of up to t errorsin all cases, the minimum Hammingdistance in a block code must be
dmin = 2t + 1.
t is the number of correctable error
Correctable Error (t)
If dmin = 2, then s = 1, but t = ½ ~ 0
means able to detect upto 1 error but cannot correct any
If dmin = 3, then s = 2, but t = 1
means able to detect upto 2 errors but can only correct 1
Another example of block code using Simple parity-check code C(5, 4)
A simple parity-check code can detectan odd number of errors.
Encoder and decoder for simple parity-check code
An example of block code using Hamming code C(7, 4)
The structure of the encoder and decoder for a Hamming code
10-4   CYCLIC CODES10-4   CYCLIC CODES
Cyclic codes are special linear block codes with oneextra property. In cyclic code, if codeword iscyclically shifted (rotated), the result is anothercodeword.Cyclic codes are special linear block codes with oneextra property. In cyclic code, if codeword iscyclically shifted (rotated), the result is anothercodeword.
Cyclic Redundancy CheckHardware ImplementationPolynomialsCyclic Code Analysis
Advantages of Cyclic CodesOther Cyclic Codes
Topics discussed in this section:Topics discussed in this section:
Table 10.6  A CRC code with C(7, 4)
Divisor determine the outcome of the codeword,which is pre-agreed between sender and receiver
CRC encoder and decoder
Division in CRC encoder
Figure 10.16  Division in the CRC decoder for two cases
Figure 10.19  The CRC encoder design using shift registers
Divisor = 1011
Simulation and implementation CRC encoder using shift register
General design of encoder and decoder of a CRC code
Figure 10.21   A polynomial to represent a binary word
Figure 10.22  CRC division using polynomials
Divisor = 1011
Augmented
Dataword    = 1001000
CRC Codeword
= 1001110