请输入您要查询的百科知识:

 

词条 Residue number system
释义

  1. Definition

  2. Arithmetic operations

     Comparison  Division 

  3. Applications

  4. See also

  5. References

  6. Further reading

{{multiple issues|{{missing information|many aspects of the subject (see the talk page)|date=July 2018}}{{single source|date=July 2018}}{{no footnotes|date=July 2018}}
}}

A residue numeral system (RNS) is a numeral system representing integers by their values modulo several pairwise coprime integers called the moduli. This representation is allowed by the Chinese remainder theorem, which asserts that, if {{mvar|N}} is the product of the moduli, there is, in an interval of length {{mvar|N}}, exactly one integer having any given set of modular values. The arithmetic of a residue numeral system is also called multi-modular arithmetic.

Multi-modular arithmetic is widely used for computation with large integers, typically in linear algebra, because it provides faster computation than with the usual numeral systems, even when the time for converting between numeral systems is taken into account. Other applications of multi-modular arithmetic include polynomial greatest common divisor, Gröbner basis computation and cryptography.

Definition

A residue numeral system is defined by a set of {{mvar|k}} integers

called the moduli, which are generally supposed to be pairwise coprime (that is, any two of them have a greatest common divisor equal to one).

referred to as the moduli. Residue number systems have been defined for non-coprime moduli, but are not commonly used because of worse properties. Therefore, they will not be considered in the remainder of this article.[1]

An integer {{mvar|x}} is represented in the residue numeral system by the set of its remainders

under Euclidean division by the moduli. That is

and

for every {{mvar|i}}

Let {{mvar|M}} be the product of all the . Two integers whose difference is a multiple of {{mvar|M}} have the same representation in the residue numeral system defined by the {{math|mi}}s. More precisely, the Chinese remainder theorem asserts that each of the {{mvar|M}} different sets of possible residues represents exactly one residue class modulo {{mvar|M}}. That is, each set of residues represents exactly one integer in the interval {{math|0, ..., M}}.

In applications where one is also interested with negative integers, it is often more convenient to represent integers belonging to an interval centered at 0. In this case, if {{mvar|M}} is odd, each set of residues represents exactly one integer of absolute value at most {{mvar|M}}.

Arithmetic operations

For adding, subtracting and multiplying numbers represented in a residue number system, it suffices to perform the same modular operation on each pair of residues. More precisely, if

is the list of moduli, the sum of the integers {{mvar|x}} and {{mvar|y}}, respectively represented by the residues and is the integer {{mvar|z}} represented by such that

for {{math|1=i = 1, ..., k}} (as usual, mod denotes the modulo operation consisting of taking the remainder of the Euclidean division by the right operand). Subtraction and multiplication are defined similarly.

For a succession of operations, it is not necessary to apply the modulo operation at each step. It may be applied at the end of the computation, or, during the computation, for avoiding overflow of hardware operations.

Comparison

If two integers are equal, then all their residues are equal. Conversely, if all residues are equal, then the two integers are equal, or their differences is a multiple of {{mvar|M}}. It follows that testing equality is easy.

At the opposite, testing inequalities ({{math|x < y}}) is difficult and, usually, requires to convert integers to the standard representation. As a consequence, this representation of numbers is not suitable for algorithms using inequality tests, such Euclidean division and Euclidean algorithm.

Division

Division in residue numeral systems is problematic. A paper describing one possible algorithm is available at [https://web.archive.org/web/20050217165652/http://www.cs.rpi.edu/research/ps/93-9.ps]. On the other hand, if is coprime with (that is ) then

can be easily calculated by

where is multiplicative inverse of modulo , and is multiplicative inverse of modulo .

Applications

{{expand section|date=July 2018}}

RNS have applications in the field of digital computer arithmetic. By decomposing in this a large integer into a set of smaller integers, a large calculation can be performed as a series of smaller calculations that can be performed independently and in parallel.

See also

  • Covering system
  • Reduced residue system

References

1. ^Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design. 2nd edition, Oxford University Press, New York, 2010. 641+xxv p. {{ISBN|978-0-19-532848-6}}.

Further reading

  • Jean-Claude Bajard, Nicolas Meloni and Thomas Plantard, Efficient RNS bases for Cryptography, IMACS'05: World Congress: Scientific Computation Applied Mathematics and Simulation. 2005.
  • O. A. Fin'ko, [https://link.springer.com/article/10.1023%2FB%3AAURC.0000030901.74901.44 Large Systems of Boolean Functions: Realization by Modular Arithmetic Methods], Automation and Remote Control, 65 (2004), no. 6, 871–892.
  • Amos Omondi, Benjamin Premkumar. Residue Number Systems: Theory and Implementation. Imperial College Press. London. 2007. 296 p. {{ISBN|978-1-86094-866-4}}.
  • Ananda Mohan, P.V. [https://link.springer.com/book/10.1007%2F978-3-319-41385-3 Residue Number Systems], Springer International Publishing. 2016. 351 p. {{ISBN|978-3-319-41385-3}}.
  • Amir Sabbagh, Molahosseini, Leonel Seabra de Sousa, and Chip-Hong Chang (editors), [https://link.springer.com/book/10.1007/978-3-319-49742-6 Embedded Systems Design with Special Arithmetic and Number Systems], Springer International Publishing. 21 March 2017. 389 p. {{ISBN|978-3-319-49742-6}}.

2 : Modular arithmetic|Computer arithmetic

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/14 8:22:07