Hamming Code

What it is and how it works

Information on Hamming code

  • It is a character coding scheme
  • It checks for binary errors
  • Created by Richard Hamming
  • Uses parity system to spot errors
  • Errors include 0 changing to 1 and 1 changing to 0
  • It self corrects errors
  • Parities are on bits which are a power of 2
  • These include: 1,2,4,8,16
  • Pattern is used to see how many blanks there are
  • The pattern is n-1

ASCII W 1010111

Bit Position 11 10 9 8 7 6 5 4 3 2 1

Data or Parity? D D D P4 D D D P3 D P2 P1

Data 1 0 1 0 1 1 1

P1 1 1 0 1 1 0

P2 1 0 0 1 1 1

P3 0 1 1 0

P4 1 0 1 0

Code with parity bits 1 0 1 0 0 1 1 0 1 1 0

Correct

ASCII & 0100110

Bit Position 11 10 9 8 7 6 5 4 3 2 1

Data or Parity? D D D P4 D D D P3 D P2 P1

Data 0 1 0 0 1 1 0

P1 0 0 0 1 0 1

P2 0 1 0 1 0 0

P3 0 1 1 0

P4 0 1 0 1

Code with parity bits 0 1 0 1 0 1 1 0 0 0 1

Well done

Bit Position 11 10 9 8 7 6 5 4 3 2 1

Data or Parity? D D D P4 D D D P3 D P2 P1

Data 1 1 1 1 0 1 1 1 1 1 1

P1 1 1 0 1 1 1

P2 1 1 0 1 1 1

P3 0 1 1 1

P4 1 1 1 1

Correct data 1 1 1 1 1 1 1 1 1 1 1

Original data 1 1 1 1 1 1 1

Well done