Title: Ch 2.7 Error Detection
1Ch 2.7Error Detection Correction
2Error Detection and Correction
- No communication channel or storage device is
completely error-free - As the number of bits per area or the
transmission rate increases, more errors occur. - Impossible to detect or correct 100 of the
errors
Ch 2.7 gt Introduction
3Error Detection and Correction
- 3 Types of Error Detection/Correction Methods
- Cyclic Redundancy Check (CRC)
- Hamming Codes
- Reed-Solomon (RS)
- 10011001011 1001100 1011
-
- Code word information error-checking bits/
- bits parity bits/
- syndrome/
- redundant bits
Ch 2.7 gt Introduction
4Cyclic Redundancy Check (CRC)
- Mostly used in data communication
- Tells us whether an error has occurred, but does
not correct the error. - This is a type of systematic error detection
- The error-checking bits are appended to the
information byte
Ch 2.7 gt Cyclic Redundancy Check
5Modulo 2 Arithmetic
- Addition Rules
- 0 0 0 Ex 1011
- 0 1 1 110
- 1 0 1 1101
- 1 1 0
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
6Modulo 2 Arithmetic
- Division
- ________
- Ex 1011 1001011
-
- divisor dividend
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
7Modulo 2 Arithmetic
- Division
- ____1___
- Ex 1011 1001011
- 1011
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
8Modulo 2 Arithmetic
- Division
- ____1___
- Ex 1011 1001011
- 1011
- 0010
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
9Modulo 2 Arithmetic
- Division
- ____10__
- Ex 1011 1001011
- 1011
- 00100
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
10Modulo 2 Arithmetic
- Division
- ____101_
- Ex 1011 1001011
- 1011
- 001001
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
11Modulo 2 Arithmetic
- Division
- ____101_
- Ex 1011 1001011
- 1011
- 001001
- 1011
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
12Modulo 2 Arithmetic
- Division
- ____101_
- Ex 1011 1001011
- 1011
- 001001
- 1011
- 0010
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
13Modulo 2 Arithmetic
- Division
- ____1010
- Ex 1011 1001011
- 1011
- 001001
- 1011
- 00101
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
14Modulo 2 Arithmetic
- Division
- ____1010 ? Quotient
- Ex 1011 1001011
- 1011
- 001001
- 1011
- 00101 ? Remainder
Ch 2.7 gt Cyclic Redundancy Check gt Modulo 2
Arithmetic
15Calculating and Using CRCs
- Let the information byte F 1001011
- The sender and receiver agree on an arbitrary
binary pattern P. Let P 1011. - Shift F to the left by 1 less than the number of
bits in P. Now, F 1001011000. - Let F be the dividend and P be the divisor.
Perform modulo 2 division. - After performing the division, we ignore the
quotient. We got 100 for the remainder, which
becomes the actual CRC checksum. - Add the remainder to F, giving the message M
- 1001011 100 1001011100 M
Ch 2.7 gt Cyclic Redundancy Check gt Calculate CRCs
16Calculating and Using CRCs
- M is decoded and checked by the message receiver
using the reverse process. -
- ____1010100
- 1011 1001011100
- 1011
- 001001
- 1001
- 0010
- 001011
- 1011
- 0000 ? Remainder
Ch 2.7 gt Cyclic Redundancy Check gt Calculate CRCs
17Hamming Codes
- One of the most effective codes for
error-recovery - Used in situations where random errors are likely
to occur - Error detection and correction increases in
proportion to the number of parity bits
(error-checking bits) added to the end of the
information bits - code word information bits parity bits
- Hamming distance the number of bit positions in
which two code words differ. - 10001001
- 10110001
-
- Minimum Hamming distance or D(min) determines
its error detecting and correcting capability.
Ch 2.7 gt Hamming Codes
18Hamming Codes
- Hamming codes can always detect D(min) 1
errors, but can only correct half of those errors.
Ch 2.7 gt Hamming Codes
19Hamming Codes
- EX. Data Parity Code
- Bits Bit Word
- 00 0 000 01 1 011 10 1
101 11 0 110 - 000 100 001 101 010 110
011 111
Ch 2.7 gt Hamming Codes
20Hamming Codes
- Single parity bit can only detect error, not
correct it - Error-correcting codes require more than a single
parity bit
Ch 2.7 gt Hamming Codes
21Hamming Codes
- EX. 0 0 0 0 0 0 1 0 1 1 1 0 1 1
0 1 1 1 0 1 - Minimum Hamming distance 3
- Can detect up to 2 errors and correct 1 error
Ch 2.7 gt Hamming Codes
22Hamming Codes
- Hamming codes work well when we can reasonably
expect errors to be rare events. (ex hard
drives) - Hamming codes are useless when multiple adjacent
errors are likely to occur. - These errors are called burst errors that
result from mishandling removable media (ex
magnetic tapes or CDs).
Ch 2.7 gt Hamming Codes
23Reed-Solomon (RS)
- Operates at block level instead of bit level
- - RS(n, k) codes are defined using the following
parameters - s the number of bits in a char (8 bits)
- k the number of s-bit characters comprising
the data block - n the number of bits in the code word
- RS(n, k) can correct (n k)/2 errors in the k
information bytes - EX RS(255, 223)
-
- can correct up to 16 erroneous bytes in the
information block
Ch 2.7 gt Reed-Solomon
24Summary
- 3 Types of Error Detection/Correction Methods
- Cyclic Redundancy Check (CRC)
- Used primarily in communication
- Can only detect errors.
- Hamming Codes
- Can detect and correct errors.
- The more parity bits added, the more errors can
be detected and corrected. - Used to detect errors in memory bits or fixed
magnetic disk drives, in which errors occur
randomly.
Ch 2.7 gt Summary
25Summary
- Reed-Solomon (RS)
- Can detect errors that occur in blocks (adjacent
errors) - Used to detect errors in removable media such as
magnetic tapes or compact disks, in which burst
errors occur due to mishandling and
environmental stress.
Ch 2.7 gt Summary