# Error-Correction Coding Using Polynomial Residue Number System
## 3 Theoretical Foundations of Building Redundant Codes of Polynomial Residue Number System
### Codes of Polynomial Residue Number System with Two Control Bases  
Consider an ordered code of PRNS with informational bases \(p_{1}(z),\,\,p_{2}(z),\dots,\,\,p_{n}(z)\) for which the following expression takes place:  
\[\text{deg}p_{1}(z)\leq\text{deg}p_{2}(z)\leq\dots\leq\text{deg}p_{n}(z) \tag{49}\]  
Now, we introduce two control bases \(p_{n+1}(z),\,\,p_{n+2}(z)\) into this code that satisfy the following condition:  
\[\text{deg}p_{n+1}(z)+\text{deg}p_{n+2}(z)\geq\text{deg}p_{n}(z)+\text{deg}p_{n -1}(z) \tag{50}\]  
This will expand the full range of the code to  
\[W_{n+2}(z)=\prod_{i=1}^{n+2}p_{i}(z)=W_{n}(z)p_{n+1}(z)p_{n+2}(z)=W_{n}(z)W_{k} (z) \tag{51}\]  
where \(W_{k}(z)=p_{n+1}(z)p_{n+2}(z)\). An increase in redundancy in PRNS leads to an increase in the number of polynomial intervals. In this case,  
\[N_{1}=2^{\text{deg}(p_{n+1}(z)p_{n+2}(z))} \tag{52}\]Here, the number of polynomial intervals that correspond to errors on bases of the code of PRNS is defined as  
\[N_{2}=\sum_{i=1}^{n+2}2^{\deg p_{i}(z)} \tag{53}\]  
The analysis of expressions shows that \(N_{1}>N_{2}\). Therefore, codes of polynomial residue number system with two control bases have the potential to correct single errors, which are understood as distortion of one residue in the code combination. As codes of PRNS are modular codes, it is possible to use existing approaches to the development of algorithms designed to detect and correct errors; in other words, the procedure is the same as when codes of residue number system are used. It is proposed in [2; 3; 4] to use positional characteristics to construct error-correction codes of residue number system. It is known from [3] that the code combination of a number is allowed in codes of RNS if the following condition is met:  
\[X=(x_{1},\ldots,x_{i},\ldots,x_{n+2})<W_{n} \tag{54}\]  
where \(x_{i}\equiv X\text{mod}p_{i}\) and \(W_{n}=\prod\limits_{i=1}^{n}p_{i}\) is the operating range of the code of RNS. At the same time, the full range of a redundant code of RNS with two control bases is  
\[W_{n+2}=\prod_{i=1}^{n+2}p_{i}=W_{n}p_{n+1}p_{n+2}=W_{n}W_{k} \tag{55}\]  
where \(W_{k}=p_{n+1}p_{n+2}\). The positional characteristic shows the location (position) of the number presented as the code combination of RNS relative to the operating range [2; 3; 4]. It is obvious that there are \(W_{k}=p_{n+1}p_{n+2}\) operating ranges \(W_{n}\) within the full range \(W_{n+2}\). If the numbers inside the full range are divided by the value \(W_{n}\) and the quotient of the result is taken, we obtain a positional characteristic, that is, the interval [5], equal to  
\[S=\left[\frac{X}{W_{n}}\right] \tag{56}\]  
If the code combination of RNS satisfies Expression (54), then the interval is equal to zero. If the number is outside the operating range, which corresponds to prohibited code combinations of RNS, then the value of the interval is in the range from 1 to \(W_{k}-1\). This means that the interval \(S\) depends on the modulus of the product of the control bases, \(W_{k}\). Through analysis of Expressions (43) and (56) we are able to conclude that there are similar approaches to the development of algorithms for detecting and correcting errors in codes of RNS and codes of polynomial residue number system. Hence, we can develop an algorithm for calculating the polynomial interval without using the division operation, as this operation is absent in the ring of irreducible polynomials. Consider a code combination, \(D(z)=(d_{1}(z),\ \ldots,\ d_{i}(z),\ldots,d_{n+2}(z))\), presented in the code of PRNS with two control bases. Performing the inverse conversion using the CRT for polynomials,  
\[D(z)=\sum_{i=1}^{n+2}d_{i}(z)B_{i}(z)-k(z)W_{n+2}(z) \tag{57}\]  
where \(k(z)=\left[\frac{d_{1}(z)B_{1}(z)+\ldots+d(z)B_{i}(z)+\ldots+d_{n+2}(z)B_{n+2 }(z)}{W_{n+2}(z)}\right]\) is a rank of the polynomial.