1 / 43

Advanced Computer Arithmetic Fundamentals of computer arithmetic in RNS Week 8

CENG536 Computer Engineering Department Ç ankaya University . Advanced Computer Arithmetic Fundamentals of computer arithmetic in RNS Week 8. Let is given a system with moduli that has range P determined as Any number A in range [0 , P ) may be represented by the only way as

julius
Download Presentation

Advanced Computer Arithmetic Fundamentals of computer arithmetic in RNS Week 8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CENG536 Computer Engineering Department Çankaya University Advanced Computer ArithmeticFundamentals of computer arithmetic in RNSWeek 8

  2. Let is given a system with moduli that has range Pdetermined as Any number A in range [0, P ) may be represented by the only way as A system of orthogonal bases uniquely corresponds to a given system of moduli and A in positional system is represented as or where rA integer number, that shows how many times was exceeded the range P. Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  3. Integer positive number rAis referred to as true rank or simply rank of number A. Lets define a theorem of the rank of the sum of numbers. Theorem 12. If two numbers and having ranks rA and rB accordingly, are represented in system with moduli and range P , the rank of the sum rA+B will be determined as (*) where mi - is the weight of orthogonal basis Bi. Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  4. Lets write numbers A and B in form Adding A and B gives (**) or, using rule of addition in RNS or in form Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  5. Transforming last expression gives (***) Equating right hand parts of (**) and (***) gives the proof of the theorem. It is evident, that if and otherwise Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  6. Determining of the number’s rank will be realized while operation will be executed. Lets find the way to find number’s rank without transform to positional form. Lets introduce number Mi, that is minimal number of form It is evident, that this number is product of moduli Then we need set of numbers of form And so on… Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  7. Now, let we determine rank of number . We have all numbers Miand we know their ranks. Let we add number M1 few times to obtain residue by modulo p1 equal 0. As a result we have number where k1 – number of additions. Rank of this number is where 1 – is known valuedetermined by standard rule (*). On the second stage we produce the same procedure adding number M2 to obtain 0(modp2) that gives and rank Finalizing this process gives number P = (0, 0, …, 0) rank of which is – 1. From the other hand calculated rank is from which Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  8. Example: • Let the moduli are and • Orthogonal bases are B1 = 70,B2 = 21,B3 = 15 and their weights are m1 = 2,m2 = 1,m3 = 1. • For this system the minimal numbers are • that have ranks • We want determine rank rAof the number Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  9. First add numbers A and M1 • There was no transitions over the moduli and the rank is • Repeating this procedure produce • Here there were transitions over moduli and rank is • Now lets transform to zero digit on second modulo using M2 • There was transition over the second modulo and the rank is Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  10. Repeating addition gives • There was no transition. Now rank is • Continuing this process gives • Here there were transitions over moduli p2 and p3 i.e. • And, finally • As there was transition over second modulo, the rank is • Next step is transforming to zero of the third digit by modulo p3. Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  11. No transitions, the rank is • Repeating addition gives • Now rank is • Because we have • And from this, the rank of the number is rA = 1. • Determining the rank of number by • and the rank of number is rA = 1. Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  12. Rank of number obtained by using this method is referred to as computed rank of the number. • Comparing true rank and computed rank of the sum there is possible to determine overflow over the range [0, P ). Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  13. Example 1: • Let there is the system with moduli p1 = 3, p2 = 5 and p3 = 7 and • Let add number that has rank • and number (rank is ) • Adding numbers gives • Computed rank of the sum is • Its easy to check that true rank of number (2, 4, 4) is equal 2. • As compute rank and true rank are equal each other, we can state that there was no overflow. Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  14. Example 2: • For the same system let we add numbers • ( ) and ( ). • Adding numbers we get • Computed rank of the sum is • The true rank of the number (2, 1, 4) is 2. • As compute rank and true rank are not equal each other, we can state that there was overflow. • The sum Rank of Number and its properties CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  15. Numbers, that have all zero residues except the only residui by modulo pi of form • Are referred to as orthogonal by modulo pinumbers. • Computing the true rank of the number the most natural way is consider the number • as a sum of orthogonal components, and the rank of this number compose as the sum of component’s ranks. Because there may be transitions over the range of the system, the rank may be not correct. We want to find standard components with known ranks that don’t produce transitions over the range while summation will be realized. This components must be small. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  16. Let be introduced pseudo-orthogonal numbers , by modulo pi, that are constructed from orthogonal numbers by violating orthogonal property by one of the system moduli(for example by modulo pn) • We need minimal numbers of form • that are in range • These numbers are referred to as minimal pseudo-orthogonal numbers. • The digit by modulo pn referred to as trace of pseudo-orthogonal number.We generalize the concept of a trace. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  17. Let be given number Digit by modulo pn that produce number • that is in range we shall call the minimal trace of number A. If digits by moduli p1, p2…pn-1 match digits of A and digit by modulo pn is the minimal trace of A, then this number is the minimal form of the A. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  18. Theorem 12. • If there is given minimal pseudo-orthogonal number • that has rank then its trace will be determined as • This minimal number may be presented in form • According to the definition of the minimal pseudo-orthogonal number, its in interval i.e. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  19. In another form its • from which • As is integer number, it may satisfy inequality only if • (*) • which is the statement of the theorem. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  20. Theorem 13. • For a given minimal pseudo-orthogonal number • the rank will be determined by expression • From expression (*) follows that from one hand • i.e. • And from the other hand, as we have • i.e. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  21. As the rank is integer number, the only way to satisfy these equations is satisfying of • The consequence of this theorem is that minimal pseudo-orthogonal number where i = 1 has rank of one. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  22. Theorem 14. • For a given minimal pseudo-orthogonal number • that has rank and another minimal pseudo-orthogonal number of the form • with the rank the ranks of this numbers are connected by equation • and the traces satisfy equation Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  23. Sum of ranks of these numbers is • As integer part [x] of non integer number x satisfy equation • we get Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  24. Now lets determine the sum of traces of these pseudo-orthogonal numbers • The consequence of this theorem is that minimal pseudo-orthogonal number where i = 1 has rank equal Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  25. Example 2: • Let there is the system of moduli • Orthogonal bases and their weights are • We want determine representation of minimal pseudo-orthogonal numbers and their ranks. Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  26. For the base p1 = 2 • For the base p2 = 5 • For the base p3 = 7 Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  27. The values of and were computed by using equations given in theorems 12 and 13. • Values of minimal pseudo-orthogonal numbers are in range Orthogonal and Pseudo-orthogonal Numbers CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  28. Composing of Number by Using Minimal Pseudo-Orthogonal Components CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  29. Lets given an arbitrary number • Summing minimal pseudo-orthogonal numbers • There will be created number MA: • or • where • Value of SA is referred to as trace of number A. Composing of Number CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  30. Lets given an arbitrary number • Summing minimal pseudo-orthogonal numbers • There will be created number MA: • or • where • Value of SA is referred to as trace of number A. • It is evident, that number MA differs of A only by last digit. Composing of Number CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  31. As each summand by definition is in range that is • after(n – 1) summation we have • For the case we have that demonstrate important property: there is no overflow over the range • The true rank is always known as it match to computed rank • as there was no overflow. Composing of Number CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  32. Denoting sum of ranks of minimal pseudo-orthogonal numbers as KA gives • and in future we shall call it as rank kernel of number A. • Denoting by the number of transitions over the last modulo, that were happened while summations were executed, • and calling it rank correction, we can determine the true rank as Composing of Number CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  33. Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  34. Lets analyze division of number A by modulo pi of the system with moduli We shall divide number • that is submultiple to pi and has i = 0. Otherwise we can analyze that satisfies this condition. Let then • Realizing division gives • All digits of the quotient A/piexcept the digit imay be obtained after formal division by pi. Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  35. Theorem 15. • Let in system with moduli and range P is given number that has trace and submultiple to one of the modulo pi. The quotient is • The digit i by modulo pi should be taken so, that minimal track of quotient will equal Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  36. As is the minimal trace of the quotient, takes place the relation • (*) • For the number A we have • After division by pi we get • (**) • Because • and Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  37. Inequality (**) may be rewritten in form • Comparing it to (*) we have • which is the proof of the theorem. • Consequence. From the theorem follows an algorithm for opening of uncertainty: • 1. Having and pi should be calculated • 2. Digits of except the digit iare determined. Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  38. 3. The minimal trace of the quotient is determined • 4. The sum is determined • 5. Minimal trace is determined • and on the base of this result, the digit i for which the difference is minimal will be determined. Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  39. Example 1: • Let is the system with moduli • that has range The orthogonal bases are • Divide number with minimal trace • by the modulo • According the algorithm, step by step we compute: • 1. • 2. Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  40. 3. Minimal trace of the quotient • 4. The sum • 5. • From the table of minimal pseudo-orthogonal numbers by modulo 5: • we have From this • The final result is Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  41. Example 2: • Lets divide by product • We divide by • Division by product may be realized in parallel and result will be determined simultaneously for and , after that we can compute . Quotient of was determined in previous example, that is • Now we determine quotient of Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  42. 1. • 2. Digits of formal quotient are • 3. Minimal trace of quotient is • 4. The sum is • 5. The minimal trace is • And then from the table of minimal pseudo-orthogonal numbers by modulo 7 we determine • Finally we get Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

  43. The quotient of division by product of moduli p2p3 may be determine by introducing constants 1and 2, that may be determined from equation • where 1and 2 are integers. For this example • and we get • The same in decimal gives Division by Modulo of the System CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

More Related