# A Division Algorithm in a Redundant Residue Number System Using Fractions
## 2 An Approximate Method for Determining the Positional Feature of the Modular Number
### Division Algorithm in the RNS
\right.\]  
This algorithm will be easy to modify it into a modular form, while the absolute values of the variables are replaced with their relative values. The structure of the algorithm proposed is based on employing the approximate method for comparing numbers, which is performed using subtraction. The known algorithms determine the quotient on the basis of iteration \(A^{\prime}=A-QD\), where \(A\) and \(A^{\prime}\), respectively, are the current and the next dividend, \(D\) is the divisor, \(Q_{1}\) is the quotient, which is generated at each iteration of the full range of the RNS, and is not chosen from a small set of constants. In the proposed algorithm, the quotient is determined from the iteration \(r_{i}=A-b2^{i}\), where \(A\) is a certain dividend, \(b\)--divisor, and \(2^{i}\) is a member of the quotient's approximating series. A comparison of the algorithms shows that the dividend in all iterations does not change, while the divisor is multiplied by the constant, which significantly reduces the computational complexity. In the iterative process of division in positional notation, in order to search for the highest power of the quotient's approximating series, and to clarify the approximating series, the dividend is compared to the doubled divisors or to the sum of the members of the series. Application of this principle to RNS can lead to incorrect operation of the algorithm, since, in case of the dynamic range overflow for the intermediate divider, the reconstructed number may go beyond the operating range caused by cyclic RNS. The cyclic RNS value will be below the dividend, which is not true because, in fact, the numbers will exceed the range \(P\) and the algorithm will proceed to the <<loop>> mode. For example, if the RNS modules are \(p_{1}=2\), \(p_{2}=3\), \(p_{3}=5\), and \(p_{4}=7\), then the range is \(P=2\cdot 3\cdot 5\cdot 7=210\). Suppose the reconstruction produced the number \(A=220\). In the RNS, \(A=220=(0,\ 1,\ 0,\ 3)\), i.e., \(A=210\) and \(A^{\prime}=10\) have the same representation in the RNS. This ambiguity can lead to a breach of the algorithm. To overcome this difficulty, there is a need to compare the RNS the results of the current iteration values with the previous ones, which allows correct determination of a larger or smaller number. So, the fact of the dynamic range overflow in the RNS can be used for decision-making, <<more-less>>. Atthe first iteration, there is a comparison of the dividend with the divisor, while the remaining iterations compare the doubled values of the divisors \(q_{i}b<q_{i+1}b\). Each new iteration implies a comparison of the current value with the previous one. Consistent application of these iterations leads to the formation of the inequalities chain \(bq_{1}<bq_{2}<\ldots<bq_{m}>bq_{m+1}\), which determines the required number of iterations dependent on the values of the dividend and the divisor. Thus, the algorithm is implemented through a finite number of iterations. Suppose that at iteration \(m+1\) there is a case of closure of the increasing sequence \(bq_{m}>bq_{m+1}\), which corresponds to the RNS overflow range, i.e., \(bq_{m+1}>P\) and \(a<bq_{m+1}\). Here is the end of the process of developing quotient interpolation through a binary sequence or a set of constants in the RNS. Thus, the process of the quotient approximation can be done by comparing the neighboring approximate divisors. Here below, we will provide a detailed description of an improved algorithm for the division of modular numbers in a redundant RNS.