Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元.

Similar presentations


Presentation on theme: "Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元."— Presentation transcript:

1 Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元

2 Outline Introduction Modeling Vanishing Polynomials Algorithm Conclusions and Future Work

3 Outline Introduction Modeling Vanishing Polynomials Algorithm Conclusions and Future Work

4 Bit-Vector Arithmetic = %2 m Algebra  Represent integers as a vector of bits  Bit x 0 represents values 0 or 1  Vector X[1:0] = {x 1, x 0 } represents integers  00, 01, 10, 11  Bit-vector of size m : integer values in 0,…, 2 m -1  Vector X[m-1 : 0] represents integers reduced % 2 m

5 Fixed-Size (m) Data-path: Modeling Control the datapath size: Fixed size bit-vectors ( m ) Bit-vector of size m : integer values in 0,…, 2 m -1 Fixed-size (m) bit-vector arithmetic Polynomials reduced %2 m Algebra over the ring Z 2 m

6 Anti-Aliasing Function  F 1 [15:0] = 156x 6 + 62724x 5 + 17968x 4 + 18661x 3 + 43593 x 2 + 40244x +13281  F 2 [15:0] = 156x 6 + 5380x 5 + 1584x 4 + 10469x 3 + 27209 x 2 + 7456x + 13281 Now that polynomially F 1  F 2 because they have different coefficients; But because the datapath size is fixed to 16 bits F 1 [15:0]= F 2 [15:0],or in other words F 1 % 2 16 = F 2 % 2 16

7 Outline Introduction Modeling Vanishing Polynomials Algorithm Conclusions and Future Work

8 Binary Relation Let A be a set,R is a subset of A  A,we say that R is a binary relation on A Let R be a binary relation. We sometimes write aRb for (a,b)  R A binary relation R on A is called reflexive if(x,x)  R for all x  A A binary relation R on A is called symmetric if(x,y)  R  (y,x)  R for all x,y  A A binary relation R on A is called transitive if(x,y)  R and (y,z)  R  (x,z)  R for all x,y,z  A

9 Equivalence Relation A binary relation R on A is called equivalence relation if it is reflexive,symmetric,transitive A equivalence relation R on A.We define the equivalence class of a,[a]={b  A| (a,b)  R } Example: Let A= ,if (a,b)  R  a  b mod n. Then [0],[1],…,[n-1] are all equivalence class

10 Partition Let A be a set. A partition of A is a collection of disjoint nonempty subsets of A. The equivalence classes of R on A form a partition of A. Lemma1: Let R be an equivalence relation on A. The following statements are equivalence: (1)(a,b)  R (2)[a]=[b] (3)[a]  [b]  {}

11 Partition Theorem1: Let R be an equivalence relation on A.P={[a]| a  A}  P is partition of A pf: 顯然 Claim:[a]  [b],then [a]  [b]={} If [a]  [b]  {} By the lemma1,we have [a]=[b]  故 P 為 A 之一 partition

12 Partition Example: Let A= ,if (a,b)  R  a  b mod n. Then corresponding to equivalence class set  n ={[0],[1],…,[n-1]} Note: We sometimes write  n ={0,1,…,n-1}

13 Binary Operation Let S be a set.  :S  S  S function,then we say that  is a binary operation on S if  is a binary operation on S then we will write a  b rather than  (a,b). (S,  1,  2,…,  K ) is a set S together with k binary operation  1,  2,…,  K on S

14 Introduction to Rings A ring (R,+, ‧ ) is a set,R together with two binary operation +, ‧ on R called addition and multiplication,satisfying the following properties: (1) (R,+) is an abelin group. We write the identity element 0 (2)Multiplication is associative,means that a  (b  c)=(a  b)  c  a,b,c  R (3)The left and right distributive laws hold,means that a  (b+c)=a  b+a  c and (a+b)  c=a  c+b  c  a,b,c  R

15 Introduction to Rings Example: 我們在  上定義一個 equivalence relation, 若 (a,b)  R  a  b mod n 對應之 equivalence class set  n ={[0],[1],…,[n-1]}. 在  n 上定義兩個 binary operation +,  by [a]+[b]=[a+b mod n] 與 [a]  [b]=[ab mod n]  (  n +, ‧ ):ring NOTE: (1)  [a],[b]  n,[a]+[b]=[a+b mod n]=[b+a mod n]=[b]+[a] and [a]  [b]=[ab mod n]=[ba mod n]=[b]  [a] (2)  [a]  n,[a]+[0]=]=[a+0 mod n]=[a mod n]=[a] and [a]  [1]=[a  1 mod n]=[a mod n]=[a]

16 Introduction to Rings A ring R is called a commutative ring if ab=ba  a,b  R A ring R is called a ring with unity 1 if there is an element 1  0 in R such that 1  a=a=a  1  a  R Example: (1)  Q,R,C:commutative ring with unity 1 where the ring operations are the usual addition and multiplication. (2)Let n be a positive integer. Then the set  n ={0,1,…,n-1},under addition and multiplication modulo n is commutative ring with unity 1.

