Presentation is loading. Please wait.

Presentation is loading. Please wait.

Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing 11-30-2002 NTUEE 吳安宇.

Similar presentations


Presentation on theme: "Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing 11-30-2002 NTUEE 吳安宇."— Presentation transcript:

1 Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing NTUEE 吳安宇

2 Outline History Why RNS is needed ? Fundamental concepts in RNS.
Conversion between Decimal and Residue. Conventional complex RNS Difficult arithmetic operations Applications

3 History The ancient study of the residue numbering system begins with a verse from a third-centry book, Suan-Ching, by Sun Tzu. We have things of which we do not know the number, If we count them by three, the remainder is 2, If we count them by five, the remainder is 3, If we count them by seven, the remainder is 2, How many things are there?

4 History We commemorate this contribution as the Chinese Remainder Theorem, or CRT. This theorem, as well as RNS, was set forth in the 19th by Carl Friedrich Gauss in his celebrated Disquisitiones Arithmetical.

5 Why RNS? It is a “carry-free” system that performs addition, substraction, and multiplication as parallel operations. FA HA

6 Definition The RNS is defined in terms of a set of rela-tively prime moduli. If P denotes the moduli set, then The dynamic range M is

7 Definition Any integer in the residue class ZM has a unique L-tuple representation given by where Xi=X mod pi and is called the ith residue.

8 Example X1 1 2 X2 3 4 X 5 6 7 8 9 10 11 12 13 14

9 Example 4 5 6 7 8 9 10 11 1 2 3 X X1 X2 X3 16 17 18 19 20 21 22 23 12 13 14 15 28 29 30 31 32 33 34 35 24 25 26 27 40 41 42 43 44 45 46 47 36 37 38 39 52 53 54 55 56 57 58 59 48 49 50 51

10 Signed Representation
For signed RNS, any integer in (-M/2, M/2], has a unique RNS L-tuple representation where xi=(X mod pi) if X>0, and (M-|X|) mod pi otherwise. X1 1 2 X2 3 X -6 -5 -4 -3 -2 -1 4 5

11 Operation

12 Operation (Example) 7(1, 3, 2 ) +3(0, 3, 3 )
7(1, , ) +3(0, , ) 10(1 mod 3, 6 mod 4, 5 mod 5) = (1,2,0) 7(1, , ) - 3(0, , ) 4(1 mod 3, 0 mod 4, -1 mod 5) = (1,0,4) 7(1, , ) *3(0, , ) 21(0 mod 3, 9 mod 4, 6 mod 5) = (0,1,1)

13 (3,4,5) Modulo Set 4 5 6 7 8 9 10 11 1 2 3 X X1 X2 X3 16 17 18 19 20 21 22 23 12 13 14 15 28 29 30 31 32 33 34 35 24 25 26 27 40 41 42 43 44 45 46 47 36 37 38 39 52 53 54 55 56 57 58 59 48 49 50 51

14 Conversion Efficient and rapid implementation of the operation (Xi o Yi) mod pi must be found. Only for the case where pi=2^n can be easily implemented in conventional system. RAM or ROM Table Lookup Zi = (Xi o Yi) mod pi Xi (n bits) Yi (n bits) Zi (n bits)

15 Decimal-to-residue Conversion
To be competitive system, the speed of data acquisition and the accompanying decimal-to-residue conversion must be equally fast.

16 Decimal-to-residue Conversion
2j mod pi j=4 i=1 i=2 j=3 j=2 j=1 j=0 1 3 4 2 pi-(25mod pi)

17 Residue-to-decimal Conversion
Generally speaking, the speed limitation of residue-to-decimal conversion is a problem in residue number system. The R/D problem can be solved in one of the following two ways: Mixed radix conversion (MRC) Chinese Remainder Theorem (CRT)

18 Multiplicative Inverse
The multiplicative inverse of g of modulo pi is denoted as gi-1 and satisfies Example: Pi=5 g gi-1 1 2 3 4 g gi-1 Pi=6 1 2 3 4 5 g gi-1 Pi=7 1 2 4 3 5 6

19 Mixed Radix Conversion
RNS MRC The MRC representation is given by where v1=1, v2=p1, v3=p1p2, v4=p1p2p3, …

20 Mixed radix conversion

21 Mixed Radix Conversion
Use nesting subtractions and multiplicative inverse to make sequential conversion.

22 Block Diagram of MRC M M M M M M p12-1 p13-1 p23-1 p1L-1 p2L-1
pL-1,L-1 M

23 Chinese Remainder Theorem
where and si-1 is the multiplicative inverse of si mod pi, so that

24 Chinese Remainder Theorem
X1 s1-1 mod p1 X2 s2-1 mod p2 XL sL-1 mod pL mod M sL s2 s1

25 Chinese Remainder Theorem
1*2 mod 3 0*3 mod 4 4*3 mod 5 20 15 12 mod 60

26 Conventional Complex RNS
A complex number Z is defined to be

27 Difficult Arithmetic Operations
Magnitude comparison / Sign detection Division Base extension Scaling / Rounding / Truncation Overflow detection

28 Magnitude Comparison Sign Detection
Not a weighted number system. Every digits are equally important. The problem makes the RNS-based signal processors inefficient.

29 Division Blend of nested subtractions and magnitude comparisons, so it is more difficult in the RNS domain. RNS is not closed under division, since the RNS is an integer system. It is an slow, high-overhead operation, and should be avoided in RNS.

30 Base Extension Increase the dynamic range Increase the resolution.
R/D and D/R conversions are needed. R/D conversion L - tuple RNS D/R conversion K - tuple RNS Moduli extension

31 Scaling / Rounding / Truncation
Prevent dynamic-range overflow. A special form of division. The scaling operation can be easily to implemented when scaling factor is: Power of two (2n) in 2’complement. Product of one or more of the moduli in RNS.

32 Overflow Detection A special form of magnitude comparison.
Can be avoided by using scaling operation during run-time.

33 Applications High-speed systems (**) FPGA-based solution
Filtering (FIR, IIR) systems Linear transformations Adaptive systems

34 References [1] A good tutorial paper of RNS: Fred J. Taylor, "Residue Arithmetic: A Tutorial with Examples", IEEE Trans. on Computer, pp. 50~62, May 1984. [2] A good paper collections for RNS: M. A. Soderstrand, W. K. Jenkins, G. A. Jullien, F. J. Taylor (eds.), Residue Number System Arithmetic: Modern Applications in digital Signal Processing, IEEE Press, New York, 1986.


Download ppt "Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing 11-30-2002 NTUEE 吳安宇."

Similar presentations


Ads by Google