12
Parity Generator and Checker

Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Embed Size (px)

Citation preview

Page 1: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Parity Generator and Checker

Page 2: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Parity bit

• A parity bit is a bit that is added to

ensure that the number of bits with the

value one in a set of bits is even or odd.

• Parity bits are used as the simplest form

of error detecting code.

Page 3: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Parity bit

Page 4: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Types of parity bit

• There are two variants of parity bits

• Even parity bit 

• Odd parity bit

Page 5: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Even parity

• When using even parity, the parity bit is set to 1 if

the number of ones in a given set of bits (not

including the parity bit) is odd, making the entire

set of bits (including the parity bit) even.

• Example of even parity is 00000000, 11010001

Page 6: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Odd parity bit

• When using odd parity, the parity bit is set to 1

if the number of ones in a given set of bits (not

including the parity bit) is even, keeping the

entire set of bits (including the parity bit) odd.

• Example of Odd parity is 10000000, 01010001

Page 7: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Odd and Even parity

• An even parity bit will be set to "1" if the

number of 1's + 1 is even

• An odd parity bit will be set to "1" if the

number of 1's +1 is odd.

Page 8: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Parity bit table7 bits of data

(number of 1s)

8 bits including parity bit

Even Odd

0000000 (0) 00000000 10000000

1010001 (3) 11010001 01010001

1101001 (4) 01101001 11101001

1111111 (7) 11111111 01111111

Page 9: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Parity generator and checkers

Sender Receiver

n-bit code Parity

Generator

(n+1)-bit code Parity

CheckerError

Page 10: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

XY

Z P

XY

ZE

P

Even parity generator and checker for 3-bit codes

Page 11: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

Solution

• Use 3-bit odd function to generate even parity

bit

• Use 4-bit odd function to check for errors in

even parity codes

• Operation: (X,Y,Z) = (0,0,1) gives (X,Y,Z,P) =

(0,0,1,1) and E = 0

• If Y changes from 0 to 1 between generator

and checker, then E = 1 indicates an error

Page 12: Parity Generator and Checker. Parity bit A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is

The End

….. Thank you….