• No results found

Coding Theory and Cryptography Chapter Six Error Detection & Correction - Part2

N/A
N/A
Protected

Academic year: 2021

Share "Coding Theory and Cryptography Chapter Six Error Detection & Correction - Part2"

Copied!
19
0
0

Loading.... (view fulltext now)

Full text

(1)

Coding Theory and Cryptography

Chapter Six

Error Detection & Correction - Part2

Instructor: Newroz N. Abdulrazaq

[email protected]

Science College- Department of Computer Science & I.T.

8 May 2020 Sallahaddin University- Erbil Slide #1

Text Book: Introduction to Cryptography with Coding Theory by wade Trappe + Educational Websites.

(2)

8 May 2020 Sallahaddin University- Erbil Slide #2

Chapter 6:

Error Correction Technique

Overview:

- Error Detection Techniques… Cont.

- Structure of encoder and decoder in error correction. - Error Correction Techniques.

(3)

8 May 2020 Sallahaddin University- Erbil Slide #3

Error Detection Techniques… Cont.

3

Cyclic Redundancy Check

1) The sender performs binary division of the data segment by the divisor. It then appends the remainder called CRC bits to the end of the data segment.

(4)

8 May 2020 Sallahaddin University- Erbil Slide #4

Example:

Generate CRC for the message (hi) using the

Divisor 11011 and index the letters a-z from 0-25

respectively.

Solution:

Convert the message (hi) to binary form:

(5)

8 May 2020 Sallahaddin University- Erbil Slide #5

Append (number of divisor bits-1) Zero’s to the binary message:

Solution:

1111000

0000

11011

11011

1

001010

0

0

1

11011

011110

1

001010

0

11011

0

1

11011

011110

1

11011

00101

Since divisor=11011, so we have 5 bits – 1=4 bits should be add to the message: 11110000000

CRC

Hence, 11110000101

(6)
(7)

8 May 2020 Sallahaddin University- Erbil Slide #7

Error Correction Techniques

Backward Error Correction (Retransmission)

✓ If the receiver detects an error in the incoming frame, it requests the sender to retransmit the frame.

✓ It is a relatively simple technique. But it can be efficiently used only where retransmitting is not expensive as in fiber optics. ✓ There are two ways in which the return channel can be used to

(8)

8 May 2020 Sallahaddin University- Erbil Slide #8

Error Correction Techniques

Forward Error Correction

✓ If the receiver detects some error in the incoming frame, it executes error-correcting code that generates the actual frame. ✓ This saves bandwidth required for retransmission.

(9)

8 May 2020 Sallahaddin University- Erbil Slide #9

Hamming Distance

In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different.

Example: Find Hamming distance between 1101101 and 1011100?

1

1

0

1

1

0

1

1

0

1

1

1

0

0

(10)

8 May 2020 Sallahaddin University- Erbil Slide #10

Minimum Hamming Distance

➢ The minimum Hamming distance is the smallest Hamming distance between all possible pairs.

(11)

8 May 2020 Sallahaddin University- Erbil Slide #11

Minimum Hamming Distance

➢ To design a code that can detect d single bit errors, the minimum Hamming distance for the set of codewords must be

d + 1

(12)

8 May 2020 Sallahaddin University- Erbil Slide #12

Hamming Code

➢ The most common types of error-correcting codes used in RAM are based on the codes devised by R. W. Hamming.

➢ In the Hamming code, k parity bits are added to an n-bit data word, forming a new word of n + k bits. The bit positions are numbered in sequence from 1 to n + k.

➢ Those positions numbered with powers of two are reserved for the parity bits. The remaining bits are the data bits.

(13)

8 May 2020 Sallahaddin University- Erbil Slide #13

Hamming Code

Example : Generate hamming code for data 1110 using even parity?

Solution: Since the data word =1110, so n=4 number of bits.

If we use k=3, 23 = 8 ≥ 3 + 5 = 8.

Calculate the number of Parity bits that is needed for generate a 4 bit data word using the condition: 2𝑘 ≥ 𝑘 + 𝑛 + 1.

2𝑘 ≥ 𝑘 + 5. ∴ 𝑘 = 3 𝑖𝑠 𝑎 𝑣𝑎𝑙𝑖𝑑 𝑝𝑎𝑟𝑖𝑡𝑦 𝑛𝑢𝑚𝑏𝑒𝑟

(14)

8 May 2020 Sallahaddin University- Erbil Slide #14

1

2

3

4

5

6

7

Rearrange Bit positions:

2

0

2

1

2

2

P

1

P

2

D

1

P

3

D

2

D

3

D

4

P

1

P

2

1

P

3

1

1

0

P1 = XOR of bits (P1, 3, 5, 7) = P1⊕1⊕1⊕0

The position of the parity bit determines the sequence of bits that it alternately checks and skips.

P1=0

P2 = XOR of bits (P2, 3, 6, 7) = P2⊕1⊕1⊕0 P2=0

P3 = XOR of bits (P3, 5, 6) = P3⊕1⊕1 P3=0

(15)

8 May 2020 Sallahaddin University- Erbil Slide #15

Example : Check if the message 0010100 is transmitted correctly or not? If not, correct it? Using hamming code with even parity.

Solution:

1

2

3

4

5

6

7

0

0

1

0

1

0

0

C1 =XOR of bits (1, 3, 5, 7) =0 ⊕ 1 ⊕ 1 ⊕ 0 = 0 C2 =XOR of bits (2, 3, 6, 7) =0 ⊕ 1 ⊕ 0 ⊕ 0 = 1 C3 =XOR of bits (4, 5, 6) =0 ⊕ 1 ⊕ 0 = 1 Rearrange C3C2C1 =110 ≡10 6 𝐸𝑟𝑟𝑜𝑟 𝑖𝑛 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 6

(16)

8 May 2020 Sallahaddin University- Erbil Slide #16

Example : what is the data word for the code word 010111010101 for H(12,4)?

Solution:

Hence, the message 01100101 is the original message

1

2

3

4

5

6

7

8

9 10 11 12

0

1

0

1

1

1

0

1

0 1 0 1

(17)

8 May 2020 Sallahaddin University- Erbil Slide #17

Home Works:

Q2) Create a codeword for (Kurd) using Hamming odd parity for

each character?

Q3) what is the dataword for the following codeword 101001110111? Q4) Check if there is an error for the following code word and then

correct it using even parity: a. 011110010100

b. 001110010110

(18)

8 May 2020 Sallahaddin University- Erbil Slide #18

Key Point

Cyclic Redundancy Check

Error Correction techniques.

Hamming Distance.

(19)

References

Related documents

Viviscal Man supplements are scientifically formulated to help reduce hair loss and increase hair growth in men with androgenic alopecia.. Viviscal® supplements contain Amino Mar C™,

This Part 380 contains terms and regulations adopted by the Copyright Royalty Judges (Judges) in the context of a rate determination proceeding, Determination of Royalty Rates and

Second, the initial design of the civic learning model based on the local wisdom is in accordance with the syntax of learning that includes the structure

One of the biggest challenges in personalized medicine is how to convert clinical research and product development into a financially sustainable business strategy which can project

During active phases, strong positive wind stress curl anomalies force oceanic upwelling 306 . and cooling on the northern/northwestern flank of the Somali Jet up to lag+02, while

As shown above first of all number and name are entered via keypad .These data are displayed regularly in the lcd connected to a port of microcontroller.These contact of

PJ Materials Consultants Limited provide consulting services for the special problems associated with the design, construction, restoration and protection of concrete floors