How to calculate the parity bit of the following bit sequence?

Sequence:

00111011

How to calculate the parity bit for the above sequence? This question is from the Database. Complete Book by Jeffery ullman ( Exercise 13.4.1 a )

I am not sure what the answer to this question should be.

It's simple:

i) Even parity: the number 1s is 5 (odd), so just add 1 and the answer will be: 001110111

ii) Odd Parity: Similarly, just add 0: 001110110

OR

am i on a completely wrong path here? I looked into the grid, but could not find anything specific. In addition, the text for the above question in the textbook is not clear.

+4
source share
3 answers

Yes, your answers are correct. For a given sequence

00111011

The odd parity is 001110110 , the parity bit is zero, so the total number 1 in the code is 5, which is an odd number.

Even parity is 001110111 , the parity bit is one, so that the total number 1 in the code is 6, which is an even number.

+9
source

You can also use XOR ie; 00111011

0XOR0=0 0XOR0=0 0XOR1=1 1XOR1=0 0XOR1=1 1XOR0=1 1XOR1=0 0XOR1=1 

the last bit is the parity bit; 1 for even parity, 0 for odd parity. you must make this LSB bit of the original number (00111011), thereby becoming (001110111).

+1
source
 unsigned char CalEvenParity(unsigned char data) { unsigned char parity=0; while(data){ parity^=(data &1); data>>=1; } return (parity); } 
0
source

All Articles