fbpx
Wikipedia

Residue number system

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 M is the product of the moduli, there is, in an interval of length M, 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 edit

A residue numeral system is defined by a set of 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). 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 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 i

Let M be the product of all the  . Two integers whose difference is a multiple of M have the same representation in the residue numeral system defined by the mis. More precisely, the Chinese remainder theorem asserts that each of the M different sets of possible residues represents exactly one residue class modulo M. That is, each set of residues represents exactly one integer   in the interval  . For signed numbers, the dynamic range is   (when   is even, generally an extra negative value is represented).[2]

Arithmetic operations edit

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 x and y, respectively represented by the residues   and   is the integer z represented by   such that

 

for 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.

However, operations such as magnitude comparison, sign computation, overflow detection, scaling, and division are difficult to perform in a residue number system.[3]

Comparison edit

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 M. It follows that testing equality is easy.

At the opposite, testing inequalities (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 edit

Division in residue numeral systems is problematic. 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 edit

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 edit

References edit

  1. ^ Parhami, Behrooz (2010). Computer Arithmetic: Algorithms and Hardware Designs (2 ed.). New York, USA: Oxford University Press. ISBN 978-0-19-532848-6. from the original on 2020-08-04. Retrieved 2021-01-23. (xxv+641 pages)
  2. ^ Hung, C.Y.; Parhami, B. (1994-02-01). "An approximate sign detection method for residue numbers and its application to RNS division" (PDF). Computers & Mathematics with Applications. 27 (4): 23–35. doi:10.1016/0898-1221(94)90052-3.
  3. ^ Isupov, Konstantin (2020-04-07) [2020-03-20, 2020-03-08, 2020-02-17]. "Using Floating-Point Intervals for Non-Modular Computations in Residue Number System". IEEE Access. 8: 58603–58619. Bibcode:2020IEEEA...858603I. doi:10.1109/ACCESS.2020.2982365. ISSN 2169-3536.

Further reading edit

  • Szabo, Nicholas S.; Tanaka, Richard I. (1967). Residue Arithmetic and its Applications to Computer Technology (1 ed.). New York, USA: McGraw-Hill.
  • Sonderstrand, Michael A.; Jenkins, W. Kenneth; Jullien, Graham A.; Taylor, Fred J., eds. (1986). Residue Number System Arithmetic: Modern Applications in Digital Signal Processing. IEEE Press Reprint Series (1 ed.). New York, USA: IEEE Circuits and Systems Society, IEEE Press. ISBN 0-87942-205-X. LCCN 86-10516. IEEE order code PC01982. (viii+418+6 pages)
  • Chervyakov, N. I.; Molahosseini, A. S.; Lyakhov, P. A. (2017). Residue-to-binary conversion for general moduli sets based on approximate Chinese remainder theorem. International Journal of Computer Mathematics, 94:9, 1833-1849, doi: 10.1080/00207160.2016.1247439.
  • Fin'ko [Финько], Oleg Anatolevich [Олег Анатольевич] (June 2004). "Large Systems of Boolean Functions: Realization by Modular Arithmetic Methods". Automation and Remote Control. 65 (6): 871–892. doi:10.1023/B:AURC.0000030901.74901.44. ISSN 0005-1179. LCCN 56038628. S2CID 123623780. CODEN AURCAT. Mi at1588.
  • Chervyakov, N. I.; Lyakhov, P. A.; Deryabin, M. A. (2020). Residue Number System-Based Solution for Reducing the Hardware Cost of a Convolutional Neural Network. Neurocomputing, 407, 439-453, doi: 10.1016/j.neucom.2020.04.018.
  • Bajard, Jean-Claude; Méloni, Nicolas; Plantard, Thomas (2006-10-06) [July 2005]. "Efficient RNS bases for Cryptography" (PDF). IMACS'05: World Congress: Scientific Computation Applied Mathematics and Simulation. Paris, France. HAL Id: lirmm-00106470. (PDF) from the original on 2021-01-23. Retrieved 2021-01-23. (1+7 pages)
  • Omondi, Amos; Premkumar, Benjamin (2007). Residue Number Systems: Theory and Implementation. London, UK: Imperial College Press. ISBN 978-1-86094-866-4. (296 pages)
  • Mohan, P. V. Ananda (2016). Residue Number Systems: Theory and Applications (1 ed.). Birkhäuser / Springer International Publishing Switzerland. doi:10.1007/978-3-319-41385-3. ISBN 978-3-319-41383-9. LCCN 2016947081. (351 pages)
  • Amir Sabbagh, Molahosseini; de Sousa, Leonel Seabra; Chip-Hong Chang, eds. (2017-03-21). Embedded Systems Design with Special Arithmetic and Number Systems (1 ed.). Springer International Publishing AG. doi:10.1007/978-3-319-49742-6. ISBN 978-3-319-49741-9. LCCN 2017934074. (389 pages)
  • . Archived from the original on 2005-02-17. Retrieved 2023-08-24.
  • Knuth, Donald Ervin. The Art of Computer Programming. Addison Wesley.
  • Harvey, David (2010). "A multimodular algorithm for computing Bernoulli numbers". Mathematics of Computation. 79 (272): 2361–2370. arXiv:0807.1347. doi:10.1090/S0025-5718-2010-02367-1. S2CID 11329343.
  • Lecerf, Grégoire; Schost, Éric (2003). "Fast multivariate power series multiplication in characteristic zero". SADIO Electronic Journal on Informatics and Operations Research. 5 (1): 1–10.
  • Orange, Sébastien; Renault, Guénaël; Yokoyama, Kazuhiro (2012). "Efficient arithmetic in successive algebraic extension fields using symmetries". Mathematics in Computer Science. 6 (3): 217–233. doi:10.1007/s11786-012-0112-y. S2CID 14360845.
  • Yokoyama, Kazuhiro (September 2012). "Usage of modular techniques for efficient computation of ideal operations". International Workshop on Computer Algebra in Scientific Computing. Berlin / Heidelberg, Germany: Springer. pp. 361–362.
  • Hladík, Jakub; Šimeček, Ivan (January 2012). "Modular Arithmetic for Solving Linear Equations on the GPU". Seminar on Numerical Analysis. pp. 68–70.
  • Pernet, Clément (June 2015). "Exact linear algebra algorithmic: Theory and practice". Proceedings of the 2015 ACM on International Symposium on Symbolic and Algebraic Computation. Association for Computing Machinery. pp. 17–18.
  • Lecerf, Grégoire (2018). "On the complexity of the Lickteig–Roy subresultant algorithm". Journal of Symbolic Computation.
  • Yokoyama, Kazuhiro; Noro, Masayuki; Takeshima, Taku (1994). "Multi-Modular Approach to Polynomial-Time Factorization of Bivariate Integral Polynomials". Journal of Symbolic Computation. 17 (6): 545–563. doi:10.1006/jsco.1994.1034.
  • Isupov, Konstantin (2021). "High-Performance Computation in Residue Number System Using Floating-Point Arithmetic". Computation. 9 (2): 9. doi:10.3390/computation9020009. ISSN 2079-3197.

residue, number, system, this, article, multiple, issues, please, help, improve, discuss, these, issues, talk, page, learn, when, remove, these, template, messages, this, article, missing, information, about, many, aspects, subject, talk, page, please, expand,. This article has multiple issues Please help improve it or discuss these issues on the talk page Learn how and when to remove these template messages This article is missing information about many aspects of the subject see the talk page Please expand the article to include this information Further details may exist on the talk page July 2018 This article relies largely or entirely on a single source Relevant discussion may be found on the talk page Please help improve this article by introducing citations to additional sources Find sources Residue number system news newspapers books scholar JSTOR July 2018 This article includes a list of references related reading or external links but its sources remain unclear because it lacks inline citations Please help improve this article by introducing more precise citations July 2018 Learn how and when to remove this template message Learn how and when to remove this template message 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 M is the product of the moduli there is in an interval of length M 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 Grobner basis computation and cryptography Contents 1 Definition 2 Arithmetic operations 2 1 Comparison 2 2 Division 3 Applications 4 See also 5 References 6 Further readingDefinition editA residue numeral system is defined by a set of k integers m1 m2 m3 mk displaystyle m 1 m 2 m 3 ldots m k nbsp 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 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 x is represented in the residue numeral system by the set of its remainders x1 x2 x3 xk displaystyle x 1 x 2 x 3 ldots x k nbsp under Euclidean division by the moduli That is xi xmod mi displaystyle x i x operatorname mod m i nbsp and 0 xi lt mi displaystyle 0 leq x i lt m i nbsp for every iLet M be the product of all the mi displaystyle m i nbsp Two integers whose difference is a multiple of M have the same representation in the residue numeral system defined by the mi s More precisely the Chinese remainder theorem asserts that each of the M different sets of possible residues represents exactly one residue class modulo M That is each set of residues represents exactly one integer X displaystyle X nbsp in the interval 0 M 1 displaystyle 0 dots M 1 nbsp For signed numbers the dynamic range is M 2 X M 1 2 textstyle lfloor M 2 rfloor leq X leq lfloor M 1 2 rfloor nbsp when M displaystyle M nbsp is even generally an extra negative value is represented 2 Arithmetic operations editFor 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 m1 mk displaystyle m 1 ldots m k nbsp is the list of moduli the sum of the integers x and y respectively represented by the residues x1 xk displaystyle x 1 ldots x k nbsp and y1 yk displaystyle y 1 ldots y k nbsp is the integer z represented by z1 zk displaystyle z 1 ldots z k nbsp such that zi xi yi mod mi displaystyle z i x i y i operatorname mod m i nbsp for 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 However operations such as magnitude comparison sign computation overflow detection scaling and division are difficult to perform in a residue number system 3 Comparison edit 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 M It follows that testing equality is easy At the opposite testing inequalities x lt 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 edit Division in residue numeral systems is problematic On the other hand if B displaystyle B nbsp is coprime with M displaystyle M nbsp that is bi 0 displaystyle b i not 0 nbsp then C A B 1modM displaystyle C A cdot B 1 mod M nbsp can be easily calculated by ci ai bi 1modmi displaystyle c i a i cdot b i 1 mod m i nbsp where B 1 displaystyle B 1 nbsp is multiplicative inverse of B displaystyle B nbsp modulo M displaystyle M nbsp and bi 1 displaystyle b i 1 nbsp is multiplicative inverse of bi displaystyle b i nbsp modulo mi displaystyle m i nbsp Applications editThis section needs expansion You can help by adding to it 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 editCovering system Reduced residue systemReferences edit Parhami Behrooz 2010 Computer Arithmetic Algorithms and Hardware Designs 2 ed New York USA Oxford University Press ISBN 978 0 19 532848 6 Archived from the original on 2020 08 04 Retrieved 2021 01 23 xxv 641 pages Hung C Y Parhami B 1994 02 01 An approximate sign detection method for residue numbers and its application to RNS division PDF Computers amp Mathematics with Applications 27 4 23 35 doi 10 1016 0898 1221 94 90052 3 Isupov Konstantin 2020 04 07 2020 03 20 2020 03 08 2020 02 17 Using Floating Point Intervals for Non Modular Computations in Residue Number System IEEE Access 8 58603 58619 Bibcode 2020IEEEA 858603I doi 10 1109 ACCESS 2020 2982365 ISSN 2169 3536 Further reading editSzabo Nicholas S Tanaka Richard I 1967 Residue Arithmetic and its Applications to Computer Technology 1 ed New York USA McGraw Hill Sonderstrand Michael A Jenkins W Kenneth Jullien Graham A Taylor Fred J eds 1986 Residue Number System Arithmetic Modern Applications in Digital Signal Processing IEEE Press Reprint Series 1 ed New York USA IEEE Circuits and Systems Society IEEE Press ISBN 0 87942 205 X LCCN 86 10516 IEEE order code PC01982 viii 418 6 pages Chervyakov N I Molahosseini A S Lyakhov P A 2017 Residue to binary conversion for general moduli sets based on approximate Chinese remainder theorem International Journal of Computer Mathematics 94 9 1833 1849 doi 10 1080 00207160 2016 1247439 Fin ko Finko Oleg Anatolevich Oleg Anatolevich June 2004 Large Systems of Boolean Functions Realization by Modular Arithmetic Methods Automation and Remote Control 65 6 871 892 doi 10 1023 B AURC 0000030901 74901 44 ISSN 0005 1179 LCCN 56038628 S2CID 123623780 CODEN AURCAT Mi at1588 Chervyakov N I Lyakhov P A Deryabin M A 2020 Residue Number System Based Solution for Reducing the Hardware Cost of a Convolutional Neural Network Neurocomputing 407 439 453 doi 10 1016 j neucom 2020 04 018 Bajard Jean Claude Meloni Nicolas Plantard Thomas 2006 10 06 July 2005 Efficient RNS bases for Cryptography PDF IMACS 05 World Congress Scientific Computation Applied Mathematics and Simulation Paris France HAL Id lirmm 00106470 Archived PDF from the original on 2021 01 23 Retrieved 2021 01 23 1 7 pages Omondi Amos Premkumar Benjamin 2007 Residue Number Systems Theory and Implementation London UK Imperial College Press ISBN 978 1 86094 866 4 296 pages Mohan P V Ananda 2016 Residue Number Systems Theory and Applications 1 ed Birkhauser Springer International Publishing Switzerland doi 10 1007 978 3 319 41385 3 ISBN 978 3 319 41383 9 LCCN 2016947081 351 pages Amir Sabbagh Molahosseini de Sousa Leonel Seabra Chip Hong Chang eds 2017 03 21 Embedded Systems Design with Special Arithmetic and Number Systems 1 ed Springer International Publishing AG doi 10 1007 978 3 319 49742 6 ISBN 978 3 319 49741 9 LCCN 2017934074 389 pages Division algorithms Archived from the original on 2005 02 17 Retrieved 2023 08 24 Knuth Donald Ervin The Art of Computer Programming Addison Wesley Harvey David 2010 A multimodular algorithm for computing Bernoulli numbers Mathematics of Computation 79 272 2361 2370 arXiv 0807 1347 doi 10 1090 S0025 5718 2010 02367 1 S2CID 11329343 Lecerf Gregoire Schost Eric 2003 Fast multivariate power series multiplication in characteristic zero SADIO Electronic Journal on Informatics and Operations Research 5 1 1 10 Orange Sebastien Renault Guenael Yokoyama Kazuhiro 2012 Efficient arithmetic in successive algebraic extension fields using symmetries Mathematics in Computer Science 6 3 217 233 doi 10 1007 s11786 012 0112 y S2CID 14360845 Yokoyama Kazuhiro September 2012 Usage of modular techniques for efficient computation of ideal operations International Workshop on Computer Algebra in Scientific Computing Berlin Heidelberg Germany Springer pp 361 362 Hladik Jakub Simecek Ivan January 2012 Modular Arithmetic for Solving Linear Equations on the GPU Seminar on Numerical Analysis pp 68 70 Pernet Clement June 2015 Exact linear algebra algorithmic Theory and practice Proceedings of the 2015 ACM on International Symposium on Symbolic and Algebraic Computation Association for Computing Machinery pp 17 18 Lecerf Gregoire 2018 On the complexity of the Lickteig Roy subresultant algorithm Journal of Symbolic Computation Yokoyama Kazuhiro Noro Masayuki Takeshima Taku 1994 Multi Modular Approach to Polynomial Time Factorization of Bivariate Integral Polynomials Journal of Symbolic Computation 17 6 545 563 doi 10 1006 jsco 1994 1034 Isupov Konstantin 2021 High Performance Computation in Residue Number System Using Floating Point Arithmetic Computation 9 2 9 doi 10 3390 computation9020009 ISSN 2079 3197 Retrieved from https en wikipedia org w index php title Residue number system amp oldid 1193169124, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.