Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 575
Nikhil Avatar asked Mar 23 '13 19:03

Nikhil


People also ask

What is parity how it is calculated?

The value of the parity bit is calculated by performing a logical exclusive OR (XOR) that combines all of the bits in the byte. This calculation is often peformed in hardware by the UART, as a part of the transmission function.

What is the parity bit for 1001011?

It is simpler to count the number of 1s and make them even by adding a 0 or a 1. Here the number of ones in given data unit is 4. So, the parity bit 0 and codeword is 01001011. Therefore, the parity bit for 1001011 is 0.

How many parity bits are required for 10101?

The data 10101 is given the even parity bit of 1, resulting in the bit sequence 101011. This data is transferred to another computer.

What is parity bit with example?

For example, if the letter a (binary 1100001) is transmitted under even parity, the sending system adds the number of binary 1s, which in this case is three, and makes the parity bit a 1 to maintain an even number of binary 1s.


2 Answers

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.

like image 57
Deepu Avatar answered Sep 18 '22 12:09

Deepu


You can also use XOR i.e; 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 should make this bit the LSB of the original number (00111011) thereby becoming (001110111).

like image 31
Kamalnice4206829 Avatar answered Sep 18 '22 12:09

Kamalnice4206829