SlideShare a Scribd company logo
1 of 104
Error
Detection and
Correction
Presented by:
Jeoffna Ruth C. Dasigo and Jobert Rae H. CasiΓ±o
Error
Detection and
Correction
Error
Detection and
Correction
Error
Detection and
Correction
Error
Detection and
Correction
Error
Detection and
Correction
Error
Detection and
Correction
Data can be corrupted during
transmission. Some applications
require that errors be detected and
corrected.
Single-bit Error
Types of Error
In a single-bit error, only 1 bit in the data unit has changed.
0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0
0 changed to 1
Sent Received
Burst Error
Types of Error
A burst error means that 2 or more bits in the data unit have
changed.
0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
0 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1
Sent
Received
Length of burst error (8 bits)
Corrupted bits
The central concept
in detecting or
correcting errors.
Redundancy
To be able to detect or
correct errors, we need
to send some extra bits
with our data.
Redundant bits are added
by the sender and removed
by the receiver.
Detection vs.Correction
DETECTION
CORRECTION
In error correction, we
need to know the exact
number of bits that are
corrupted and more
importantly, their location
in the message. The
number of the errors and
the size of the message are
important factors.
In error detection, we are
looking only to see if any
error has occurred. The
answer is a simple yes or
no. We are not even
interested in the number of
errors. A single-bit error is
the same for us as a burst
error.
ForwardErrorCorrection
Forward error correction is the process in which
the receiver tries to guess the message by using
redundant bits.
Retransmission
Correction by retransmission is a technique in
which the receiver detects the occurrence of an
error and asks the sender to resend the message.
Methods of Error Correction
In modular arithmetic, we use only a limited range of
integers. We define an upper limit, called a modulus
N. We then use only the integers 0 to N - I, inclusive.
This is modulo-N arithmetic.
Modular Arithmetic
Modulus: 12
Integers to be used: 0 to 11
Example:
In this arithmetic, the modulus N is 2. We can use only 0 and 1.
Modulo-2 Arithmetic
Adding 0+0=0 0+1=1 1+0=1 1+1=0
Subtracting 0-0=0 0-1=1 1-0=1 1-1=0
Note:
In this arithmetic we use the XOR (exclusive OR) operation for both
addition and subtraction.
Block Coding
CODING
Convolution
Coding
complexsimple
BlockCoding
In block coding, we divide our message into blocks,
each of k bits, called datawords. We add r redundant bits
to each block to make the length n = k + r. The resulting
n-bit blocks are called codewords.
Coding Scheme
Example:
For 4B/5B block coding, k=4 and n=5.
Datawords: 2 π‘˜
= 16
Codewords: 2 𝑛
= 32
Error Detection
1
The receiver has (or can find) a list of valid codewords.
The original codeword has changed to an invalid one.
Code for Error Detection
1
Datawords Codewords
00 000
01 011
10 101
11 110
The sender encodes the dataword 01 as 011 and sends it to the receiver.
 The receiver receives 011 – valid codeword, no error detected.
 The receiver receives 111 – invalid codeword, error detected.
 The receiver receives 000 – valid codeword, error undetected.
