multiplication by a constant is sublinear vassil dimitrov laurent imbert andrew zakaluzny

18
multiplicatio n by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

Upload: suzanna-fisher

Post on 05-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

multiplication by a

constant is sublinear

Vassil DimitrovLaurent Imbert

Andrew Zakaluzny

Page 2: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

2 of 18

Introduction– The Topic

Theory– The Double Base Number System

Algorithms for SCM– DBNS Algorithms

Conclusions– Comparisons– Future Work

Question Period

outline

Page 3: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

3 of 18

topic

The Single Constant Multiplication Problem (SCM)

– Multiply an (unknown) integer x by a constant integer c using as few additions and shifts as possible.

– Unknown Complexity– Minimize the cost

Previous Works

– Recoding Techniques – naïve double and add method, SD method

– Bernstein, Lefèvre, Boullis & Tisserand, Dempster & MacLeod

Page 4: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

4 of 18

improving current algorithms

Sublinearity of SCM Algorithms:

– Conjectured by Lefevre in 2003

– Sublinearity: shown by R.G.E Pinch in 1996

Page 5: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

5 of 18

theory

Page 6: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

6 of 18

redundancy & sparseness

Very Redundant:– 10 has exactly 5 different

unsigned DBNRs

– 100 has exactly 402 different unsigned DBNRs

– 1000 has exactly 1,295,579 different unsigned DBNRs

Page 7: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

7 of 18

theory

Page 8: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

8 of 18

a DBNS approach

Page 9: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

9 of 18

DBNS blocking

Page 10: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

10 of 18

numerical data

Page 11: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

11 of 18

visual: constant size blocking

Page 12: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

12 of 18

DBNS SCM blocking algorithm

Known worst case cost of implementation

Highly configurable– LUT or Greedy– Parameter values

Larger LUT = Lower run time costStrategy (64 bit constants): Average Cost

Binary 31

CSD 21.4

DBNS Constant Size Blocking (LUT size = 8) 18.8

DBNS Constant Size Blocking (LUT size = 12) 17.7

DBNS Constant Size Blocking (LUT size = 16) 16.8

Page 13: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

13 of 18

non-trivial block sizes

First alternative:

– Left to Right method: • Skip leading 0s, trailing 0s, and partition

accordingly• Visual Example: LUT size = 4

Page 14: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

14 of 18

non-trivial block sizes

Second alternative:

– Right To Left method: • Look for barriers of 0s (i.e. 00 is a barrier

size of m = 2)• Visual Example: LUT size = 4, m = 2 (00)• Best results when m = 3 or 4

Page 15: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

15 of 18

blocking results

Page 16: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

16 of 18

conclusion

SCM is an interesting and open problem

DBNS for SCM:– Blocking:

• Provably sublinear • Simple• Low bit complexity• Known worst case complexity• Extendable to any bit size (with

appropriate blocking)

– Ideal Parameters have been identified (for 32 and 64 bit constants)

Page 17: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

17 of 18

future work

Comparisons with competing methods– Build in hardware– Implement in a compiler– Better comparisons (speed vs area)

MCM problem

Other Blocking Algorithms

Page 18: Multiplication by a constant is sublinear Vassil Dimitrov Laurent Imbert Andrew Zakaluzny

18 of 18

questions