
Error correction codes. Software implementation options
Immediately I ask you not to “kick off”, I tried, and this can be useful for students like me.
Error correction codes.
There are many codes that correct errors in binary code. This is very useful because a lot of information goes bad while storing or transmitting information. One example of these codes is the “Hamming code” (Another author already wrote about it in detail http://habrahabr.ru/post/140611/ ). They add additional, code bits to the binary text, with which we can correct the errors received.
Each such code has two characteristics - k and n. Such a code is called an (n, k) code. Here, “n” indicates the total number of characters in a block of encoded text, and “k” is the number of significant characters.
For example, the simplest code is repetition code. In this code, n-1 code bits are added to each character of the binary code, which duplicate a significant character, and as a result we can correct the error. For example, the (3,1) -code appends to each character in the binary system two of the same ones and when noisy, if one character from a block changes, then 2 remain the same and from them we return the original character.
Project Description
In my program, we used 2 types of such codes, this is a (3,1) -code with repetition and (7,4) -code, which is one of the so-called "Hamming codes". However, my program is written so that you can add any other type code (n, k) to it without much effort and time.
In order to achieve my goal, I needed to translate plain text into binary, then add code bits to help me recover the text. And in order to emit errors in the binary code, I wrote a procedure that makes the text noisy (making errors in the binary code).
Then I translated the noisy code into plain text to demonstrate to the user the effectiveness of the noise. By the next step, I corrected the remaining noisy code and translated it into plain text.
To create my program I used Pascal help, my own knowledge and the “great” Google.com.
Conclusions and perspectives.
I created a program that implements two codes for correcting errors in the text obtained during the transfer or long-term storage of a file with information. He also improved his skills in the Pascal programming language.
Source code
I apologize for the "Jewish code" and for turbo pascal too (a normal computer broke down, wrote on the second pentium). The code can help students in computer science classes and olympiads.