1
An error-detecting code can detect only
the types of errors for which it is
designed; other types of errors may
remain undetected.
1
ErrorCorrection
In error detection, the receiver needs to know
only that the received codeword is invalid; in
error correction the receiver needs to find (or
guess) the original codeword sent.
1
Assume the dataword is 01. The sender consults the table (or uses an
algorithm) to create the codeword 01011. The codeword is corrupted
during transmission, and 01001 is received (error in the second bit
from the right).
Dataword Codeword
00 00000
01 01011
10 10101
11 11110
Code for Error Correction
Hamming Distance
The Hamming distance between two words is the
number of differences between corresponding bits.
Examples:
1. The Hamming distance d(OOO, 011) is 2
2. The Hamming distance d(10101, 11110) is 3
000 Ꚛ 011 is 011 (two 1s)
10101 Ꚛ 11110 is 01011 (three 1s)
Minimum Hamming Distance
The minimum Hamming distance is the
smallest Hamming distance between all
possible pairs in a set of words.
used for designing a code
Three
1. Codeword size, n
2. Dataword size, k
3. Minimum Hamming distance, 𝒅 π’Žπ’Šπ’
Examples:
C(3, 2) with dmin =2
C(5, 2) with dmin = 3
Parameters
HammingDistanceandError
The Hamming distance between the
received codeword and the sent codeword
is the number of bits that are corrupted
during transmission.
MinimumDistancefor
ErrorDetection
If s errors occur during transmission, the Hamming
distance between the sent codeword and received
codeword is s. If our code is to detect up to s errors,
the minimum distance between the valid codes must
be s + 1, so that the received codeword does not
match a valid codeword.
Geometric concept for finding 𝑑 π‘šπ‘–π‘›in error detection
𝑑 π‘šπ‘–π‘› = s + 1
MinimumDistanceforError
Correction
Suppose a codeword x is corrupted by t bits or less.
Then this corrupted codeword is located either
inside or on the perimeter of the circle. If the
receiver receives a codeword that belongs to this
territory, it decides that the original codeword is the
one at the center.
Geometric concept for finding 𝑑 π‘šπ‘–π‘› in error correction
𝑑 π‘šπ‘–π‘› = 2𝑑 + 1
Linear Block Codes
In a linear block code, the exclusive OR
(XOR) of any two valid codewords creates another
valid codeword.
Datawords Codewords
00 000
01 011
10 101
11 110
Ꚛ
Minimum Distance for Linear
Block Codes
The minimum Hamming distance is the
number of Is in the nonzero valid codeword with
the smallest number of 1’s.
Datawords Codewords
00 000
01 011
10 101
11 110
𝑑 π‘šπ‘–π‘› = 2
Simple Parity-Check Code
Received
Codeword
Syndrome Created Dataword
10111 0 1011
10011 1 -
10110 1 -
00110 0 0011
01011 1 -
Dataword sent: 1011
HammingCodes
β€’ These codes were originally designed with 𝑑 π‘šπ‘–π‘› = 3, which means
that they can detect up to two errors or correct one single error.
Important Parameters:
m >= 3
n = 2 π‘š βˆ’ 1
k = n-m
Example:
If m = 3, then n = 7 and k = 4
This is a Hamming code C(7,4) with 𝑑 π‘šπ‘–π‘› = 3
Examples:
1. The dataword 0100 becomes the codeword 0100011. The codeword 0100011 is
received. The syndrome is 000 (no error), the final dataword is 0100.
2. The dataword 0111 becomes the codeword 0111001. The codeword 0011001 is
received. The syndrome is 011. According to Table 10.5, b2 is in error. After flipping b2
(changing the 1 to 0), the final dataword is 0111.
3. The dataword 1101 becomes the codeword 1101000. The codeword 0001000 is
received (two errors). The syndrome is 101, which means that bo is in error. After
flipping bo,we get 0000, the wrong dataword. This shows that our code cannot
correct two errors.
Example:
We need a dataword of at least 7 bits. Calculate values of k and n that
satisfy this requirement.
Solution:
We need to make k = n - m greater than or equal to 7, or 21𝑛 - 1 - m ~ 7.
1. If we set m = 3, the result is n = 23 - 1 and k =7 - 3, or 4, which is not acceptable.
2. If we set m = 4, then n = 24
– 1 = 15 and k = 15 - 4 = 11, which satisfies the
condition. So the code is C(l5, 11). There are methods to make the dataword a
specific size, but the discussion and implementation are beyond the scope of this
book.
Cyclic Codes
Cyclic codes are special linear block codes with one extra
property. In a cyclic code, if a codeword is cyclically shifted
(rotated), the result is another codeword.
Example:
1011000 when cyclically shifted becomes 0110001
Cyclic Redundancy Check
Ꚛ
Cyclic Redundancy Check
Cyclic Redundancy Check
Encoder
1 0 0 1 0 0 0
1
1 0 1 1
1 0 1 1
0 1 0 0
0 0 0 0
1 0 0 0
1 0 1 1
0 1 1 0
0 0 0 0
1 1 0
Quotient
Divisor
Dividend:
augmented
dataword
Leftmost bit 0:
use 0000 divisor
Leftmost bit 0:
use 0000 divisor
Remainder
0 1 0
Cyclic Redundancy Check
Decoder
1 0 0 0 1 1 0
1
1 0 1 1 Codeword
0 1 0
1 0 1 1
0 1 1 1
0 0 0 0
1 1 1 1
1 0 1 1
1 0 0 0
1 0 1 1
0 1 1 SyndromeDataword: Discarded
Hardware
Implementation
Divisor
Divisor
1. The divisor is repeatedly XORed with part of the dividend.
2. The divisor has n - k + 1 bits which either are predefined or are all
0’s.
3. Only n - k bits of the divisor is needed in the XOR operation.
Leftmost bit of the dividend Divisor bits (𝑑2 𝑑1 𝑑0)
0 000
1 011
Hardware
Implementation
Divisor
Augmented
dataword
Hardware
Implementation
Divisor
Augmented
dataword Remainder
Remainder
(n - k bits in general) in length
Hardware
Implementation
Divisor
Augmented
dataword Remainder
General
Design
General Design
n - k I-bit shift
registers in both
the encoder and
decoder
Polynomials
A better way to understand cyclic codes and how they can be analyzed is to represent them as
polynomials.
Polynomials
AddingandSubtracting
Polynomials
Degreeof
Polynomials
MultiplyingorDividing
Terms
The degree of a
polynomial is the highest
power in the polynomial.
It is 1 less than the
number of bits
First, addition and
subtraction are the same.
Second, adding or
subtracting is done by
combining terms and
deleting pairs of identical
terms.
Multiplying a term by another
term is very simple; we just add
the powers.
For dividing, we just subtract the
power of the second term from
the power of the first.
π‘₯6
+ π‘₯ + 1
has 7 bits
π‘₯6 + π‘₯4 + π‘₯2
π‘₯5
+ π‘₯4
+ π‘₯2
π‘₯6+π‘₯5
π‘₯3
+ π‘₯4
= π‘₯7
π‘₯5
π‘₯2 = π‘₯3
Multiplication
Division
Polynomials
MultiplyingTwoPolynomials
DividingOnePolynomialbyAnother
Multiplying a polynomial by another is done term by term. Each term of the first polynomial must be
multiplied by all terms of the second.
Division of polynomials is conceptually the same as the binary division.
Shifting
A binary pattern is often shifted a number of bits to the right or left. Shifting to the left means adding
extra 0’s as rightmost bits; shifting to the right means deleting some rightmost bits.
Polynomials
CyclicCodeEncoderUsingPolynomials
Division of polynomials is conceptually the same as the binary division.
Polynomials
CyclicCodeAnalysis
We can analyze a cyclic code to find its capabilities by using polynomials. We define the
following, where f(x) is a polynomial with binary coefficients.
Dataword: d(x) Syndrome: s(x) Codeword: c(x)
Error: e(x) Generator: g(x)
In a cyclic code,
1. If s(x) β‰  0, one or more bits is corrupted.
2. If s(x) = 0, either a. No bit is corrupted. or b. Some bits are corrupted, but
the decoder failed to detect them.
Received codeword = c (x) + e(x)
𝑅𝑒𝑐𝑒𝑖𝑣𝑒𝑑 π‘π‘œπ‘‘π‘’π‘€π‘œπ‘Ÿπ‘‘
𝑔(π‘₯)
=
𝑐(π‘₯)
𝑔(π‘₯)
+
𝑒(π‘₯)
𝑔(π‘₯)
In a cyclic code, those e(x) errors that are divisible by g(x) are not caught.
Single-Bit Error
A single-bit error is e(x) =xi, where i is the position
of the bit. If a single-bit error is caught, then xi is not divisible
by g(x). If g(x) ha~ at least two terms (which is normally the
case) and the coefficient of π‘₯0
is not zero (the rightmost bit is
1), then e(x) cannot be divided by g(x).
If the generator has more than one term and the coefficient of π‘₯0
is 1, all
single errors can be caught.
Single-BitError
Example
Which of the following g(x) values guarantees that a single-bit error is caught? For
each case, what is the error that cannot be caught?
a. x + 1
b. b. x3
c. c. 1
Solution
a. No xi can be divisible by x + 1. In other words, xi/ex + 1) always has a remainder. So the
syndrome is nonzero. Any single-bit error can be caught.
b. b. If i is equal to or greater than 3, xi is divisible by g(x). The remainder of xi/x3 is zero, and
the receiver is fooled into believing that there is no error, although there might be one.
Note that in this case, the corrupted bit must be in position 4 or above. All single-bit errors
in positions I to 3 are caught.
c. c. All values of i make j divisible by g(x). No single-bit error can be caught. In addition, this
g(x) is useless because it means the codeword is just the dataword augmented with n- k
zeros.
Two Isolated Single-Bit Errors
A single-bit error is e(x) =xi, where i is the position
of the bit. If a single-bit error is caught, then xi is not divisible
by g(x). If g(x) ha~ at least two terms (which is normally the
case) and the coefficient of π‘₯0
is not zero (the rightmost bit is
1), then e(x) cannot be divided by g(x).
If a generator cannot divide π‘₯ 𝑑
+ 1 (t between 0 and n - 1), then all isolated
double errors can be detected.
Example
Find the status of the following generators related to two isolated, single-bit errors.
a. x+ 1
b. π‘₯4
+ 1
c. π‘₯7
+ π‘₯6
+ 1
d. π‘₯ 𝐼𝑠
+ π‘₯ 𝐼4
+1
Solution
a. This is a very poor choice for a generator. Any two errors next to each other cannot be
detected.
b. This generator cannot detect two errors that are four positions apart. The two errors can be
anywhere, but if their distance is 4, they remain undetected.
c. This is a good choice for this purpose. d. This polynomial cannot divide any error of 𝑑𝑦𝑝𝑒π‘₯ 𝑑
+ 1
if t is less than 32,768. This means that a code word with two isolated errors that are next to
each other or up to 32,768 bits apart can be detected by this generator.
TwoIsolatedSingle-BitErrors
Odd Numbers of Errors
A generator with a factor of x + 1 can catch all odd
numbers of errors. This means that we need to make x + 1 a
factor of any generator. If it is only x + 1, it cannot catch the
two adjacent isolated errors.
A generator that contains a factor of x + 1 can detect all odd-numbered
errors.
Example
x4 + x2 + X + 1 can catch all odd-numbered errors since it can be
written as a product of the two polynomials x + 1 and x3 + x2 + 1.
Burst Errors
The most important of all. A burst error is of the form
e(x) =π‘₯ 𝐽
+ ... + xi). Note the difference between a burst error and
two isolated single-bit errors. The first can have two terms or more;
the second can only have two terms. We can factor out xi and write
the error as xi(π‘₯ π½βˆ’π‘–
+ ... + 1). If our generator can detect a single
error (minimum condition for a generator), then it cannot divide xi.
What we should worry about are those generators that divide π‘₯ π½βˆ’π‘–
+ ... + 1. In other words, the remainder of (π‘₯ π½βˆ’π‘–
+ ...+ 1)/(π‘₯ π‘Ÿ
+ ... + 1)
must not be zero.
 All burst errors with L ≀ r will be detected.
 All burst errors with L =r + 1 will be detected with probability 1 - (112/ βˆ’1
β€’
 All burst errors with L > r + 1 will be detected with probability 1-(1/2[.
Criteria for a good Polynomial Generator
1. It should have at least two terms.
2. The coefficient of the term xO should be 1.
3. It should not divide Xl + 1, for t between 2 and n - 1.
4. It should have the factor x + 1.
Standard Polynomials
Advantages of Cyclic Codes
They can easily be implemented in hardware and software.
They are especially fast when implemented in hardware.
CHECKSUM
The checksum is used in the Internet by
several protocols although not at the data link layer. Like
linear and cyclic codes, the checksum is based on the
concept of redundancy. Several protocols still use the
checksum for error detection as we will see in future
chapters, although the tendency is to replace it with a
CRe. This means that the CRC is also used in layers other
than the data link layer.
CHECKSUM
Example
Suppose our data is a list of five 4-bit numbers
that we want to send to a destination. In addition to
sending these numbers, we send the sum of the
numbers. For example, if the set of numbers is (7, 11, 12,
0, 6), we send (7, 11, 12,0,6,36), where 36 is the sum of
the original numbers. The receiver adds the five numbers
and compares the result with the sum. If the two are the
same, the receiver assumes no error, accepts the five
numbers, and discards the sum. Otherwise, there is an
error somewhere and the data are not accepted.
CHECKSUM
One’s Complement
The previous example has one major drawback.
All of our data can be written as a 4-bit word (they are
less than 15) except for the checksum. One solution is to
use one's complement arithmetic. In this arithmetic, we
can represent unsigned numbers between 0 and 2 𝑛 - 1
using only n bits t. If the number has more than n bits,
the extra leftmost bits need to be added to the n
rightmost bits (wrapping). In one's complement
arithmetic, a negative number can be represented by
inverting all bits (changing a 0 to a 1 and a 1 to a 0). This
is the same as subtracting the number from 2 𝑛 - 1.
CHECKSUM
One’s Complement
Example
How can we represent the number 21 in one's
complement arithmetic using only four bits?
Solution
The number 21 in binary is 10101 (it needs five
bits). We can wrap the leftmost bit and add it to the four
rightmost bits. We have (0101 + 1) = 0110 or 6.
CHECKSUM
One’s Complement
Example
How can we represent the number-6 in one's
complement arithmetic using only four bits?
Solution
In one's complement arithmetic, the negative
or complement of a number is found by inverting all bits.
Positive 6 is 0110; negative 6 is 100I. If we consider only
unsigned numbers, this is 9. In other words, the
complement of6 is 9. Another way to find the
complement of a number in one's complement
arithmetic is to subtract the number from 2 𝑛
- 1 (16 - 1
in this case).
CHECKSUM
Internet Checksum
Traditionally, the Internet has been using a 16-bit checksum.
The sender calculates the checksum by following these steps.
Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to O.
3. All words including the checksum are added using one's
complement addition.
4. The sum is complemented and becomes the checksum.
5. The checksum is sent with the data.
CHECKSUM
Internet Checksum
The receiver uses the following steps for error detection.
Receiver site:
1. The message (including checksum) is divided into 16-bit
words.
2. All words are added using one's complement addition.
3. The sum is complemented and becomes the new
checksum.
4. If the value of checksum is 0, the message is accepted;
otherwise, itis rejected.
CHECKSUM
Internet Checksum
Example
Let us calculate the checksum for a text of 8
characters ("Forouzan"). The text needs to be divided into 2-
byte (16-bit) words. We use ASCII to change each byte to a 2-
digit hexadecimal number. For example, F is represented as
Ox46 and 0 is represented as Ox6F. Figure 10.25 shows how
the checksum is calculated at the sender and receiver sites. In
part a of the figure, the value of partial sum for the first
column is Ox36. We keep the rightmost digit (6) and insert the
leftmost digit (3) as the carry in the second column. The
process is repeated for each column.
CHECKSUM
QUIZ # 8
Chapter 10 - Error Detection and Correction
1. Checksums use _________ arithmetic.
A)one's complement arithmetic
B)two's complement arithmetic
C)either a or b
D)none of the above
Quiz # 8 Error Detection and Correction
2. In modulo-11 arithmetic, we use only the integers in
the range ______, inclusive.
A) 1 to 10
B) 0 to 10
C) 1 to 11
D) none of the above
Quiz # 8 Error Detection and Correction
3. The ________ between two words is the number of
differences between corresponding bits.
A) Hamming rule
B) Hamming code
C) Hamming distance
D) none of the above
Quiz # 8 Error Detection and Correction
4. The _______ of a polynomial is the highest
in the polynomial.
A) range
B) power
C) degree
D) base
Quiz # 8 Error Detection and Correction
5. A _____ error means that two or more bits
in the data unit have changed.
A) burst
B) double-bit
C) single-bit
D) none of the above
Quiz # 8 Error Detection and Correction
6. In modulo-2 arithmetic, we use only ______.
A) 1 and 2
B) 0 and 1
C) 0 and 2
D) 1 and 3
Quiz # 8 Error Detection and Correction
7. In a linear block code, the _______ of any two valid
codewords creates another valid codeword.
A) ANDing
B) XORing
C) ORing
D) none of the above
Quiz # 8 Error Detection and Correction
8-9. Give two types of Error
Quiz # 8 Error Detection and Correction
10. In block coding, if k = 2 and n = 3, we have
_______ invalid codewords.
A) 4
B) 8
C) 2
D) 5
Quiz # 8 Error Detection and Correction
11-12. We can divide coding schemes into two
broad categories: ________ and ________.
Quiz # 8 Error Detection and Correction
13. We add r redundant bits to each block to make the
length n = k + r. The resulting n-bit blocks are called
_________.
A) codewords
B) datawords
C) blockwords
D) syndrome
Quiz # 8 Error Detection and Correction
14. Which error detection method uses one's
complement arithmetic?
A) Checksum
B) CRC
C) Simple parity check
D) Two-dimensional parity check
Quiz # 8 Error Detection and Correction
15. In modulo-2 arithmetic, we use the ______
operation for both addition and subtraction.
A) OR
B) XOR
C) AND
D) none of the above
Quiz # 8 Error Detection and Correction
16. To guarantee the detection of up to 5 errors in all
cases, the minimum Hamming distance in a block code
must be _______.
A) 11
B) 5
C) 6
D) 7
Quiz # 8 Error Detection and Correction
17. A generator that contains a factor of ____ can detect
all odd-numbered errors.
A) x
B) 1
C) x + 1
D) x + 2
Quiz # 8 Error Detection and Correction
18. A simple parity-check code can detect __________
errors.
A) an odd-number of
B) an even-number of
C) two
D) no errors
Quiz # 8 Error Detection and Correction
19. The correction of errors is more difficult than
the detection.
True or False ?
Quiz # 8 Error Detection and Correction
20. The additional bits called parity bits allow correction or
detection of errors.
True or False ?
Quiz # 8 Error Detection and Correction
Quiz # 8 Error Detection and Correction
ANSWERS
1. Checksums use _________ arithmetic.
A)one's complement arithmetic
B)two's complement arithmetic
C)either a or b
D)none of the above
Quiz # 8 Error Detection and Correction
2. In modulo-11 arithmetic, we use only the integers in
the range ______, inclusive.
A) 1 to 10
B) 0 to 10
C) 1 to 11
D) none of the above
Quiz # 8 Error Detection and Correction
3. The ________ between two words is the number of
differences between corresponding bits.
A) Hamming rule
B) Hamming code
C) Hamming distance
D) none of the above
Quiz # 8 Error Detection and Correction
4. The _______ of a polynomial is the highest
in the polynomial.
A) range
B) power
C) degree
D) base
Quiz # 8 Error Detection and Correction
5. A _____ error means that two or more bits
in the data unit have changed.
A) burst
B) double-bit
C) single-bit
D) none of the above
Quiz # 8 Error Detection and Correction
6. In modulo-2 arithmetic, we use only ______.
A) 1 and 2
B) 0 and 1
C) 0 and 2
D) 1 and 3
Quiz # 8 Error Detection and Correction
7. In a linear block code, the _______ of any two valid
codewords creates another valid codeword.
A) ANDing
B) XORing
C) ORing
D) none of the above
Quiz # 8 Error Detection and Correction
8-9. Give two types of Error
Quiz # 8 Error Detection and Correction
Single-bit Error and Burst Error
10. In block coding, if k = 2 and n = 3, we have
_______ invalid codewords.
A) 4
B) 8
C) 2
D) 5
Quiz # 8 Error Detection and Correction
11-12. We can divide coding schemes into two
broad categories: ________ and ________.
Quiz # 8 Error Detection and Correction
Block Coding; Convolution Coding
13. We add r redundant bits to each block to make the
length n = k + r. The resulting n-bit blocks are called
_________.
A) codewords
B) datawords
C) blockwords
D) syndrome
Quiz # 8 Error Detection and Correction
14. Which error detection method uses one's
complement arithmetic?
A) Checksum
B) CRC
C) Simple parity check
D) Two-dimensional parity check
Quiz # 8 Error Detection and Correction
15. In modulo-2 arithmetic, we use the ______
operation for both addition and subtraction.
A) OR
B) XOR
C) AND
D) none of the above
Quiz # 8 Error Detection and Correction
16. To guarantee the detection of up to 5 errors in all
cases, the minimum Hamming distance in a block code
must be _______.
A) 11
B) 5
C) 6
D) 7
Quiz # 8 Error Detection and Correction
17. A generator that contains a factor of ____ can detect
all odd-numbered errors.
A) x
B) 1
C) x + 1
D) x + 2
Quiz # 8 Error Detection and Correction
18. A simple parity-check code can detect __________
errors.
A) an odd-number of
B) an even-number of
C) two
D) no errors
Quiz # 8 Error Detection and Correction
19. The correction of errors is more difficult than
the detection.
True
Quiz # 8 Error Detection and Correction
20. The additional bits called parity bits allow correction or
detection of errors.
True
Quiz # 8 Error Detection and Correction

