# Error-Correction Coding Using Polynomial Residue Number System
## 3 Theoretical Foundations of Building Redundant Codes of Polynomial Residue Number System
### PRNS Codes with One Control Base
These code combinations can be presented as  
\[D_{iR}(z)=(d_{1}(z),\ldots,d_{i-1}(z),\ R_{i}(z),d_{i+1}(z),\ldots,d_{n}(z)) \tag{10}\]  
where \(R_{i}(z)=\left\{0,\ 1,\ z,\ \ldots,z^{\text{deg}p_{i}(z)-1}\ +z^{\text{deg}p_{i}(z)-2}+\ldots+z+1\right\}\) are residues modulo \(p_{i}(z)\). Then, using the CRT isomorphism in polynomials, it is necessary to prove that two code combinations, \(D_{iR}(z)=(d_{1}(z),\ldots,\ R_{i}(z),\ldots,d_{n}(z))\) and \(D_{iV}(z)=(d_{1}(z),\ldots,\)\(V_{i}(z),\ldots,d_{n}(z))\), in which residues modulo the \(i\)-th base differ from each other (\(V_{i}(z)\
eq R_{i}(z)\)), will provide different results when they are divided by \(P_{i}(z)\), or, in other words, \(\left[\frac{D_{iR}(z)}{P_{i}(z)}\right]-\left[\frac{D_{iV}(z)}{P_{i}(z)}\right]\
eq 0\). Fulfillment of this property is the condition that will allow us to detect and correct errors using PRNS. **Theorem 1. **_If we have a code of polynomial residue number system with bases \(p_{1}(z),\ p_{2}(z),\ldots,p_{n}(z)\) where \(p_{1}(z),\ p_{2}(z),\ldots,p_{n}(z)\) are irreducible polynomials, then for code combinations \(D_{iR}(z)=(d_{1}(z),\ldots,d_{i-1}(z),\ R_{i}(z),d_{i+1}(z),\ldots,d_{n}(z))\) and \(D_{iV}(z)=(d_{1}(z),\ldots,d_{i-1}(z),\)\(V_{i}(z),d_{i+1}(z),\ldots,d_{n}(z))\) where \(V_{i}(z)\
eq R_{i}(z)\) and \(\text{deg}\{V_{i}(z),R_{i}(z)\}<\text{deg}P_{i}(z)\), the following condition is met:_  
\[\left[\frac{D_{iR}(z)}{P_{i}(z)}\right]-\left[\frac{D_{iV}(z)}{P_{i}(z)}\right]\
eq 0 \tag{11}\]  
_where \(P_{i}(z)=\frac{W_{n}(z)}{p_{i}(z)}\), \(W_{n}(z)=\prod\limits_{i=1}^{n}p_{i}(z)\)is the operating range of the code of PRNS, and \(\text{i}=1,\ 2,\ldots,\ n\)._  
**Proof of Theorem 1. ** According to the Chinese Remainder Theorem in polynomials, orthogonal bases are used to perform an inverse conversion from a code of PRNS to a positional code, defined as  
\[B_{i}(z)=m_{i}(z)\frac{W_{n}(z)}{p_{i}(z)} \tag{12}\]  
where \(W_{n}(z)=\prod\limits_{i=1}^{n}p_{i}(z)\) and \(m_{i}(z)\) is the weight of the \(i\)-th orthogonal basis such that \(m_{i}(z)\frac{W_{n}(z)}{p_{i}(z)}\equiv 1\text{mod}p_{i}(z)\)  
Then, the difference between two code combinations of PRNS \(D_{iR}(z)\) and \(D_{iV}(z)\) translated into a positional code is determined by  
\[D_{iR}(z)-D_{iV}(z)=\left|R_{i}(z)-V_{i}(z)\right|_{p_{i}(z)}m_{i}(z)\frac{W_{ n}(z)}{p_{i}(z)} \tag{13}\]  
where \(\left|f(z)\right|_{g(z)}\) is a notation for the expression \(f(z)\text{mod}g(z)\). If Condition (11) is met, then the following equality is valid:  
\[\left|R_{i}(z)-V_{i}(z)\right|_{p_{i}(z)}m_{i}(z)\frac{W_{n}(z)}{p_{i}(z)}=k( z)\frac{W_{n}(z)}{p_{i}(z)} \tag{14}\]  
where \(k(z)\) is a coefficient and \(k(z)\
eq 0\). By transforming (reducing) the left and right sides of the equality, we obtain  
\[W_{4}(z)=\prod\limits_{i=1}^{4}p_{i}(z)=z^{20}+z^{19}+z^{18}+z^{17}+z^{15}+z^{ 12}+z^{9}+z^{8}+z^{5}+z^{3}+z^{2}+z+1\]0If the weight of the orthogonal basis is \(m_{i}(z)=1\), then Expression (15) will take the form  
\[W_{4}(z)=\prod\limits_{i=1}^{4}p_{i}(z)=z^{20}+z^{19}+z^{18}+z^{17}+z^{15}+z^{ 12}+z^{9}+z^{8}+z^{5}+z^{3}+z^{2}+z+1\]1  
As \(V_{i}(z)\
eq R_{i}(z)\) and \(k(z)\
eq 0\), we obtain  
\[W_{4}(z)=\prod\limits_{i=1}^{4}p_{i}(z)=z^{20}+z^{19}+z^{18}+z^{17}+z^{15}+z^{ 12}+z^{9}+z^{8}+z^{5}+z^{3}+z^{2}+z+1\]2  
Using the CRT for polynomials and converting the code combinations into a positional code, we obtain  
\[W_{4}(z)=\prod\limits_{i=1}^{4}p_{i}(z)=z^{20}+z^{19}+z^{18}+z^{17}+z^{15}+z^{ 12}+z^{9}+z^{8}+z^{5}+z^{3}+z^{2}+z+1\]3  
For the second combination,  
\[ \begin{array}{l}D_{iV}(z)=\left|d_{1}(z)B_{1}(z)+\ldots+V_{i}(z)B_{i}(z)+ \ldots+d_{n}(z)B_{n}(z)\right|_{W_{n}(z)}=\\ =\left|d_{1}(z)B_{1}(z)+\ldots+\left|R_{i}(z)-k(z)\right|_{p_{i}(z)}B_{i}(z)+ \ldots+d_{n}(z)B_{n}(z)\right|_{W_{n}(z)}=\\ =\left|d_{1}(z)B_{1}(z)+\ldots+R_{i}(z)B_{i}(z)+\ldots+d_{n}(z)B_{n}(z)\right| _{W_{n}(z)}-\left|k(z)B_{i}\right|_{W_{n}(z)}=\\ =D_{iR}(z)-\left|k(z)B_{i}\right|_{W_{n}(z)}\end{array}