17 Introduction to Rings Let (R,+, ‧ ) be a ring,define R[X]={a n x n +a n−1 x n−1 +· · ·+a 1 x+a 0 |  n ,a i  R,  i=1, 2,...,n} is called the ring of polynomials over R In fact,R[X] is ring Example: (  3,+, ‧ ),f(x)=2x 3 +1, g(x)=x+2  f(x)+g(x)= 2x 3 +x and f(x)  g(x)=2x 4 +x 3 +x+2=2x 4 +2x+2

18 Outline Introduction Modeling Vanishing Polynomials Algorithm Conclusions and Future Work

19 Vanishing Polynomials Vanishing Polynomial f(x)  2 m [X],  x  2 m  f(x)=0 f(x),g(x)  2 m [X] if(f-g): vanishing means that 2 m | (f-g) n! divides a product of n consecutive numbers 4! divides 99 X 100 X 101 X 102 Find least n  2 m |n! Smarandache Function (SF) SF(2 3 ) = 4, since 2 3 |4! 2 m divides the product of n = SF(2 m ) consecutive numbers

20 Basic Number Theory Let f(x),g(x)  2 3 [X], if (f-g): vanishing (1)2 3 |(f - g) in  2 3 (2) 2 3 |4! (3) 4! divides the product of 4 consecutive numbers (4)  x  2 3, 4!|(x+1)(x+2)(x+3)(x+4) Write (f-g) as a product of SF(2 m ) = n consecutive numbers

21 Basis for factorization  S 0 (x) = 1  S 1 (x) = (x + 1)  S 2 (x) = (x + 1)(x + 2) : Product of 2 consecutive numbers  S 3 (x) = (x + 1)(x + 2)(x + 3) : Product of 3 consecutive numbers  …  S n (x) = S n-1 (x) (x + n) : Product of n consecutive numbers

22 Basis for factorization Theorem2: Factorize into atleast S n (x) to vanish, where n = SF(2 m ). Example: f = x 4 +2x 3 + 3x 2 + 2x  2 3 [X]; SF(2 3 ) = 4 f can be written as a product of 4 consecutive numbers. f= (x+1)(x+2)(x+3)(x+4) = S 4 (x) f is a vanishing polynomial.

23 Constraints on the Coefficient Example: h(x) = 4x 2 + 4x = 4(x+1)(x+2) = 4  S 2 (x)  2 3 [X]; SF(2 3 ) = 4 h(x) =0  x  2 3 h is a vanishing polynomial. But h(x) not equal to S 4 (x) Theorem3: 2 m /gcd(k!, 2 m )  S k (x)=0 in  2 m [X] NOTE: b  S k (x)=0 in  2 m [X]  2 m /gcd(k!, 2 m ) |b

24 Constraints on the Coefficient Example: h(x) = 4x 2 + 4x = 4(x+1)(x+2) = 4  S 2 (x)  2 3 [X] 2 3 /gcd(2!, 2 3 ) | 4  h is a vanishing polynomial.

25 Deciding Vanishing Polynomials Theorem4: Let F be a polynomial in  2 m [X].Then F is vanishes  F = F n S n + Σ n-1 a k b k S k  n = SF(2 m ), i.e. the least n such that 2 m |n!  F n is an arbitrary polynomial in  2 m [x]  a k is an arbitrary integer  b k = 2 m /gcd(k!,2 m ) k=0 Theorem3Theorem2

26 Outline Introduction Modeling Vanishing Polynomials Algorithm Conclusions and Future Work

27 Algorithm Procedure zero_Identifi( polynomial, 2 m ) 1.Calculate n = SF(2 m ) 2.k = n: Reduce according to Throrem2 Divide by S n If remainder is zero,then F = F n S n, else Continue

28 Algorithm 3.Reduce according to Theorem3. Divide by S n-1 to S 0 Check if quotient is a multiple of b k = 2 m /gcd(k!,2 m ) If remainder is zero,then stop. else continue

29 Example 1 p= 4x 2 + 4x in Z 2 3 1.n = SF(2 3 ) = 4 2.k = 4: Divide by S 4 deg(p) = 2< deg(S 4 ) = 4 quo = 0, rem = 4x 2 + 4x F 4 = 0; Continue 3.k = 3: Divide by S 3 deg(p) = 2<deg(S 3 ) = 3 quo= 0, rem = 4x 2 + 4x continue 4.k = 2: Divide by S 2 quo = 4; rem = 0 b 2 = 2 3 /gcd(2!,2 3 ) = 4 a 2 = quo/ b 2 =1  Z p is a vanishing polynomial in Z 2 3

30 Example 2 p= 5x 2 + 3x + 7 in Z 2 3 1.n = SF(2 3 ) = 4 2.k = 4: Divide by S 4 deg(p) = 2< deg(S 4 ) = 4 quo = 0,rem=5x 2 +3x + 7 F 4 = 0; Continue 3.k = 3: Divide by S 3 deg(p) = 2<deg(S 3 ) = 3 quo= 0, rem = 5x 2 +3x + 7 continue 4.k = 2: Divide by S 2 quo = 5; rem = 4x+5 b 2 = 2 3 /gcd(2!,2 3 ) = 4 a 2 = quo/ b 2 =5/4  Z p is not a vanishing polynomial in Z 2 3

31 Outline Introduction Modeling Vanishing Polynomials Algorithm Conclusions and Future Work

32

33 Thank You


Download ppt "Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元."

Similar presentations


Ads by Google