Question

In: Computer Science

Differentiate between parity code and hamming code with examples

Differentiate between parity code and hamming code with examples

Solutions

Expert Solution

When we transmit data over a channel it is always susceptible to getting changed due to noise. So we need some method that can help us to detect these changes in bits.

Here comes in the Parity codes. Here we place an extra bit at the end of each data stream. This bit can be a 1 or a 0. We can work with an even parity or an odd parity. The parity here means the no. of one's. If after adding the parity bit we want no. of 1's to be even then it is called even parity else it is called odd parity. The sender and the receiver both know the type of parity used for the transmission. If there is a change in the parity then the receiver will know that there is an error. But there is no method to find out where the error is, also if there is an error in an even no. of bits then the error will go undetected. For this, we can use 2d parities, but still, there are cases where the errors may get undetected.

Eg. of an even parity:-

The data string:- 01101101.

The total message with even parity that will be transmitted 011011011.

for Odd parity, the message would have been 011011010.

Now Hamming codes are a combination of parity bits which can help us to detect which bits got flipped & then we can correct them. Hamming codes are a family of linear error-correcting codes. They can detect up to 2-bit errors or correct 1-bit errors. In the hamming code, we place some redundant bits for the purpose of detecting errors.

For a 7 bit no. there will be 4 redundant bits which give a total of 11 bits message.

Let the message be 1011001.

11 10 9 8 7 6 5 4 3 2 1
D7 D6 D5 R8 D4 D3 D2 R4 D1 R2 R1

The first line represents the bits locations, the R shows the redundant terms. Now we already know the data bits, we only need to determine the parity bits.

R1 will check the parity with all those bits whose positions binary representation includes a 1 in LSB. Here, 1, 3, 5, 7, 9, 11

R2 will check the parity with all those bits whose positions binary representation includes a 1 in the second position from the LSB. Here, 2, 3, 6, 7, 10, 11

R4 will check the parity with all those bits whose positions binary representation includes a 1 in the third position from the LSB. Here, 4-7.

R8 will check the parity with all those bits whose positions binary representation includes a 1 in the fourth position from the LSB. Here, 8-15

For even parity the bits will

R1 = 0; R2 = 1; R4 = 1; R8 = 0.

So the data to be transferred will be 10101001110.

Now similarly the receiver can check the parity in same manner and check for errors.

Hope this helps. If you have any queries or suggestions regarding the answers please leave them in the comments section so I can update and improve the answer. Thank you.


Related Solutions

Construct an even parity Hamming code for 1101010
Construct an even parity Hamming code for 1101010
The data to be sent : 11011100110, how to create the Hamming code with even parity?...
The data to be sent : 11011100110, how to create the Hamming code with even parity? If the right most bit is changed due to noise during transmission, how does the receiver to correct the incorrect bit. Assume only one bit is altered during transmission.  
Construct an even parity Hamming code with a total of 7 bits (4 data bits and...
Construct an even parity Hamming code with a total of 7 bits (4 data bits and 3 check bits).
Construct a generator matrix and a parity check matrix for a ternary Hamming code Ham(2, 3)....
Construct a generator matrix and a parity check matrix for a ternary Hamming code Ham(2, 3). Assume a codeword x from for the ternary Hamming code Ham(2, 3)$ was sent and the word y was received. Use the partiy check matrix you constructed in part (a) to decode y in each part using syndrome decoding: (b) y = ( 1 , 1 , 1 , 0 ), (c) y = ( 2 , 2 , 2 , 2 ), (d)...
write and explain two dimensional parity check code and hamming codes in simple way please
write and explain two dimensional parity check code and hamming codes in simple way please
Given the data-bits m = 11010110, determine the number of k (parity-bits) by using Hamming Code...
Given the data-bits m = 11010110, determine the number of k (parity-bits) by using Hamming Code requirements. Illustrate the error detection and correction scheme using Hamming code method, for both the sender and receiver to detect an error at the following positions: a.6thbit position. b.11thbit position.Assume an odd-parity scheme for this problem.
Given the data-bits m = 11010110, determine the number of k (parity-bits) by using Hamming Code...
Given the data-bits m = 11010110, determine the number of k (parity-bits) by using Hamming Code requirements. Illustrate the error detection and correction scheme using Hamming code method, for both the sender and receiver to detect an error at the following positions: a. 6th bit position. b. 11th bit position. Assume an odd-parity scheme for this problem.
Given the 21-bit even-parity Hamming code: 0 1010 0111 0011 0000 0101 and assuming there is...
Given the 21-bit even-parity Hamming code: 0 1010 0111 0011 0000 0101 and assuming there is one incorrect bit. a. Which bit is incorrect? My educated guess for what the incorrect bit maybe has me thinking it is the '1' bit at the end of the '0111' byte, but I have no full proof as to why it is that specific bit. Am I in the right area to think that? b. After the error is corrected, what decimal number...
1. Differentiate between the insurance of indemnity and compensation 2. With vivid examples, differentiate between a...
1. Differentiate between the insurance of indemnity and compensation 2. With vivid examples, differentiate between a debtor and a creditor as it affects the mortgage. 3. Discuss the meaning of Bankruptcy a. What are the types of bankruptcy b. In Canada, what type of court handles bankruptcy matters and why
I'm trying to code in MIPS (MIPS Assembly Language) to calculate the hamming distance between two...
I'm trying to code in MIPS (MIPS Assembly Language) to calculate the hamming distance between two integers. Ideally, the program would ask for the user to type in the two integers. Then, the program would calculate the hamming distance. Afterward, it would ask if you'd like to find another hamming distance. If the user says yes, it would loop back to the beginning and ask for two new integers. Below is the code that I've created so far. Guidance with...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT