Download presentation
Presentation is loading. Please wait.
Published byChristopher Roberts Modified over 9 years ago
1
Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元
2
Outline Introduction Modeling Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite Conclusions and Future Work
3
Outline Introduction Modeling Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite 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 Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite 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 by 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 Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite 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 Y 0 (x) = 1 Y 1 (x) = (x + 1) Y 2 (x) = (x + 1)(x + 2) : Product of 2 consecutive numbers Y 3 (x) = (x + 1)(x + 2)(x + 3) : Product of 3 consecutive numbers … Y n (x) = Y n-1 (x) (x + n) : Product of n consecutive numbers
22
Basis for factorization Theorem2: S n (x) is vanishing in 2 m [X], 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) = Y 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 ) Y k (x)=0 in 2 m [X],0 k SF(2 m ),2 m /gcd(k!, 2 m ) 為使 2 m /gcd(k!, 2 m ) Y k (x)=0 之 min NOTE: b Y 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 Y 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 Y n + Σ n-1 a k b k Y 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 Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite 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 Y n, else Continue
28
Algorithm 3.Reduce according to Theorem3. Divide by Y n-1 to Y 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 Y 4 deg(p) = 2< deg(Y 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 Y 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 Y 4 deg(p) = 2< deg(Y 4 ) = 4 quo = 0,rem=5x 2 +3x + 7 F 4 = 0; Continue 3.k = 3: Divide by Y 3 deg(p) = 2<deg(Y 3 ) = 3 quo= 0, rem = 5x 2 +3x + 7 continue 4.k = 2: Divide by Y 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 Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite Conclusions and Future Work
32
Multiple Polynomial Definition: (1) Let R be a ring, define the ring R[x 1,…,x n ] of polynomial in the indeterminates x 1,…,x n recursively as follows: R[x 1,…,x n ] = (R[x 1,…,x n-1 ])[x n ] (2) x 1 i1 …x n in is called monomial, ax 1 i1 …x n in is called monomial term, where a 為此 term 之 coefficient (3) The degree of x 1 i1 …x n in is (i1,…,in) n denote deg(x 1 i1 …x n in )
33
Multiple Polynomial If R is a commutative and f(x 1,…,x n ) R[x 1,…,x n ], then the mapping : R R given by (a 1,…,a n ) (a 1,…,a n ) The mapping is called polyfunction. In this problem, : 2 n1 … 2 nd 2 m Definition: Let k=(k 1,k 2,…,k d ) n, we define Y k =y k1 (x 1 ) … y kd (x d ), where y ki (x i ) is the falling factor of degree k i in x i
34
Example F(x 1, x 2 )=x 1 4 x 2 + 2x 1 3 x 2 + 3x 1 2 x 2 + 2x 1 x 2 over 2 2 [x 1,…,x n ] 1.sf(2 2 )=4 2.F=Y (4,1) (x 1, x 2 )=Y 4 (x 1 )Y 1 (x 2 )=0 in 2 2 We wish to generalize these results to analyze polyfunctions over 2 n1 … 2 nd 2 m
35
Lemma8 (1) 2 ni then Y 2 ni (x i )=0, i=1, 2, …, d (2)Let n=sf(2 m ) then Y n (x)=0 Take i =min{2 ni,sf(2 m )}, i=1, 2, …, d then Y i 2 ni is vanshing polynomial Lemma: Let k=(k 1,k 2,…,k d ) n, then Y k =0 k i i, for some i
36
Example F(x 1, x 2 )=x 1 2 x 2 - x 1 x 2 be a polynomial corresponding to the polyfunction : 2 1 2 2 2 3. We show that F is a vanshing polynomial. 1.sf(2 3 )=4, 1=2, 2=4 2.x 1 2 x 2 - x 1 x 2 =x 1 (x 1 -1) x 2 =Y (2,1) (x 1, x 2 ) 3.k1 1=2 The condition in lemma is satisfied, Hence F is vanshing polynomial
37
Constraints on the Coefficient Theorem8: The expression c k Y k =0 in 2 m [X] 2 m /gcd( i=1 k i !, 2 m ) | c k c k 2 m k=(k 1,k 2,…,k d ) n such that k i i, i=1,2,…,d d
38
Example F(x 1, x 2 )=4x 1 x 2 2 + 4x 1 x 2 be a polynomial corresponding to the polyfunction : 2 1 2 2 2 3. We show that F is a vanshing polynomial. 1.2 n1 =2, 2 n2 =4, sf(2 3 )=4, 1=2, 2=4, 2.4x 1 x 2 2 + x 1 x 2 =4x 1 x 2 (x 1 -1) = c (1,2) Y (1,2) (x 1, x 2 ) 3.8/gcd( 1!x2!, 8) | c (1,2) 且 k1 1=2, k2 2=4 The condition in lemma is satisfied, Hence F is vanshing polynomial
39
Deciding Vanishing Polynomials Theorem: Let F be a polynomial representation for the function from 2 n1 … 2 nd to 2 m. Then F is vanishes F = i=1 Q i Y (i) + Σa k b k Y k n = SF(2 m ), i.e. the least n such that 2 m |n! k=(k 1,k 2,…,k d ) n, for each k i =1,2,…, i Y (i) is falling factor of degree i Q i is an arbitrary polynomial a k is an arbitrary integer b k = 2 m /gcd(k!,2 m ) Theorem8 Lemma8 d
40
Outline Introduction Modeling Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite Conclusions and Future Work
42
Example
43
Outline Introduction Modeling Univariate Vanishing Polynomials Algorithm of Univariate Multi-varite Vanishing Polynomials Algorithm of Multi-varite Conclusions and Future Work
45
Thank You
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.