Tuesday, November 13, 2012

How to Calculate the Hamming Code



  • How to Calculate the Hamming Code


Hamming codes are used to insert error correction information into data streams. The codes are designed so that an error can not only be detected, but corrected. Adding error correction information increases the amount of data, but increases the reliability of communications over mediums with high error rates

http://www.ehow.com/how_6635076_calculate-hamming-code.html#ixzz2C7sLUvXH



  • Hamming Distance

Hamming distance of two bit strings = number of bit positions in which they differ
If the valid words of a code have minimum Hamming distance D, then D-1 bit errors can be detected.
If the valid words of a code have minimum Hamming distance D, then [(D-1)/2] bit errors can be corrected.



  • The Hamming Distance is a number used to denote the difference between two binary strings.

Hamming's formulas allow computers to detect and correct error on their own.
The Hamming Code earned Richard Hamming the Eduard Rheim Award of Achievement in Technology in 1996, two years before his death
Hamming's additions to information technology have been used in such innovations as modems and compact discs.

Step 1
Ensure the two strings are of equal length. The Hamming distance can only be calculated between two strings of equal length. String 1: "1001 0010 1101" String 2: "1010 0010 0010"
Step 2
Compare the first two bits in each string. If they are the same, record a "0" for that bit. If they are different, record a "1" for that bit. In this case, the first bit of both strings is "1," so record a "0" for the first bit.
Step 3
Compare each bit in succession and record either "1" or "0" as appropriate. String 1: "1001 0010 1101" String 2: "1010 0010 0010" Record: "0011 0000 1111"
Step 4
Add all the ones and zeros in the record together to obtain the Hamming distance. Hamming distance = 0+0+1+1+0+0+0+0+1+1+1+1 = 6

http://classroom.synonym.com/calculate-hamming-distance-2656.html




  • The Hamming Distance can be used to correct or detect errors in a transmission.

If there are d errors, you need a Hamming Distance of 2d+1 to correct or d+1 to detect.

Hamming distance between two vectors is the number of bits we must change to change one into the other.
Example Find the distance between the vectors 01101010 and 11011011.

01101010
11011011

They differ in four places, so the Hamming distance d(01101010; 11011011) = 4.

http://www.math.ryerson.ca/~danziger/professor/MTH108/Handouts/codes.pdf


  • Shortcut for hamming code
http://www.youtube.com/watch?v=JAMLuxdHH8o

No comments:

Post a Comment