More Related Content

What's hot

Error Detection and Correction presentation
Error Detection and Correction presentation Error Detection and Correction presentation
Error Detection and Correction presentation Badrul Alam
Β 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common SubsequenceKrishma Parekh
Β 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptxAminaZahid16
Β 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplicationRespa Peter
Β 
Chapter 10
Chapter 10Chapter 10
Chapter 10bheemsain
Β 
CRC implementation
CRC implementation CRC implementation
CRC implementation ajay singh
Β 
Binary Search
Binary SearchBinary Search
Binary Searchkunj desai
Β 
Ripple counter
Ripple counterRipple counter
Ripple counterchandkec
Β 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correctionSiddique Ibrahim
Β 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptxJEEVANANTHAMG6
Β 
Error Correction And Hamming Code Ibrar
Error Correction And Hamming Code IbrarError Correction And Hamming Code Ibrar
Error Correction And Hamming Code Ibraribrar562
Β 
Binary addition.pptx
Binary addition.pptxBinary addition.pptx
Binary addition.pptxPooja Dixit
Β 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebrablaircomp2003
Β 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentationSnehalataAgasti
Β 
Chapter 02 instructions language of the computer
Chapter 02   instructions language of the computerChapter 02   instructions language of the computer
Chapter 02 instructions language of the computerBαΊ£o Hoang
Β 
Error detection correction (CRC)
Error detection correction  (CRC)Error detection correction  (CRC)
Error detection correction (CRC)Karam Munir Butt
Β 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codesRevathi Subramaniam
Β 

What's hot (20)

Error Detection and Correction presentation
Error Detection and Correction presentation Error Detection and Correction presentation
Error Detection and Correction presentation
Β 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common Subsequence
Β 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
Β 
Sorting
SortingSorting
Sorting
Β 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
Β 
Chapter 10
Chapter 10Chapter 10
Chapter 10
Β 
CRC implementation
CRC implementation CRC implementation
CRC implementation
Β 
Binary Search
Binary SearchBinary Search
Binary Search
Β 
Ripple counter
Ripple counterRipple counter
Ripple counter
Β 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
Β 
Complements
ComplementsComplements
Complements
Β 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
Β 
Error Correction And Hamming Code Ibrar
Error Correction And Hamming Code IbrarError Correction And Hamming Code Ibrar
Error Correction And Hamming Code Ibrar
Β 
Binary addition.pptx
Binary addition.pptxBinary addition.pptx
Binary addition.pptx
Β 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
Β 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
Β 
Chapter 02 instructions language of the computer
Chapter 02   instructions language of the computerChapter 02   instructions language of the computer
Chapter 02 instructions language of the computer
Β 
Error detection correction (CRC)
Error detection correction  (CRC)Error detection correction  (CRC)
Error detection correction (CRC)
Β 
1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
Β 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
Β 

Similar to Chapter 10: Error Correction and Detection

linear codes and cyclic codes
linear codes and cyclic codeslinear codes and cyclic codes
linear codes and cyclic codessaigopinadh bodigiri
Β 
New error-detection (2)
New error-detection (2)New error-detection (2)
New error-detection (2)Nitesh Singh
Β 
New error-detection
New error-detectionNew error-detection
New error-detectionNitesh Singh
Β 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksNt Arvind
Β 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdfkenilpatel65
Β 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block CodesNilaNila16
Β 
Error Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerError Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerAbdullaziz Tagawy
Β 
3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.pptAnnymus
Β 
Lecture8_Error Detection and Correction 232.pptx
Lecture8_Error Detection and Correction 232.pptxLecture8_Error Detection and Correction 232.pptx
Lecture8_Error Detection and Correction 232.pptxMahabubAlam97
Β 
error detection correction
error detection correctionerror detection correction
error detection correctionBishalWosti1
Β 
5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.ppt5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.pptprashant513130
Β 
hamming code detailed
hamming code detailedhamming code detailed
hamming code detailedIKhait
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.pptdlakmlkfma
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.pptdlakmlkfma
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.pptdlakmlkfma
Β 

Similar to Chapter 10: Error Correction and Detection (20)

linear codes and cyclic codes
linear codes and cyclic codeslinear codes and cyclic codes
linear codes and cyclic codes
Β 
New error-detection (2)
New error-detection (2)New error-detection (2)
New error-detection (2)
Β 
New error-detection
New error-detectionNew error-detection
New error-detection
Β 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networks
Β 
Chapter 10
Chapter 10Chapter 10
Chapter 10
Β 
Ch10
Ch10Ch10
Ch10
Β 
Ch10
Ch10Ch10
Ch10
Β 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf
Β 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block Codes
Β 
Error Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerError Detection and Correction - Data link Layer
Error Detection and Correction - Data link Layer
Β 
3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.ppt
Β 
Lecture8_Error Detection and Correction 232.pptx
Lecture8_Error Detection and Correction 232.pptxLecture8_Error Detection and Correction 232.pptx
Lecture8_Error Detection and Correction 232.pptx
Β 
error detection correction
error detection correctionerror detection correction
error detection correction
Β 
Channel Coding (Error Control Coding)
Channel Coding (Error Control Coding)Channel Coding (Error Control Coding)
Channel Coding (Error Control Coding)
Β 
5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.ppt5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.ppt
Β 
hamming code detailed
hamming code detailedhamming code detailed
hamming code detailed
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
Β 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
Β 

Recently uploaded

Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
Β 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
Β 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
Β 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
Β 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
Β 
Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)dollysharma2066
Β 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
Β 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
Β 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
Β 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
Β 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
Β 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
Β 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
Β 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
Β 
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube ExchangerAnamika Sarkar
Β 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
Β 

Recently uploaded (20)

Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
Β 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
Β 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
Β 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
Β 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
Β 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
Β 
Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 β‰Ό Call Girls In Shastri Nagar (Delhi)
Β 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Β 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
Β 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
Β 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
Β 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
Β 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
Β 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
Β 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Β 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
Β 
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Β 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
Β 
young call girls in Green ParkπŸ” 9953056974 πŸ” escort Service
young call girls in Green ParkπŸ” 9953056974 πŸ” escort Serviceyoung call girls in Green ParkπŸ” 9953056974 πŸ” escort Service
young call girls in Green ParkπŸ” 9953056974 πŸ” escort Service
Β 
β˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
β˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCRβ˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
β˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
Β 

