In: Computer Science
For Networks -> Please show me how to do the following:
a.) Calculate the parity of a signal.
b.) Calculate the parity of a signal using interleaving.
A parity bit is a single bit that can be appended to a binary string.It is either set to 1 or 0 to make the total number of 1 bits either even or odd.The purpose for doing this is to provide a simple way for detecting and correcting errors in the received signal.All bit positions that are power of 2 are marked as parity bits in a signal.For example bit positions at(1,2,4,8etc) are marked as parity bits.The value of this parity bits is calculated by alternative check and skip concept.For example for calculating the value of parity bit at position 1 it checks one data bit and skips one then checks another one and then skips one and so on.For calculating the parity bit at position 2 we check first two data bits and skip next two data bits then we again check another two data bits and then skip next two and so on.
Question: A 7 bit hamming code is received as 1011011.Assume even parity and state whether the received code is correct or wrong?Assume even parity.
Answer: d7 d6 d5 d4 d3 d2 d1=1 0 1 1 0 1 1.
In a 7 bit signal there can be only 3 parity bits i.e p1,p2 and p4.
value of p1 =1 as d1 d3 d5 d7= 1 0 1 1 ( odd no of 1’s)
value of p2 =0 as d2 d3 d6 d7= 1 0 0 1 (even no of 1’s)
value of p4=1 as d4 d5 d6 d7= 1 1 0 1 ( odd no of 1’s)
So there is an error in the signal
and error position is decimal value of p1 p2 p4=1 0 1 which is 5.So error is in the 5 th bit position of the signal.