## 2 Reverse Conversion for General View Moduli
So, for the 8-bit range, we can take a set of moduli {3,7,13}, where the dimensionality of each module is one binary digit larger. In this case:  
\[k_{1} =61,k_{2}=5\] \[a_{0} =91,a_{1}=26,a_{2}=5.\]  
Then for the number \(X=(1,3,10)=10\) we obtain:  
\[B= \begin{pmatrix}1&0&0\\ 2&5&0\\ 4&3&5\end{pmatrix} \times \begin{pmatrix}1\\ 3\\ 10\end{pmatrix} = \begin{pmatrix}1\\ 17\\ 63\end{pmatrix} \]  
The desired value of \(X\) can be obtained from (9) and the vector \(B=\left(B_{0},B_{1},\left|B_{2}\right|_{p_{3}}\right)\): \(Y=1+17\cdot 3+11\cdot 3\cdot 7=283\), since \(Y\geq P=273\), then \(X=Y-P=10\). This method requires matrix multiplication with small-digit numbers, finding the remainder modulo RNS, and multiplication with accumulation for \(n\) summands. Another method proposed in [16] is called New CRT II. For a two-moduli CRT with \(\{p_{1},p_{2}\}\) moduli, the Algorithm 1 denoted by \(\texttt{findno}(x_{1},\)\(x_{2},\)\(p_{1},\)\(p_{2},\)\(X)\). ```
0:\((x_{1},x_{2}),\{p_{1},p_{2}\}\)
0:\(X<p_{1}\cdot p_{2}\)
1:\(k_{0}=\left|p_{2}^{-1}\right|_{p_{1}}\)
2:return\(X=x_{2}+\left|k_{0}(x_{1}-x_{2})\right|_{p_{1}}\cdot p_{2}\)
```  
**Algorithm 1** Algorithm findno number recovery for a two-moduli RNS  
For ordered RNS with moduli \(p_{1}<p_{2}<\ldots<p_{n}\) a recursive Algorithm 2 translate \(((x_{1},x_{2},\ldots,x_{n}),X)\) is used. Consider an example of applying the Algorithm 2 to RNS {7,8,9} and the number \(X=(3,2,1)=10\). Since \(n=3\), according to step 5 of the Algorithm 2 we obtain two new calls of this algorithm \(\texttt{translate}((x_{1}),\)\(N_{1})\) and \(\texttt{translate}((x_{2},x_{3}),\)\(N_{2})\). Calling \(\texttt{translate}((x_{1}),\)\(N_{1})\) leads to step 11 of the Algorithm 2, for which we obtain \(N_{1}=x_{1}\bmod p_{1}\), \(P_{1}=p_{1}\), i.e., \(N_{1}=3,P_{1}=7\). Calling \(\texttt{translate}((x_{2},x_{3}),\)\(N_{2})\) leads to step 9 of the Algorithm 2, for which from the Algorithm 1 findno we obtain \(N_{2}=x_{3}+\left|\left|p_{3}^{-1}\right|_{p_{2}}\cdot(x_{2}-x_{3})\right|_{p _{2}}\cdot p_{3}\), \(P_{2}=p_{2}\cdot p_{3}\). That is, \(N_{2}=1+\left|1\cdot(2-1)\right|_{8}\cdot 9=10,P_{2}=8\cdot 9=72\). Then, according to step 8 of the Algorithm 2, the call \(\texttt{findno}(N_{1},\ N_{2},\ P_{1},\ P_{2},\ X)\), that is, the calculation  
\[X=N_{2}+\left|\left|P_{2}^{-1}\right|_{P_{1}}\cdot(N_{1}-N_{2})\right|_{P_{1}} \cdot P_{2}=10+\left|\left|72^{-1}\right|_{7}\cdot(3-10)\right|_{7}\cdot 72=10.\]  
Thus, the New CRT II method is based on the recursive use of MRC with two moduli. In this case, there are difficulties in calculating the multiplicative inversion in the last steps of the algorithm, but in the hardware implementation these values can be written to memory. In [11] the set of odd moduli \(\{p_{1},p_{2},\ldots,p_{n-1}\}\) whose range \(P_{h}=\prod_{i=1}^{n-1}p_{i}\) and from the Formula (1) we can obtain  
\[X_{h}=\left|\sum_{i=1}^{n-1}P_{i}\middle|\frac{x_{i}}{P_{i}}\middle|_{P_{i}} \middle|_{P_{h}}\right|_{P_{h}}.\]  
Adding the remainder \(x_{n}\) modulo \(p_{n}=2^{k}\) leads to the expression:  
\[X=\left|2^{k}\middle|\frac{X_{h}}{2^{k}}\right|_{P_{h}}+P_{h}\middle|\frac{x_{ n}}{P_{h}}\middle|_{2^{k}P_{h}}=\left|2^{k}\sum_{i=1}^{n-1}P_{i}\middle|\frac{x_{ i}}{2^{k}P_{i}}\right|_{p_{i}}+P_{h}\middle|\frac{x_{n}}{P_{h}}\middle|_{2^{k}P_{h}} \tag{10}\]  
For \(d\geq\lceil\log_{2}(n-1)\rceil\), denote \(x_{n}^{\prime}=\left|\frac{x_{n}}{P_{h}}\right|_{2^{k}}\), which splits into blocks \(x_{q}\) and \(x_{p}\) by \(k-d\) and \(d\) bits, respectively, that is, \(x_{n}^{\prime}=2^{k-d}x_{p}+x_{q}\). Next, the variables introduced are:  
\[x_{i}^{\prime}=\left|\frac{x_{i}}{2^{k-d}P_{i}}\right|_{P_{i}}\text{ and }x_{p}^{\prime}=\left|x_{p}-\sum_{i=1}^{n-1}\frac{x_{i}^{\prime}}{P_{i}} \right|_{2^{d}}\]  
and \(x_{n}^{\prime\prime}=2^{k-d}x_{p}^{\prime}+x_{q}=\left(x_{p}^{\prime}||x_{q}\right)\), (\(||\)--concatenation of binary values).