Chapter 10: Error Correction and Detection

  • 1. Error Detection and Correction Presented by: Jeoffna Ruth C. Dasigo and Jobert Rae H. CasiΓ±o Error Detection and Correction Error Detection and Correction Error Detection and Correction Error Detection and Correction Error Detection and Correction Error Detection and Correction
  • 2. Data can be corrupted during transmission. Some applications require that errors be detected and corrected.
  • 3. Single-bit Error Types of Error In a single-bit error, only 1 bit in the data unit has changed. 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 changed to 1 Sent Received
  • 4. Burst Error Types of Error A burst error means that 2 or more bits in the data unit have changed. 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 Sent Received Length of burst error (8 bits) Corrupted bits
  • 5. The central concept in detecting or correcting errors. Redundancy To be able to detect or correct errors, we need to send some extra bits with our data. Redundant bits are added by the sender and removed by the receiver.
  • 6. Detection vs.Correction DETECTION CORRECTION In error correction, we need to know the exact number of bits that are corrupted and more importantly, their location in the message. The number of the errors and the size of the message are important factors. In error detection, we are looking only to see if any error has occurred. The answer is a simple yes or no. We are not even interested in the number of errors. A single-bit error is the same for us as a burst error.
  • 7. ForwardErrorCorrection Forward error correction is the process in which the receiver tries to guess the message by using redundant bits. Retransmission Correction by retransmission is a technique in which the receiver detects the occurrence of an error and asks the sender to resend the message. Methods of Error Correction
  • 8. In modular arithmetic, we use only a limited range of integers. We define an upper limit, called a modulus N. We then use only the integers 0 to N - I, inclusive. This is modulo-N arithmetic. Modular Arithmetic Modulus: 12 Integers to be used: 0 to 11 Example:
  • 9. In this arithmetic, the modulus N is 2. We can use only 0 and 1. Modulo-2 Arithmetic Adding 0+0=0 0+1=1 1+0=1 1+1=0 Subtracting 0-0=0 0-1=1 1-0=1 1-1=0 Note: In this arithmetic we use the XOR (exclusive OR) operation for both addition and subtraction.
  • 11. BlockCoding In block coding, we divide our message into blocks, each of k bits, called datawords. We add r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called codewords. Coding Scheme Example: For 4B/5B block coding, k=4 and n=5. Datawords: 2 π‘˜ = 16 Codewords: 2 𝑛 = 32
  • 12. Error Detection 1 The receiver has (or can find) a list of valid codewords. The original codeword has changed to an invalid one.
  • 13. Code for Error Detection 1 Datawords Codewords 00 000 01 011 10 101 11 110 The sender encodes the dataword 01 as 011 and sends it to the receiver.  The receiver receives 011 – valid codeword, no error detected.  The receiver receives 111 – invalid codeword, error detected.  The receiver receives 000 – valid codeword, error undetected.
  • 14. 1 An error-detecting code can detect only the types of errors for which it is designed; other types of errors may remain undetected.
  • 15. 1 ErrorCorrection In error detection, the receiver needs to know only that the received codeword is invalid; in error correction the receiver needs to find (or guess) the original codeword sent.
  • 16. 1 Assume the dataword is 01. The sender consults the table (or uses an algorithm) to create the codeword 01011. The codeword is corrupted during transmission, and 01001 is received (error in the second bit from the right). Dataword Codeword 00 00000 01 01011 10 10101 11 11110 Code for Error Correction
  • 17. Hamming Distance The Hamming distance between two words is the number of differences between corresponding bits. Examples: 1. The Hamming distance d(OOO, 011) is 2 2. The Hamming distance d(10101, 11110) is 3 000 Ꚛ 011 is 011 (two 1s) 10101 Ꚛ 11110 is 01011 (three 1s)
  • 18. Minimum Hamming Distance The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. used for designing a code
  • 19. Three 1. Codeword size, n 2. Dataword size, k 3. Minimum Hamming distance, 𝒅 π’Žπ’Šπ’ Examples: C(3, 2) with dmin =2 C(5, 2) with dmin = 3 Parameters
  • 20. HammingDistanceandError The Hamming distance between the received codeword and the sent codeword is the number of bits that are corrupted during transmission.
  • 21. MinimumDistancefor ErrorDetection If s errors occur during transmission, the Hamming distance between the sent codeword and received codeword is s. If our code is to detect up to s errors, the minimum distance between the valid codes must be s + 1, so that the received codeword does not match a valid codeword.
  • 22. Geometric concept for finding 𝑑 π‘šπ‘–π‘›in error detection 𝑑 π‘šπ‘–π‘› = s + 1
  • 23. MinimumDistanceforError Correction Suppose a codeword x is corrupted by t bits or less. Then this corrupted codeword is located either inside or on the perimeter of the circle. If the receiver receives a codeword that belongs to this territory, it decides that the original codeword is the one at the center.
  • 24. Geometric concept for finding 𝑑 π‘šπ‘–π‘› in error correction 𝑑 π‘šπ‘–π‘› = 2𝑑 + 1
  • 25. Linear Block Codes In a linear block code, the exclusive OR (XOR) of any two valid codewords creates another valid codeword. Datawords Codewords 00 000 01 011 10 101 11 110 Ꚛ
  • 26. Minimum Distance for Linear Block Codes The minimum Hamming distance is the number of Is in the nonzero valid codeword with the smallest number of 1’s. Datawords Codewords 00 000 01 011 10 101 11 110 𝑑 π‘šπ‘–π‘› = 2
  • 27. Simple Parity-Check Code Received Codeword Syndrome Created Dataword 10111 0 1011 10011 1 - 10110 1 - 00110 0 0011 01011 1 - Dataword sent: 1011
  • 28. HammingCodes β€’ These codes were originally designed with 𝑑 π‘šπ‘–π‘› = 3, which means that they can detect up to two errors or correct one single error. Important Parameters: m >= 3 n = 2 π‘š βˆ’ 1 k = n-m Example: If m = 3, then n = 7 and k = 4 This is a Hamming code C(7,4) with 𝑑 π‘šπ‘–π‘› = 3
  • 29.
  • 30. Examples: 1. The dataword 0100 becomes the codeword 0100011. The codeword 0100011 is received. The syndrome is 000 (no error), the final dataword is 0100. 2. The dataword 0111 becomes the codeword 0111001. The codeword 0011001 is received. The syndrome is 011. According to Table 10.5, b2 is in error. After flipping b2 (changing the 1 to 0), the final dataword is 0111. 3. The dataword 1101 becomes the codeword 1101000. The codeword 0001000 is received (two errors). The syndrome is 101, which means that bo is in error. After flipping bo,we get 0000, the wrong dataword. This shows that our code cannot correct two errors.
  • 31. Example: We need a dataword of at least 7 bits. Calculate values of k and n that satisfy this requirement. Solution: We need to make k = n - m greater than or equal to 7, or 21𝑛 - 1 - m ~ 7. 1. If we set m = 3, the result is n = 23 - 1 and k =7 - 3, or 4, which is not acceptable. 2. If we set m = 4, then n = 24 – 1 = 15 and k = 15 - 4 = 11, which satisfies the condition. So the code is C(l5, 11). There are methods to make the dataword a specific size, but the discussion and implementation are beyond the scope of this book.
  • 32. Cyclic Codes Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another codeword. Example: 1011000 when cyclically shifted becomes 0110001
  • 35. Cyclic Redundancy Check Encoder 1 0 0 1 0 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 0 0 0 0 1 1 0 Quotient Divisor Dividend: augmented dataword Leftmost bit 0: use 0000 divisor Leftmost bit 0: use 0000 divisor Remainder 0 1 0
  • 36. Cyclic Redundancy Check Decoder 1 0 0 0 1 1 0 1 1 0 1 1 Codeword 0 1 0 1 0 1 1 0 1 1 1 0 0 0 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 1 1 0 1 1 SyndromeDataword: Discarded
  • 38. Divisor 1. The divisor is repeatedly XORed with part of the dividend. 2. The divisor has n - k + 1 bits which either are predefined or are all 0’s. 3. Only n - k bits of the divisor is needed in the XOR operation. Leftmost bit of the dividend Divisor bits (𝑑2 𝑑1 𝑑0) 0 000 1 011
  • 41. Remainder (n - k bits in general) in length
  • 43. General Design n - k I-bit shift registers in both the encoder and decoder
  • 44. Polynomials A better way to understand cyclic codes and how they can be analyzed is to represent them as polynomials.
  • 45. Polynomials AddingandSubtracting Polynomials Degreeof Polynomials MultiplyingorDividing Terms The degree of a polynomial is the highest power in the polynomial. It is 1 less than the number of bits First, addition and subtraction are the same. Second, adding or subtracting is done by combining terms and deleting pairs of identical terms. Multiplying a term by another term is very simple; we just add the powers. For dividing, we just subtract the power of the second term from the power of the first. π‘₯6 + π‘₯ + 1 has 7 bits π‘₯6 + π‘₯4 + π‘₯2 π‘₯5 + π‘₯4 + π‘₯2 π‘₯6+π‘₯5 π‘₯3 + π‘₯4 = π‘₯7 π‘₯5 π‘₯2 = π‘₯3 Multiplication Division
  • 46. Polynomials MultiplyingTwoPolynomials DividingOnePolynomialbyAnother Multiplying a polynomial by another is done term by term. Each term of the first polynomial must be multiplied by all terms of the second. Division of polynomials is conceptually the same as the binary division. Shifting A binary pattern is often shifted a number of bits to the right or left. Shifting to the left means adding extra 0’s as rightmost bits; shifting to the right means deleting some rightmost bits.
  • 47. Polynomials CyclicCodeEncoderUsingPolynomials Division of polynomials is conceptually the same as the binary division.
  • 48. Polynomials CyclicCodeAnalysis We can analyze a cyclic code to find its capabilities by using polynomials. We define the following, where f(x) is a polynomial with binary coefficients. Dataword: d(x) Syndrome: s(x) Codeword: c(x) Error: e(x) Generator: g(x) In a cyclic code, 1. If s(x) β‰  0, one or more bits is corrupted. 2. If s(x) = 0, either a. No bit is corrupted. or b. Some bits are corrupted, but the decoder failed to detect them. Received codeword = c (x) + e(x) 𝑅𝑒𝑐𝑒𝑖𝑣𝑒𝑑 π‘π‘œπ‘‘π‘’π‘€π‘œπ‘Ÿπ‘‘ 𝑔(π‘₯) = 𝑐(π‘₯) 𝑔(π‘₯) + 𝑒(π‘₯) 𝑔(π‘₯) In a cyclic code, those e(x) errors that are divisible by g(x) are not caught.
  • 49. Single-Bit Error A single-bit error is e(x) =xi, where i is the position of the bit. If a single-bit error is caught, then xi is not divisible by g(x). If g(x) ha~ at least two terms (which is normally the case) and the coefficient of π‘₯0 is not zero (the rightmost bit is 1), then e(x) cannot be divided by g(x). If the generator has more than one term and the coefficient of π‘₯0 is 1, all single errors can be caught.
  • 50. Single-BitError Example Which of the following g(x) values guarantees that a single-bit error is caught? For each case, what is the error that cannot be caught? a. x + 1 b. b. x3 c. c. 1 Solution a. No xi can be divisible by x + 1. In other words, xi/ex + 1) always has a remainder. So the syndrome is nonzero. Any single-bit error can be caught. b. b. If i is equal to or greater than 3, xi is divisible by g(x). The remainder of xi/x3 is zero, and the receiver is fooled into believing that there is no error, although there might be one. Note that in this case, the corrupted bit must be in position 4 or above. All single-bit errors in positions I to 3 are caught. c. c. All values of i make j divisible by g(x). No single-bit error can be caught. In addition, this g(x) is useless because it means the codeword is just the dataword augmented with n- k zeros.
  • 51. Two Isolated Single-Bit Errors A single-bit error is e(x) =xi, where i is the position of the bit. If a single-bit error is caught, then xi is not divisible by g(x). If g(x) ha~ at least two terms (which is normally the case) and the coefficient of π‘₯0 is not zero (the rightmost bit is 1), then e(x) cannot be divided by g(x). If a generator cannot divide π‘₯ 𝑑 + 1 (t between 0 and n - 1), then all isolated double errors can be detected.
  • 52. Example Find the status of the following generators related to two isolated, single-bit errors. a. x+ 1 b. π‘₯4 + 1 c. π‘₯7 + π‘₯6 + 1 d. π‘₯ 𝐼𝑠 + π‘₯ 𝐼4 +1 Solution a. This is a very poor choice for a generator. Any two errors next to each other cannot be detected. b. This generator cannot detect two errors that are four positions apart. The two errors can be anywhere, but if their distance is 4, they remain undetected. c. This is a good choice for this purpose. d. This polynomial cannot divide any error of 𝑑𝑦𝑝𝑒π‘₯ 𝑑 + 1 if t is less than 32,768. This means that a code word with two isolated errors that are next to each other or up to 32,768 bits apart can be detected by this generator. TwoIsolatedSingle-BitErrors
  • 53. Odd Numbers of Errors A generator with a factor of x + 1 can catch all odd numbers of errors. This means that we need to make x + 1 a factor of any generator. If it is only x + 1, it cannot catch the two adjacent isolated errors. A generator that contains a factor of x + 1 can detect all odd-numbered errors. Example x4 + x2 + X + 1 can catch all odd-numbered errors since it can be written as a product of the two polynomials x + 1 and x3 + x2 + 1.
  • 54. Burst Errors The most important of all. A burst error is of the form e(x) =π‘₯ 𝐽 + ... + xi). Note the difference between a burst error and two isolated single-bit errors. The first can have two terms or more; the second can only have two terms. We can factor out xi and write the error as xi(π‘₯ π½βˆ’π‘– + ... + 1). If our generator can detect a single error (minimum condition for a generator), then it cannot divide xi. What we should worry about are those generators that divide π‘₯ π½βˆ’π‘– + ... + 1. In other words, the remainder of (π‘₯ π½βˆ’π‘– + ...+ 1)/(π‘₯ π‘Ÿ + ... + 1) must not be zero.  All burst errors with L ≀ r will be detected.  All burst errors with L =r + 1 will be detected with probability 1 - (112/ βˆ’1 β€’  All burst errors with L > r + 1 will be detected with probability 1-(1/2[.
  • 55. Criteria for a good Polynomial Generator 1. It should have at least two terms. 2. The coefficient of the term xO should be 1. 3. It should not divide Xl + 1, for t between 2 and n - 1. 4. It should have the factor x + 1.
  • 57. Advantages of Cyclic Codes They can easily be implemented in hardware and software. They are especially fast when implemented in hardware.
  • 58. CHECKSUM The checksum is used in the Internet by several protocols although not at the data link layer. Like linear and cyclic codes, the checksum is based on the concept of redundancy. Several protocols still use the checksum for error detection as we will see in future chapters, although the tendency is to replace it with a CRe. This means that the CRC is also used in layers other than the data link layer.
  • 59. CHECKSUM Example Suppose our data is a list of five 4-bit numbers that we want to send to a destination. In addition to sending these numbers, we send the sum of the numbers. For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12,0,6,36), where 36 is the sum of the original numbers. The receiver adds the five numbers and compares the result with the sum. If the two are the same, the receiver assumes no error, accepts the five numbers, and discards the sum. Otherwise, there is an error somewhere and the data are not accepted.
  • 60. CHECKSUM One’s Complement The previous example has one major drawback. All of our data can be written as a 4-bit word (they are less than 15) except for the checksum. One solution is to use one's complement arithmetic. In this arithmetic, we can represent unsigned numbers between 0 and 2 𝑛 - 1 using only n bits t. If the number has more than n bits, the extra leftmost bits need to be added to the n rightmost bits (wrapping). In one's complement arithmetic, a negative number can be represented by inverting all bits (changing a 0 to a 1 and a 1 to a 0). This is the same as subtracting the number from 2 𝑛 - 1.
  • 61. CHECKSUM One’s Complement Example How can we represent the number 21 in one's complement arithmetic using only four bits? Solution The number 21 in binary is 10101 (it needs five bits). We can wrap the leftmost bit and add it to the four rightmost bits. We have (0101 + 1) = 0110 or 6.
  • 62. CHECKSUM One’s Complement Example How can we represent the number-6 in one's complement arithmetic using only four bits? Solution In one's complement arithmetic, the negative or complement of a number is found by inverting all bits. Positive 6 is 0110; negative 6 is 100I. If we consider only unsigned numbers, this is 9. In other words, the complement of6 is 9. Another way to find the complement of a number in one's complement arithmetic is to subtract the number from 2 𝑛 - 1 (16 - 1 in this case).
  • 63. CHECKSUM Internet Checksum Traditionally, the Internet has been using a 16-bit checksum. The sender calculates the checksum by following these steps. Sender site: 1. The message is divided into 16-bit words. 2. The value of the checksum word is set to O. 3. All words including the checksum are added using one's complement addition. 4. The sum is complemented and becomes the checksum. 5. The checksum is sent with the data.
  • 64. CHECKSUM Internet Checksum The receiver uses the following steps for error detection. Receiver site: 1. The message (including checksum) is divided into 16-bit words. 2. All words are added using one's complement addition. 3. The sum is complemented and becomes the new checksum. 4. If the value of checksum is 0, the message is accepted; otherwise, itis rejected.
  • 65. CHECKSUM Internet Checksum Example Let us calculate the checksum for a text of 8 characters ("Forouzan"). The text needs to be divided into 2- byte (16-bit) words. We use ASCII to change each byte to a 2- digit hexadecimal number. For example, F is represented as Ox46 and 0 is represented as Ox6F. Figure 10.25 shows how the checksum is calculated at the sender and receiver sites. In part a of the figure, the value of partial sum for the first column is Ox36. We keep the rightmost digit (6) and insert the leftmost digit (3) as the carry in the second column. The process is repeated for each column.
  • 67. QUIZ # 8 Chapter 10 - Error Detection and Correction
  • 68. 1. Checksums use _________ arithmetic. A)one's complement arithmetic B)two's complement arithmetic C)either a or b D)none of the above Quiz # 8 Error Detection and Correction
  • 69. 2. In modulo-11 arithmetic, we use only the integers in the range ______, inclusive. A) 1 to 10 B) 0 to 10 C) 1 to 11 D) none of the above Quiz # 8 Error Detection and Correction
  • 70. 3. The ________ between two words is the number of differences between corresponding bits. A) Hamming rule B) Hamming code C) Hamming distance D) none of the above Quiz # 8 Error Detection and Correction
  • 71. 4. The _______ of a polynomial is the highest in the polynomial. A) range B) power C) degree D) base Quiz # 8 Error Detection and Correction
  • 72. 5. A _____ error means that two or more bits in the data unit have changed. A) burst B) double-bit C) single-bit D) none of the above Quiz # 8 Error Detection and Correction
  • 73. 6. In modulo-2 arithmetic, we use only ______. A) 1 and 2 B) 0 and 1 C) 0 and 2 D) 1 and 3 Quiz # 8 Error Detection and Correction
  • 74. 7. In a linear block code, the _______ of any two valid codewords creates another valid codeword. A) ANDing B) XORing C) ORing D) none of the above Quiz # 8 Error Detection and Correction
  • 75. 8-9. Give two types of Error Quiz # 8 Error Detection and Correction
  • 76. 10. In block coding, if k = 2 and n = 3, we have _______ invalid codewords. A) 4 B) 8 C) 2 D) 5 Quiz # 8 Error Detection and Correction
  • 77. 11-12. We can divide coding schemes into two broad categories: ________ and ________. Quiz # 8 Error Detection and Correction
  • 78. 13. We add r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called _________. A) codewords B) datawords C) blockwords D) syndrome Quiz # 8 Error Detection and Correction
  • 79. 14. Which error detection method uses one's complement arithmetic? A) Checksum B) CRC C) Simple parity check D) Two-dimensional parity check Quiz # 8 Error Detection and Correction
  • 80. 15. In modulo-2 arithmetic, we use the ______ operation for both addition and subtraction. A) OR B) XOR C) AND D) none of the above Quiz # 8 Error Detection and Correction
  • 81. 16. To guarantee the detection of up to 5 errors in all cases, the minimum Hamming distance in a block code must be _______. A) 11 B) 5 C) 6 D) 7 Quiz # 8 Error Detection and Correction
  • 82. 17. A generator that contains a factor of ____ can detect all odd-numbered errors. A) x B) 1 C) x + 1 D) x + 2 Quiz # 8 Error Detection and Correction
  • 83. 18. A simple parity-check code can detect __________ errors. A) an odd-number of B) an even-number of C) two D) no errors Quiz # 8 Error Detection and Correction
  • 84. 19. The correction of errors is more difficult than the detection. True or False ? Quiz # 8 Error Detection and Correction
  • 85. 20. The additional bits called parity bits allow correction or detection of errors. True or False ? Quiz # 8 Error Detection and Correction
  • 86. Quiz # 8 Error Detection and Correction ANSWERS
  • 87. 1. Checksums use _________ arithmetic. A)one's complement arithmetic B)two's complement arithmetic C)either a or b D)none of the above Quiz # 8 Error Detection and Correction
  • 88. 2. In modulo-11 arithmetic, we use only the integers in the range ______, inclusive. A) 1 to 10 B) 0 to 10 C) 1 to 11 D) none of the above Quiz # 8 Error Detection and Correction
  • 89. 3. The ________ between two words is the number of differences between corresponding bits. A) Hamming rule B) Hamming code C) Hamming distance D) none of the above Quiz # 8 Error Detection and Correction
  • 90. 4. The _______ of a polynomial is the highest in the polynomial. A) range B) power C) degree D) base Quiz # 8 Error Detection and Correction
  • 91. 5. A _____ error means that two or more bits in the data unit have changed. A) burst B) double-bit C) single-bit D) none of the above Quiz # 8 Error Detection and Correction
  • 92. 6. In modulo-2 arithmetic, we use only ______. A) 1 and 2 B) 0 and 1 C) 0 and 2 D) 1 and 3 Quiz # 8 Error Detection and Correction
  • 93. 7. In a linear block code, the _______ of any two valid codewords creates another valid codeword. A) ANDing B) XORing C) ORing D) none of the above Quiz # 8 Error Detection and Correction
  • 94. 8-9. Give two types of Error Quiz # 8 Error Detection and Correction Single-bit Error and Burst Error
  • 95. 10. In block coding, if k = 2 and n = 3, we have _______ invalid codewords. A) 4 B) 8 C) 2 D) 5 Quiz # 8 Error Detection and Correction
  • 96. 11-12. We can divide coding schemes into two broad categories: ________ and ________. Quiz # 8 Error Detection and Correction Block Coding; Convolution Coding
  • 97. 13. We add r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called _________. A) codewords B) datawords C) blockwords D) syndrome Quiz # 8 Error Detection and Correction
  • 98. 14. Which error detection method uses one's complement arithmetic? A) Checksum B) CRC C) Simple parity check D) Two-dimensional parity check Quiz # 8 Error Detection and Correction
  • 99. 15. In modulo-2 arithmetic, we use the ______ operation for both addition and subtraction. A) OR B) XOR C) AND D) none of the above Quiz # 8 Error Detection and Correction
  • 100. 16. To guarantee the detection of up to 5 errors in all cases, the minimum Hamming distance in a block code must be _______. A) 11 B) 5 C) 6 D) 7 Quiz # 8 Error Detection and Correction
  • 101. 17. A generator that contains a factor of ____ can detect all odd-numbered errors. A) x B) 1 C) x + 1 D) x + 2 Quiz # 8 Error Detection and Correction
  • 102. 18. A simple parity-check code can detect __________ errors. A) an odd-number of B) an even-number of C) two D) no errors Quiz # 8 Error Detection and Correction
  • 103. 19. The correction of errors is more difficult than the detection. True Quiz # 8 Error Detection and Correction
  • 104. 20. The additional bits called parity bits allow correction or detection of errors. True Quiz # 8 Error Detection and Correction

Editor's Notes

  1. Resending is repeated until a message arrives that the receiver believes is error-free (usually, not all errors can be detected).