network-programmingparityhamming-code

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


The sequence is:

00111011

How do i calculate the parity bit for the above sequence? This question is from Databases- The complete book by jeffery ullman (Exercise 13.4.1 a)

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

Is it as simple as :

i)Even Parity : the number of 1s is 5 (odd) so just append a 1 and the answer is : 001110111

ii)Odd Parity: likewise , just append 0: 001110110

OR:

am i on a totally wrong path here? I looked up on the net but could not find anything concrete . Also, the text for the above question in the text book is not clear.


Solution

  • Yes, your answers are correct. For the given sequence,

    00111011

    Odd Parity is 001110110, the parity bit is zero so that the total number of 1's in the code is 5, which is an Odd number.

    The Even Parity is 001110111, the parity bit is one so that the total number of 1's in the code is 6, which is an Even number.