## 2 Materials and Methods
#### 2.2.2 Analysis of the Theoretical Foundations of the Hamming Code by the General Method  
Hamming codes are an important class of block codes characterized by the following structure [24]:  
\[(n,m)=\left(2^{i}-1,\ 2^{i}-1-i\right), \tag{6}\]where \(i=2,\ 3,\ldots\). These codes have a minimum code distance \(d_{min}=3\) and thus, from the dependencies (4) and (5), they have the ability to correct all single errors or detect all double errors in the code combination [25]. The number of control bits \(k\) is determined by the following condition [24]:  
\[k\geq log_{2}(n+1). \tag{7}\]  
Dependence (7) can be transformed into a more convenient form for determining the number of control bits in the code combination:  
\[2^{k}-k\geq m+1. \tag{8}\]  
Hamming codes can be defined in two ways: using the general (ordinary) method and using the matrix method. The general method of representation will be shown below. The control bits can be placed in different positions. In Hamming codes, their placement is at positions \(2^{0},2^{1},2^{2},2^{3},\ldots,\ 2^{i}\ (i=0,\ 1,\ 2,\ldots)\). In this case, each control bit corresponds to a group of information bits, as a result of which, each control bit is formed independently of each other [11]. Table 1 shows the location of the control (\(C_{i}\)) and information bits (\(S_{i}\)) in the code combination for the Hamming code (15, 11). Encoding using the Hamming code by the general method  
Before proceeding with the encoding process, all parameters of the code with \(m=9\) must be determined. Since \(m\) is known, the number of control bits \(k\) is determined from dependence (8):  
\[k=4. \tag{9}\]  
From (1), the number of bits in the code combination \(n\) is calculated:  
\[n=13. \tag{10}\]  
Knowing that for Hamming codes \(d_{min}=3\)[24], the correcting capability of the code is determined from dependence (4):  
\[l_{0}=1. \tag{11}\]  
After the parameters of the code are determined and the structure of the code is known, the code combination should be constructed with the notations (labels) of the bits and the values of the information bits (Table 2). \begin{table}
\begin{tabular}{l r r r r r r r r r r r r r} \hline Position number & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline Type of bit & \(C_{1}\) & \(C_{2}\) & \(S_{1}\) & \(C_{3}\) & \(S_{2}\) & \(S_{3}\) & \(S_{4}\) & \(C_{4}\) & \(S_{5}\) &  
\[C_{4}=0\oplus 1\oplus 0\oplus 1\oplus 1=0\quad=>\quad C_{4}=1 \tag{15}\]  
And finally, the code combination with the calculated control bits is written:  
\[[X]=1\ 1\ 1\ 0\ 1\ 1\ 0\ 1\ 0\ 1\ 0\ 1\ 0\ 1\ 1 \tag{16}\]
2. Decoding of code combinations using the Hamming code by the general method  
In this task, the code combination obtained from the previous task will be decoded. But before that, to show the correcting capability of the code, let's artificially introduce a single error, say at position \(N^{*}6\), resulting in the following code combination \([X^{*}]\). \[[X^{*}]=1\ 1\ 1\ 0\ 1\ 0\ 0\ 1\ 0\ 1\ 0\ 1 \tag{17}\]  
For the decoding process, it is necessary to know the parameters of the code, which are determined similarly to the encoding process. The parameters are:  
\[m=9,\ k=4,\ n=13,\ \text{and}\ l_{0}=1. \tag{18}\]  
The code combination with the corresponding bit labels is given below. \[ \begin{array}{c|cccccccccccccccc}&1&2&3&4&5&6&7&8&9&10&11&12&13\\ &C_{1}&C_{2}&S_{1}&C_{3}&S_{2}&S_{3}&S_{4}&C_{4}&S_{5}&S_{6}&S_{7}&S_{8}&S_{9 }\\ &1&1&1&0&1&0&0&1&0&1&0&1&1\end{array}  \tag{19}\]  
All control bits must be checked according to their corresponding equations. The check bit equations are constructed in the same way as in the encoding process, with the difference that instead of equalizing to 0, the calculated value is written.