Вы находитесь на странице: 1из 8

Even/odd parity (1)

Computers can sometimes make errors when they transmit data. Even/odd parity:

is basic method for detecting if an odd number of bits has been switched by accident. he number of 1!bit must add up to an odd number he number of 1!bit must add up to an even number

Odd parity:

Even parity:

Even/odd parity (")


he computer knows which parity it is using #f it uses an even parity: #f the number of of 1!bit add up to an odd number then it knows there was an error: #f it uses an odd: #f the number of of 1!bit add up to an even number then it knows there was an error: $owever% #f an even number of 1!bit is f&ipped the parity wi&& sti&& be the same. 'ut an error occurs he even/parity can(t this detect this error:

Even/odd parity ())

#t is usefu& when an odd number of 1!bits is f&ipped. *uppose we have an +!bit binary word (+!digits). #f you need to change the parity you need to add 1 (parity bit) to the binary word. ,ou now have - digit word. $owever% the computer knows that the added bit is a parity bit and therefore ignore it.

E.amp&e (1)

*uppose you receive a binary bit word /01011 and you know you are using an odd parity. #s the binary word errored2 he answer is yes:

here are " 1!bit% which is an even number 3e are using an odd parity *o there must have an error.

4arity 'it

5 sing&e bit is appended to each data chunk

makes the number of 1 bits even/odd 1000000(1) 1111101(0) 1001001(1) 1000000(0) 1111101(1) 1001001(0)

E.amp&e: even parity


E.amp&e: odd parity


4arity Checking

5ssume we are using even parity with +!bit 5*C##. he &etter 6 in +!bit 5*C## is encoded as 0110101. $ow wi&& the &etter 6 be transmitted2

'ecause there are four 1s (an even number)% parity is set to 7ero. his wou&d be transmitted as: 01101010. he &etter 6 wi&& be transmitted as 01101011

#f we are using an odd parity:

E.ercise 1

*uppose you are using an odd parity. 3hat shou&d the binary word /10101 &ook &ike after you add the parity bit2 5nswer:

here is an even number of 1!bits. *o we need to add another 1!bit Our new word wi&& &ook &ike /101011.

E.ercise "

*uppose you are using an even parity. 3hat shou&d the binary word /10101 &ook &ike after you add a parity bit2 5nswer:

here is an even number of 1(s. *o we need to add another 0 Our new word wi&& &ook &ike /101001.

Вам также может понравиться