0% found this document useful (0 votes)
167 views

Hamming Code

Hamming codes are error-correcting codes that allow for the detection and correction of errors in binary data transmission or storage. They work by adding redundant binary digits known as check bits that are calculated from the original data bits using an algorithm. This allows the detection and location of single-bit errors, and correction of single-bit errors. The example demonstrates how to calculate check bits for three sample codes, detect an error by comparing check bits, and locate the position of the error using the check bit algorithm.

Uploaded by

sunil8080
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
167 views

Hamming Code

Hamming codes are error-correcting codes that allow for the detection and correction of errors in binary data transmission or storage. They work by adding redundant binary digits known as check bits that are calculated from the original data bits using an algorithm. This allows the detection and location of single-bit errors, and correction of single-bit errors. The example demonstrates how to calculate check bits for three sample codes, detect an error by comparing check bits, and locate the position of the error using the check bit algorithm.

Uploaded by

sunil8080
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Hamming Code

Error Correcting Code Hamming Codes are used in detecting and correcting a code. An error-correcting code is an algorithm for expressing a sequence of numbers such that any errors which are introduced can be detected and corrected (within certain limitations) based on the remaining numbers. Errors can happen in a variety of ways. Bits can be added, deleted, or flipped. Errors can happen in fixed or variable codes. Error-correcting codes are used in CD players, high speed modems, and cellular phones. Error detection is much simpler than error correction. For example, one or more "check" digits are commonly embedded in credit card numbers in order to detect mistakes. The example below shows how to detect and correct an error in a code. Rules 1. Must send the original data (Di) and the check bits (Cj ). 2. Number the positions in binary starting at one, and position the check bits (Cj ) at the power of two. 3. Calculated the check bits by taking the exclusive-or of all the data bits whose address contains one in the same place as the check bit

Address Code

0 0 1 C0

0 1 0 C1

0 1 1 D1

1 0 0 C2

1 0 1 D2

1 1 0 D3

1 1 1 D4

C0 = D1 xor D2 xor D4 C1 = D1 xor D3 xor D4 C2 = D2 xor D3 xor D4

Example
You are given three different codes 101, 110 and 001 figures out the check bits for the codes.

Code 101 Address Code D1 = 1 D2 = 0 D3 = 1 Address Code 0 0 1 C0 0 1 0 C1 0 1 1 1 1 0 0 C2 1 0 1 0 1 1 0 1 0 0 1 C0 0 1 0 C1 0 1 1 D1 1 0 0 C2 1 0 1 D2 1 1 0 D3

C0 = 1 xor 0 = 1 C1 = 1 xor 1 = 0 C2 = 0 xor 1 = 1 Address Code 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1

__________________________________________ Code 110 D1 = 1 D2 = 1 D3 = 0 0 0 1 C0 0 1 0 C1 0 1 1 1 1 0 0 C2 1 0 1 1 1 1 0 0

Address Code

C0 = 1 xor 1 = 0 C1 = 1 xor 0 = 1 C2 = 1 xor 0 = 1

Address Code

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

______________________________________________ Code 100 D1 = 1 D2 = 0 D3 = 0 0 0 1 C0 0 1 0 C1 0 1 1 1 1 0 0 C2 1 0 1 0 1 1 0 0

Address Code

C0 = 1 xor 0 = 1 C1 = 1 xor 0 = 1 C2 = 0 xor 0 = 0 Address Code 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1

Now, assume an error happens at the first code 110 that the bit in position 5 is toggled. Find it by getting its address. correct code is 101101 after being toggled 101111

Address Code

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 1

1 1 0 1

A0 = C0 xor D1 xor D2 = 1 xor 1 xor 1 = 1 A1 = C1 xor D1 xor D3 = 0 xor 1 xor 1 = 0 A2 = C3 xor D2 xor D3 = 1 xor 1 xor 1 = 1 A2 A1 A0 = 101 = 5 where the error happen.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy