But remember since we are checking for P2, so we have to start our count from P2 (P1 should not be considered).Īs we can observe that the number of 1's are even, then we will write the value of P2 = 0. Step 2: Check for P2 but while checking for P2, we will use check two and skip two method, which will give us the following data bits. Step 1: For checking parity bit P1, use check one and skip one method, which means, starting from P1 and then skip P2, take D3 then skip P4 then take D5, and then skip D6 and take D7, this way we will have the following bits,Īs we can observe the total number of bits are odd so we will write the value of parity bit as P1 = 1. The following image will help in visualizing the received hamming code of 7 bits.įirst, we need to detect whether there are any errors in this received hamming code. Hamming Code in Computer Network For Error DetectionĪs we go through the example, the first step is to identify the bit position of the data & all the bit positions which are powers of 2 are marked as parity bits (e.g. While checking the parity, if the total number of 1's are odd then write the value of parity bit P1(or P2 etc.) as 1 (which means the error is there ) and if it is even then the value of parity bit is 0 (which means no error). To proceed further we need to know about parity bit, which is a bit appended to the data bits which ensures that the total number of 1's are even (even parity) or odd (odd parity). We use the formula, 2r >= m+r+1 where r = redundant bit & m = data bit.įrom the formula we can make out that there are 4 data bits and 3 redundancy bits, referring to the received 7-bit hamming code. Now the question arises, how do we determine the number of redundant bits to be added? All this is done to ensure that the data bits don't get damaged and if they do, we can recover them. The redundant bits are some extra binary bits that are not part of the original data, but they are generated & added to the original data bit. Let's say you have received a 7-bit Hamming code which is 1011011.įirst, let us talk about the redundant bits. Let's understand the Hamming code concept with an example: Whenever a data packet is transmitted over a network, there are possibilities that the data bits may get lost or damaged during transmission. The hamming code technique, which is an error-detection and error-correction technique, was proposed by R.W.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |