Efficient Method for Magnitude Comparison in RNS Based on Two Pairs - - PowerPoint PPT Presentation

efficient method for magnitude comparison in rns based on
SMART_READER_LITE
LIVE PREVIEW

Efficient Method for Magnitude Comparison in RNS Based on Two Pairs - - PowerPoint PPT Presentation

technology from seed Efficient Method for Magnitude Comparison in RNS Based on Two Pairs of Conjugate Moduli Leonel Sousa Instituto de Engenharia de Sistemas e Computadores Investigao e Desenvolvimento em Lisboa 1 ARITH 18 Montpellier


slide-1
SLIDE 1

June 07 ARITH 18 Montpellier 1

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Efficient Method for Magnitude Comparison in RNS Based on Two Pairs of Conjugate Moduli Leonel Sousa

slide-2
SLIDE 2

June 07 ARITH 18 Montpellier 2

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Outline

1. Motivation 2. Class of Moduli Sets 3. Method for comparing magnitude in RNS 4. Typical application: RNS motion estimator 5. Conclusions and future work

slide-3
SLIDE 3

June 07 ARITH 18 Montpellier 3

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Motivation

  • Carry free arithmetic

– Residue Number Systems (RNS) allows to parallelize +, -, *

  • No general efficient method for comparison in RNS

– to convert from residues to positional code: CRT requires modulo M operations and MRC is a sequential method! – [Miller 86, Dimauro 93, Wang 99]: computationally demanding, not suitable for hardware implementation

  • To propose a method for comparing RNS numbers

considering a representative class of moduli sets.

slide-4
SLIDE 4

June 07 ARITH 18 Montpellier 4

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Class of Moduli Sets

  • New class of multi-moduli sets that rely on pairs of conjugate moduli:

S= {m1,m1

,…, mk,mk } = {2n1−1, 2n1+1,…,2nk−1, 2nk+1}

– Only Mersenne rings and Fermat rings

  • S is not a set of pairwise relatively prime, however modified CRT

[Wang98] allows to obtain an integer from residues

  • This class of multi-moduli leads to two-level residue number systems
  • Important sub-class S’: two pairs of balanced conjugate moduli sets

S’= {m1,m1

, m2,m2 } = {2n−1, 2n+1, 2n+1−1, 2n+1+1}

slide-5
SLIDE 5

June 07 ARITH 18 Montpellier 5

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Class of Moduli Sets

  • For each of the two level we can use the modified CRT to

compute RNS-to-binary

– d = GCD(m1,m2) pairwise relatively prime CRTIII≡MRC

  • Very important for us is that the range is odd

d m

d X X d m m X X

2

1 2 1 1 1 1

) ( − + =

3 ) 1 2 )( 1 2 (

2 2 2

− − =

+ n n

M

1

2 * 1 1 1 * 1 1

) ( 2 ) 1 2 ( 1

− + + = → =

n

x x x X d

n n 3 2 2 1 1 ) 1 ( 2 2

1 2

3 ) 3 1 2 ( 3

− − + = → =

− +

n

X X X X d

n

slide-6
SLIDE 6

June 07 ARITH 18 Montpellier 6

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Comparing magnitude in RNS

  • Unsigned integer numbers (A,B) can be compared by subtraction:
  • Based on the well known mathematical axiom:

– the subtraction of two numbers with the same parity leads to an even number and the subtraction of two numbers with different parities leads to an odd number

  • and taking advantage that M is odd we can answer the question :

– is A ≥ B or not?

  • <

− − ≥ − = B A B A M B A B A C for for

slide-7
SLIDE 7

June 07 ARITH 18 Montpellier 7

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Comparing magnitude in RNS

  • PREPOSITIONS
  • A B iff:

– A and B have the same parity and C is an even number – A and B have different parities but C is an odd number.

  • A < B iff:

– A and B have the same parity and C is an odd number – A and B have different parities but C is an even number.

So we have to compute the parity of A, B and C!

slide-8
SLIDE 8

June 07 ARITH 18 Montpellier 8

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Comparing magnitude in RNS

  • Problem: how to directly compute the parity of a RNS number?

– without computing the number back to a traditional weighted system!

  • The parity of an integer X in the range [0, M−1] represented on the

{2n−1, 2n+1, 2n+1−1, 2n+1+1} moduli set can be computed by:

  • by converting X1 and X2 in the 1st-level we also just need shift and
  • ne’s complement addition

2 2 2 2 1 2 2 2

1 2 −

− ⊕ =

n

X X X X

1 2 * 2 2 1 * 2 2 1 2 * 1 1 1 * 1 1

1

) ( 2 ( ) 1 2 ( ) ( 2 ) 1 2 (

− + − −

+

− × + + = − × + + =

n n

x x x X x x x X

n n n n

slide-9
SLIDE 9

June 07 ARITH 18 Montpellier 9

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Comparing magnitude in RNS

slide-10
SLIDE 10

June 07 ARITH 18 Montpellier 10

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Comparing magnitude in RNS

Parity detection method: suitable for VLSI

slide-11
SLIDE 11

June 07 ARITH 18 Montpellier 11

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Comparing magnitude in RNS Maximum Operation Size (MOS) Proposed Wang Dimauro Miller Algorithm modulo(2n+1+1) modulo(22n-1) modulo(≅ 23n+2) ≅4M MOS (n,M) modulo(33) modulo(255) modulo(≅ 4098) ≅86955 MOS (n=4)

slide-12
SLIDE 12

June 07 ARITH 18 Montpellier 12

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Typical application: RNS motion estimator

  • Tradicional architecture

Subtractors and Adders Comparators: proposed hardware

slide-13
SLIDE 13

June 07 ARITH 18 Montpellier 13

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

RNS motion estimator

S’={15,17,31,33}

slide-14
SLIDE 14

June 07 ARITH 18 Montpellier 14

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

RNS motion estimator

slide-15
SLIDE 15

June 07 ARITH 18 Montpellier 15

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Experimental Results: RNS motion estimator 1.5 ×107 12 254 211 (90%) 246 (1%) Throughput Blocks/s Latency Cycles Freq. MHz BRAMs (% total) Slices (% total)

  • SAD unit implemented in a FPGA with arithmetic units

directly mapped on Look-Up-Tables (LUT)

  • FPGA Xilinx VirtexII Pro (xc2vp50-7)
  • Synthesis with ISE (8.2) tools
slide-16
SLIDE 16

June 07 ARITH 18 Montpellier 16

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

Conclusions and future work

  • New efficient method is proposed for magnitude comparison in

RNS based on two pairs of conjugate moduli

  • This is the first method leading to VLSI architectures with practical

interest for comparing the magnitude of numbers in RNS

– Efficient RNS minimum SAD unit was already implemented in FPGA – We are implementing a SAD unit on an ASIC (0.18µm CMOS)

  • We are now extending the idea to other moduli sets, all with a

common characteristic: M odd

slide-17
SLIDE 17

June 07 ARITH 18 Montpellier 17

Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento em Lisboa

technology

from seed

technology

from seed