A division algorithm for residue numbers

https://doi.org/10.1016/j.amc.2005.02.008Get rights and content

Abstract

In the residue number system, modular multiplication, modular addition, and modular subtraction are closure operations. However, modular division is also important for applying the residue number system. Inspired by Gamberger’s work, we create a division operation to be used in residue number system. In Gamberger’s scheme, the transformation from residues to a binary integer is required for keeping the remainder. To eliminate the overhead in transformation, our scheme uses only the residues so that the computing efficiency can be improved. Besides, we also provide an efficient way to find a multiplicative inverse.

Introduction

The residue number system (RNS) is a good tool for signal processing and arithmetic computation applications. Since a number can be represented several residues in the RNS, the operations performing with residues of a smaller scalar will be executed fast. They are addition, subtraction, and multiplication. These operations in the RNS have such properties as parallel processing and carry-free computing. As a result, using residue arithmetic can increase the processing speed of the computer. Besides, operations with long integers are overflow-free, because the operand for these operations is smaller than the corresponding residues. However, the RNS has its weakness in overflow detection, sign detection, number comparison, and division. The shortcomings limit the RNS to the applications without performing division. In other words, the development for the division operation in the RNS is important to expand its applications.

For the division operation in the RNS, there are many researchers have proposed algorithms. Most of these algorithms work by recursively subtracting the multiple of the denominator from the numerator till the difference becomes less than the denominator [2], [3], [5], [8]. The multiple is then the quotient. The parity checking technique is then employed for the sign detection and magnitude comparison [1], [3]. For every 1-bit of the quotient, the multiplication and subtraction with the residues of the dividend and the divisor are required. The obtained quotient is in binary format. Besides, a specific hardware is required for determining the bit length of RNS numbers. In 2002, Talahmeh and Siy proposed an algorithm to do the division operation in a finite Galois field GF(p) [7]. In their method, the generator p should be large so that integers can be mapped over the Galois field. Besides, there is an algorithm to multiply the reciprocal of the divisor instead of computing the division operation [4]. The reciprocal is computed via Newton iteration.

Above all, these algorithms are designed for computing the division operations efficiently. Among them, either some specific computer hardware for certain moduli needs to be designed, or some intermediate data are required. The intermediate data might be the numbers in the mixed radix system (MRS). The worked-out quotient is in binary format. However, for the computation of division operations with large dividends and large divisors, the transformation from the RNS to the MRS or to a binary format may be impossible, since the presentation of these numbers are going to overflow for the storage. In other words, the dividend, the divisor, and the quotient should be kept in the RNS format for the system to operate correctly. In this paper, we shall propose an algorithm for the division operation in the RNS. In our algorithm, the dividend and the divisor will be presented in residue format. They will not be transformed to the binary format or mixed radix format during operation. For the application on the computers only with limited data bit length, the operand is always less than the residues, so overflow problem does not occur.

In the next section, background knowledge is reviewed for the residue number system. Also, this section shows the way to convert a number with respect to one moduli set to a different moduli set. The proposed algorithm for computing the quotient will be then presented in Section 3, followed by some performance analyses in Section 4. Finally, conclusions will be given in Section 5.

Section snippets

RNS conversion for different moduli set

The residue number system (RNS) and the mixed radix system (MRS) are two of the most popular number presentation systems. Both transform a number into several numbers with a smaller scalar. Manipulation with these smaller numbers is more efficient. Numbers, in the RNS, are presented as residues with respect to a set of moduli. In other words, the residues for the same number to refer to different moduli sets are different so that the residue presentations are different to each other. In this

The proposed algorithm

In this section, we shall present our division operation algorithm in the RNS, inspired by Gamberger’s research [2]. The advantage of our proposed method is that the residues are not transformed to be a binary number. The dividend and the divisor are in the RNS representation. The multiplication and subtraction in the method can then be performed in parallel. Every processor unit computes with two corresponding residues in the RNS representations of the dividend and the divisor.

Algorithm 1

  • 1.

    Let the moduli

Discussions

In this section, the discussions are provided, which are on the scheme correctness, the multiplicative inverse computation, and the performance analyses. Section 4.1 is to analyze the correctness of the proposed scheme. That is for the fraction reduction in the RNS. For analyzing the computing performance, the overhead in calculating these multiplicative inverses are not accumulated, although there are many multiplicative inverses required in the proposed scheme. This is because these numbers

Conclusions

In this paper, we have proposed a method for computing the quotient. With the proposed scheme, all numbers are in residue representation. No transformation from the residue representation to a binary number is necessary. The quotient is also in residue representation. Thus, the computations can be efficient with a view to manipulating the quotient. For speeding up the processing, the property of parallel processing can also be introduced to the converting of moduli set.

References (8)

  • S. Talahmeh et al.

    Arithmetic division in RNS using Galois field

    International Journal of Computers and Mathematics with Applications

    (2000)
  • J. Chiang, M. Lu, A general division algorithm for residue number systems, in: Proceedings of 10th IEEE Symposium on...
  • D. Gamberger, New approach to integer division in residue number systems, in: Proceedings of 10th IEEE symposium on...
  • A. Hiasat, H. Abdel-Aty-Zohdy, Design and implementation of an RNS division algorithm, in: Proceedings of 13th IEEE...
There are more references available in the full text version of this article.

Cited by (0)

View full text