Hamming Code for Error Detection and Correction

Exploit

With the increase in data transmission and exchange between multiple network devices for information purposes. The probability of an error or damage occurring to the original data bit is highly possible to overcome the situation, we use certain networking techniques to detect and correct the damage to the data. I’ll be writing on this topic.

What is hamming code?

The hemming code method is a network technology that is designed to detect errors and correct data bits which are transmitted during data exchange. It was first implemented by row hamming hence the name hamming code this networking technique is implemented because during data transmission there are often cases where data loss or data damage occurs to recover or detect the damage in the original data we use hamming code.

Terms of working hamming chord

Some terms are related to the working of a hamming chord. the first one is redundant bits are the extra binary bits that are added explicitly to the original data bit to prevent damage to the transmitted data and also to recover the original data in case of damage at the receiver end in the next point we will look into some formula related to redundant bits.

Redundant bits

The formula related to redundant bits to 2r more than equal to m plus r plus 1wherem refers to the data bits in the data and r refers to the redundant bits.

Example

Let’s take an example in case m is equal to 4 which means the data bits used are 4we need to find the value of using the above formula. Let’s deduce the value of redundant bits2r is more than equal to4 plus r plus 12 to the power rise more than equal tor plus 5so using this let’s user equal to 0. If we use that we will get a value of 1 that is more than equal to plus 5. But that is wrong then using r equal to 3 that is 8 is more than equal to this way we conclude that the hamming code would be 7-bit data because the value of r is 3 and m is 4.

Terms related to harming code

Now let’s move on to the next term related to hamming code. Which is parity bits the parity bit is a method to append binary bits to secure that the total number of counts of 1 in the original data is either an even number or an odd number.

Why do we use parity bits?

Let’s move on to why we exactly use parity bits. They are used to detect an error in the original data. This occurs during the transmission of data through this method. We can detect the error at the receiver end and also correct it. 

Different types of parity bits

Now I will write at different types of parity bits available. The first one is seven parity bits in this case of parity type the total number of ones counted is to be even in the count in case the count is odd then the value of parity is otherwise the value should be 0. similarly, the other parity bit is known as an odd parity bit for this parity bit the total number of ones counted in the original data should be odd if that is the case the value of parity bit should be zero and in case the value of once in the original data comes out to be odd then the parity value would be 1.

A working example of the hamming code

Now let’s move on to the next setting which is the working example of the hamming code. Let’s begin with the steps to be followed to solve a hamming code issue. The first point is the position of the parity bit is determined using 2 to the power n term where n represents the number series 0to assigning the position for the parity bit using this method would be more clear during an example for the second point. We have the remaining positions represent the data bit.

Value of parity

Now let’s try using the value of the parity bit for n is equal to 0 which means 2 to the power0 is equal to 1. So all the bits with one in the last position are used to determine the value of the parity bit to better understand the assignment value of the parity bit. Please focus on this mentioned table in this table we can take a look at the last position that n is equal to 0and see the mentioned number for p1. We can use a value of 1 because n is equal to 0 and the last position value is 1 then the number 3. Because the last position bit is 1then similarly for number 5 because n is equal to 0 and the bit value is 1. so these three parity values can be used from is equal to 0. Similarly, let’s take a look when the nis equal to 1that means 2 to the power 1 is equal to 2. So all the bits with 1 in the second position are used to determine the value of the parity bit.

Numbers related to the parity bit value

Now let’s move to the table to identify the numbers related to this parity bit value. The first one is 2 due to the presence of one bit in the second position then. We have the presence of one bit in the second position. Similarly, the next would be number six due to the presence of one bit in the second position. Similarly, let’s take a look at when n is equal to 2 which means 2 to the power2 is equal to 4 so all the bits with 1. The third position is used to determine the value of parity bit and this would be45 and 6 numbers. Please read the points very carefully because next, we will solve an example to clarify all the concepts better.

Hamming code method example

Let’s move on to the given example the data bit to be transmitted is one zero one. And we have to solve this using the hamming code methods. The first step would be applying the hamming code method and identifying the given number of data bits which would be 4 according to the question. So the number of parity bits would be where the value would be1 2 and 4 according to the part of the p expression which means we will get something similar to this representation in bit format. Where the first position is for p1parity bitt the second for 2 to the power 1 that is 2p2. And the third one is for 2 to the power4 that is p 4 parity and let’s put the value that is to be transmitted in the remaining positions that would be p 1 p 2 1p 4 1 0 and 1. Using this bit value we will reduce the value of p1 p2 and p4 for data transmission.

In this case, we are using even parity for the example which means the number of ones should be even let’s take a look at p1 we haved1 d3 d5 and d7as mentioned in the earlier slide so the value would be p1 comma 1comma 1 and comma 1. According to the data bits available to us by the question that means the value would be 1 because the number of ones for p1 is odd. So to make it even the value of p1 would be1, similarly, for p2 we have d2 d3 d6, and d7 using the same method we will get p2 10 1. So the number of ones for p2 is even so the p2 value would be 0next is for p4 the value is d4 d5 d6 and where p4 has 1 0 and 1 that means the number of ones is even so again p4 is equal to zero now using this we get the new bit that is to be transmitted that is one zero one 0 1/ After transmission in case let’s say at position 5 an error occurs and the value of 1 is converted to 0. To detect this error at the receiver side. We will use the hamming code, to begin with, we will use the parity value to cross-check the original data which means let’s do the parity bit method for this received data so for p1 we haved1d3d5 and d7so the number of ones is odd that means the value of p1 should be 1 to make it even then for p2 we haved2d3d6 and d7. So the number of ones is even that means the p2 value would be 0. Now let’s move on to p4 which would be 4d 5d 6d and d7 number of ones is 1that means odd so the value of p4 would be one.

Conclusion

Now let’s take look at the results that we obtained using this method for most this shows that the data transmitted is damaged and we can detect the error position using this method that is using the value of parity bits obtained where this will lead to 2 to the power expression that means 2 to the power 0 plus 0 plus 2 to the power 2 that means5.that matches with the assumption we too know to correct this error we can use the position that we obtained that is 5and replace the zeroth value with one bit by doing this we will obtain the original data with this we have completed all the topics to understand the hamming code method. 

2 Comments

Leave a Reply

Your email address will not be published.


*