tanszek:oktatas:techcomm:error_detection_and_correction
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tanszek:oktatas:techcomm:error_detection_and_correction [2024/10/06 18:36] – [Example] knehez | tanszek:oktatas:techcomm:error_detection_and_correction [2024/11/12 07:33] (current) – [How Hamming Codes Work] knehez | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Elias-style block protection ===== | ||
+ | |||
+ | Elias-style block protection uses horizontal and vertical control bits. It should be used if the protected data can be written in matrix form. During the decoding process, the logical values of the equations are examined both individually and combined. | ||
+ | |||
+ | **Example** | ||
+ | |||
+ | A binary data which is stored in a 3x3 matrix is given: **101011001** | ||
+ | |||
+ | Let's write it down in matrix form and attach parity bits, too. | ||
+ | |||
+ | | 1 | 0 | 1 | **0** | | ||
+ | | 0 | 1 | 1 | **0** | | ||
+ | | 0 | 0 | 1 | **1** | | ||
+ | | **1** | **1** | **1** | **1** | | ||
+ | |||
+ | Let's suppose that the first bit was wrong during transmission, | ||
+ | |||
+ | | 1-> | ||
+ | | 0 | 1 | 1 | **0** | | ||
+ | | 0 | 0 | 1 | **1** | | ||
+ | | **1** -> **0** | **1** | **1** | **1** -> **0** | | ||
+ | |||
+ | |||
+ | |||
+ | |||
===== Error Detection and Correction Using Hamming Codes ===== | ===== Error Detection and Correction Using Hamming Codes ===== | ||
Line 7: | Line 32: | ||
$$ n = m + r $$ | $$ n = m + r $$ | ||
- | If two code-words are given, for example : **0101110** and **001111110** and the only difference between them is 1 bit, then the ' | + | If two code-words are given, for example : **0101110** and **0111110** and the only difference between them is 1 bit, then the ' |
The **Hamming-style** correction code supposed to increase the number of parity bits. To correct single bit errors we have to use **k** number of parity bits using this formula: | The **Hamming-style** correction code supposed to increase the number of parity bits. To correct single bit errors we have to use **k** number of parity bits using this formula: | ||
Line 31: | Line 56: | ||
For example, in an 11-bit data block, we might have 4 parity bits, making it a 15-bit Hamming code. | For example, in an 11-bit data block, we might have 4 parity bits, making it a 15-bit Hamming code. | ||
- | * Detecting Errors: After transmission, | + | |
- | * Correcting Errors: If a single-bit error is detected, the Hamming code identifies which bit is incorrect (from the parity bits' positions) and corrects it by flipping the bit. | + | |
==== Example ==== | ==== Example ==== | ||
Line 43: | Line 68: | ||
< | < | ||
Filling in the data **1010**: | Filling in the data **1010**: | ||
- | < | + | < |
**Calculating Parity Bits**: We calculate the parity bits such that each one covers a specific set of positions: | **Calculating Parity Bits**: We calculate the parity bits such that each one covers a specific set of positions: | ||
* p1 covers bit positions: 1, 3, 5, 7 | * p1 covers bit positions: 1, 3, 5, 7 | ||
Line 77: | Line 102: | ||
Thus, the final transmitted Hamming code is: | Thus, the final transmitted Hamming code is: | ||
< | < | ||
+ | |||
+ | Let's suppose that because of an error the 3rd bit goes wrong. In this case **p1** and **p2** will be wrong. Because of the **3rd** bit the first and second parity bit will give us wrong values, but the others will not because they do not calculate with the bit standing at the **3rd** place. | ||
+ | |||
+ | The common values of the first and second parity bits are the following: 1, 2, 3, 5, 6, 7. The defective one has to be among these. | ||
+ | |||
+ | However from 5, 6, 7 are included in the good parity bits -> therefore the wrong parity bit is the **3rd** one. (note that: 1, 2 cannot be wrong in this case. If 1 was wrong, only the **p1** parity bit would be wrong.) | ||
+ |
tanszek/oktatas/techcomm/error_detection_and_correction.1728239787.txt.gz · Last modified: 2024/10/06 18:36 by knehez