+ All Categories
Home > Education > Parity check(Error Detecting Codes)

Parity check(Error Detecting Codes)

Date post: 13-Apr-2017
Category:
Upload: imesha-perera
View: 10,433 times
Download: 0 times
Share this document with a friend
21
Error Detection Codes Parity Check 1 By W.I.D.Perera(Esha) Vavuniya Campus, University Of Jaffna, SL
Transcript
Page 1: Parity check(Error Detecting Codes)

1

Error Detection Codes

Parity CheckBy

W.I.D.Perera(Esha)Vavuniya Campus, University Of Jaffna, SL

Page 2: Parity check(Error Detecting Codes)

2

ContentWhy we need Error Detection?What are the Errors?What are the Error Detection Mechanisms?

Parity Check Single Parity Check Two Dimensional Parity Check

Drawbacks of Parity

Page 3: Parity check(Error Detecting Codes)

3

Error Detection

• Data can be corrupted during transmission. Even with best prevention methods.

• For a reliable communication, errors must be detected and corrected.

• Error detection and correction are implemented either at data link layer or the transport layer of the OSI model.

Page 4: Parity check(Error Detecting Codes)

4

Types of Errors

• Single bit error :-- Only one bit in the data unit has changed.

0 changed to 1

Received Sent

Page 5: Parity check(Error Detecting Codes)

5

Types of Errors

• Burst error :-- It means that two or more bits in the data unit has changed.

Sent

Received

Bits corrupted by Burst Error

Page 6: Parity check(Error Detecting Codes)

6

Error Detection Codes• Error detecting code is to include only enough redundancy to allow

the receiver to deduce that an error occurred, but not which error, and have it request a re-transmission.

• Used in Low Noisy Channels – Fiber Optics• Error detection uses the concept of redundancy, which means

adding extra bits for detecting error at the destination• To detect an error, something extra has to be added to the data/signal

• This extra is an error detection code• 3 Techniques are there: Parity Check, Check Sum, CRC

Page 7: Parity check(Error Detecting Codes)

7

Parity Check

• The Simplest method Available - it’s a linear, systematic block code

• 2 Parity Check Methods are there:• Simple Parity - For Single bit Errors • Two Dimensional - For Burst Errors

• How to use Parity Methods?• Parity Generate – Sender’s Side• Parity Detect – Receiver’s Side

Page 8: Parity check(Error Detecting Codes)

8

Single Parity Check(VRC)Vertical Redundancy Check

• In Single parity check, a parity bit is added to every data unit so that the total number of 1s is even or odd.

11010011 1

• Therefore, the total number of bits transmitted would be 9 bits. ( 8 bits of information + 1 bit parity = n data bits into n+1 bits)

Information(1 byte – 8 bits)

Additional Bit added(PARITY BIT)

Page 9: Parity check(Error Detecting Codes)

9

Single Parity check(Cont.)Parity Generation

• There are two ways to generate a Single parity bit. • One is called Even parity and the other is

Odd parity.• What is even parity?• the total number of 1’s transmitted must be

even.• What is odd parity?• the total number of 1’s transmitted must be

odd

Page 10: Parity check(Error Detecting Codes)

10

Parity Generation-VRC

• Parity bit is chosen so that the number of 1 bits in the code-word is even (or odd)• computing the (even) parity bit as the modulo 2

sum or XOR of the data bits.• use XOR and XNOR logic gates in circuits to

generate parity bits in practically (in devices).

Page 11: Parity check(Error Detecting Codes)

11

How is the even parity bit generated?Total number of ‘1’s should be even.

If the byte that we want to transmit is:

• Step 1: count the number of 1’s in the byte.• Answer: 5

• Step 2: compute the parity value. • Since the total number of 1’s is 5, the even parity bit will have a value of

1.

• If the number of bits are already even, the parity bit will be ‘0’.

1 0 1 0 1 1 0 1

1 0 1 0 1 1 0 1

1

Page 12: Parity check(Error Detecting Codes)

12

How is the odd parity bit generated?Total number of ‘1’s should be odd.

If the byte that we want to transmit is:

• Step 1: count the number of 1’s in the byte.• Answer: 4

• Step 2: compute the parity value. • Since the total number of 1’s is 4, the odd parity bit will have a value

of 1.

• If the number of bits are already odd, the parity bit will be ‘0’.

1 0 1 0 1 1 0 0

1 0 1 0 1 1 0 0

1

Page 13: Parity check(Error Detecting Codes)

13

Single Parity check(Cont.)Parity Detection

Drop Redundant Bit and

Accept Data

Reject DataEven

Count Number of ‘1’ s in Received Data

Yes

No

Request Re -Transmission

Odd

• In Even parity Concept

• In Odd parity Concept

Page 14: Parity check(Error Detecting Codes)

14

1 1 0 0 1 0 0 0 1

1 0 1 0 1 1 0 1 1

Drawbacks of Single Parity Check

• Only can detect single bit errors ; Single bit errors are rare.

• Can not detect errors, if 2 bits are interchanged.

1 0 1 0 1 1 0 1 1

1 1 1 0 1 0 0 1 15+1=6 5+1=6

5+1=6 3+1=4

Page 15: Parity check(Error Detecting Codes)

15

Two Dimensional Parity Check(LRC)Longitudinal Redundancy Check

• In two-dimensional parity check, a block of bits is divided into rows and a redundant row of bits is added to the whole block.

• Even Parity Concept

Page 16: Parity check(Error Detecting Codes)

16

Two Dimensional Parity check(Cont.)Parity Generation

• A block of bits is organized in a table (rows & columns) a parity bit is calculated for each row and column.

• Compute (m + n + 1) parity bits and send (mn + m + n + 1) bits1) Adds a parity bit to each character then adds a row of parity bits after a

block of characters 2) The row of parity bits is actually a parity bit for each “column” of characters3) The row of parity bits plus the column parity bits add a great amount of

redundancy to a block of characters• Lets see this with an example:

Page 17: Parity check(Error Detecting Codes)

17

Two Dimensional Parity GenerationEven Parity Concept

1100111 10111010111001 01010011 1 0 0

1 1 11 0 1 1

1 0 10 1 1 1

0 0 10 1 0 1

0 0 1

Original Data

1100111 1011101 01110010101001

Row Parity

No ‘1’s : 5

No ‘1’s : 5

No ‘1’s : 4

No ‘1’s : 3

No ‘1’s : 3

1

1

1

0

1

1 0 1

0 1 0 1 0 1 0 1

10101010Column Parity

This will Send

Page 18: Parity check(Error Detecting Codes)

18

Drawbacks of 2D Parity Check• 4- and more bit errors can be detected in some cases

• 1 affect 2 , 2 affect 3, 3 affect 4, 4 affect 4 – so Can not detect in this case

• Disadvantage: too many check bits !!!• Can not detect errors, if 2 bits in one data unit are changed and 2 bits

in exactly the same position in another data unit is changed.

Page 19: Parity check(Error Detecting Codes)

19

Drawbacks

• Both simple parity and 2D parity do not catch all the errors.• Simple parity only catches odd numbers of bit

errors, and can not catch if 2 bits interchanged.• 2D parity is better at catching errors, but requires

too many check bits added to a block of data.• Can not use in 4 bit errors and more bit errors in some cases.

Page 20: Parity check(Error Detecting Codes)

20

Summary• Parity checking is a means of checking if the communication of a sequence of

bits has been correctly received. • Parity bit is an extra bit that is attached to the data bits/Signal that is being

transferred from one location to another.• The two types of most commonly used parity checking are:

Single Parity Check 2D Parity Check• odd parity• even parity

• Single Parity bit checking can detect single error only, double errors will not be detected. Even the 2D parity is not efficient and can not use in some cases.

Page 21: Parity check(Error Detecting Codes)

21

Thank You!

The end.


Recommended