340 likes | 459 Views
Speaker : Chia-Chun Lin Advisor : Chun-Yao Wang 2013/7/22. On Minimizing the Implementation Cost of Threshold Network by Rewiring. Outline. Introduction Threshold logic Motivation Cost minimization algorithm Overview Target wire selection Simplification
E N D
Speaker: Chia-Chun Lin Advisor: Chun-Yao Wang 2013/7/22 On Minimizing the Implementation Cost of Threshold Network by Rewiring
Outline • Introduction • Threshold logic • Motivation • Cost minimization algorithm • Overview • Target wire selection • Simplification • Functional equivalence of two LTGs • Overview • Simplification flow • Experimental results • Conclusion
Outline • Introduction • Threshold logic • Motivation • Cost minimization algorithm • Overview • Target wire selection • Simplification • Functional equivalence of two LTGs • Overview • Simplification flow • Experimental results • Conclusion
Threshold logic (1/2) • A linear threshold gate (LTG) is an n-binary input and one binary output function defined as follows: f = 1 if 0if n binary inputs x1, x2, … ,xnwith weights w1, w2, … ,wn a single binary output y a threshold value T x1 x2 xn w1 w2 wn T f … … An LTG model
Threshold logic (2/2) • A network is composed of LTGs is called a threshold network. An example of threshold logic network and its corresponding Boolean representation.
Assumption • Every Boolean function has infinitely distinct representations in threshold logic. • In our work, the threshold logic is generated with ILP-based tools. • For convenience, we assume the weights and threshold of a threshold function are positive integers. • Negative integers can be transformed into positive ones.
Weight transformation • The relationship of the weights and threshold value between functions containing xi in positive and negative phase is given in [1]. • Step 1. Invert the negative weights into positive ones and complement the corresponding variables. • Step 2. Increase the threshold value by adding the absolute value of the negative weight. x1 x2 x3 2 1 -1 1 f x1 x2 y3 2 1 1 2 f y3 = x3’ [1] S. Muroga. Threshold Logic and its Applications. New York, NY: John Wiley, 1971.
Critical-effect vectors • A critical-effect vector is an assignment such that the output changes from 1 to 0 when each one of its input in this assignment changes from 1 to 0. a b c 2 1 1 2 f
Useless gate and critical input • Definition: An LTG is useless if and only if it outputs zero for all input combinations. • Definition: An input in an LTG is critical if and only if this LTG will become useless after removing this input. The LTG is useless because it outputs zero for all input combinations. a b c a b c 1 1 1 2 1 1 4 3 f f Given an LTG, input ais critical because the LTG will become useless after removing a.
Rewiring techniques f f 10 f 10 1 10 10 n2 n1 • Rectification Network Construction • Case 1: The target wire is not critical: • Case 2: The target wire is critical: y b c d e b c d e a b c d e a b c d e 1 1 4 6 a b c e 3 1 1 6 4 3 1 1 1 1 3 1 1 4 6 6 4 3 1 1 OR a n1 1 1 2 4 AND
Motivation(1/2) • Given function a b c d b c d 3 1 1 1 1 1 1 a 4 1 f f 1 1 2 The summation of the weights and threshold values is (1+1+1+1)+(1+1+2)=8 The summation of the weights and threshold value is 3+1+1+1+4=10
Motivation(2/2) • The summation of all weights and threshold values has been advocated by • VLSI Complexity of Discrete Neural Networks • Area-time performances of some neuralcomputations • Cost function
Outline • Introduction • Threshold logic • Motivation • Cost minimization algorithm • Overview • Target wire selection • Simplification • Functional equivalence of two LTGs • Overview • Simplification flow • Experimental results • Conclusion
Overview START Input: A threshold network weight = threshold value? Yes No The target wire is critical? Yes • Wire removal& Rectification • Remove the target wire • Rectification network construction • OR connection • Wire removal & Rectification • Remove the target wire • Threshold value change • Rectification network construction • AND connection No Simplification Output: The threshold network with a reduced implementation cost END
Target wire selection(1/4) f 3 3 • Case 1: An input having the weight that equals the threshold value • Theorem 1: Given an n-input LTG (x1~xn) with k symmetric inputs x1~xk; : G1=<w1, …, wk, wk+1, …, wn; T>, the rewired threshold network has a cost reduction when k(T-1)>2. a b c d e b c d e 3 2 1 1 1 2 1 1 1 a 1 1 1
Target wire selection(2/4) f T T • Proof: Xk+1 Xn X1 Xk Xk+1 Xn Wk+1 wn Wn W1 Wk+1 Wk 1 … … OR X1 Xk … … … 1 1 1 … f … n1 …
Target wire selection(3/4) • Case 2: A critical input • Useless gates and useless inputs are not allowed in a threshold network. • Theorem 2: Given an n-input LTG with critical input x1: G1=<w1, w2, w3,…, wn; T>, the rewired threshold network has a cost reduction when w1>2. a b c d b c d 3 1 1 1 1 1 1 a 4 1 f f 1 1 2
X1 Target wire selection(4/4) f T- w1 T • Proof: x2 x3 xn x1 x2 x3 xn w1 w2 w3 wn w2 w3 wn f 1 1 2 … n1 … … … AND
Outline • Introduction • Threshold logic • Motivation • Cost minimization algorithm • Overview • Target wire selection • Simplification • Functional equivalence of two LTGs • Overview • Simplification flow • Experimental results • Conclusion
a b c d a b c d Functional equivalence of two LTGs(1/6) 10 4 5 5 3 2 2 2 1 1 f f • Theorem 3: Given two single group LTGs, they are functionally equivalent if and only if they have the same critical-effect vectors.
Functional equivalence of two LTGs(2/6) • Proof: • Given: • two LTGs and with n inputs • the critical-effect vector sets = • Assume: • : the set of n-bit vectors in which the number of 1 is i. • For example, ={ 0001, 0010, 0100, 1000 } . • : the whole input space. • (): the output of gate under the vector . • (, ): thehamming distance between vectors and . • Goal: () = () for i = 0 ∼ n.
Functional equivalence of two LTGs(3/6) • Proof: • Base case: • For i = 0 , () = (). • Induction hypothesis: • Assume ) =), then ) = ) • Any ∈ ,there exist (i + 1) ∈ such that (, ) = 1.
Functional equivalence of two LTGs(4/6) • Proof: • Assume ) =), then ) = ) • Case 1: () = 1 • Case 1a: , and (, ) = 1
Functional equivalence of two LTGs(5/6) • Proof: • Assume ) =), then ) = ) • Case 1: () = 1 • Case 1b: () = 0, with (, ) = 1 • () = 1 • () = 1
Functional equivalence of two LTGs(6/6) • Proof: • Assume ) =), then ) = ) • Case 2: () = 0 • () = 0 • () = 0
Simplification • After rewiring • Problem formulation • Inputs: • An LTG. • Outputs: • The LTG with the reduced cost. a a a b c b b 2 1 1 1 2 1 1 f f f 2 3 3
Overview(1/2) • Geometry and LTG f = 1 if 0if T a b c x y z f
Overview(1/2) • Geometry and LTG f = 1 if 0if • W(CEVi) T a b c x y z f
Overview(2/2) • Weight and threshold value decreasing • Weight • Symmetric input • Threshold value () () W()
Proposed flow START Input: A given LTG Get all CEVs Divide the LTG by a common divisor Decrease the input weight sequentially assign threshold value = min{W(CEVi)} Yes The decrement is valid? Yes Update the LTG There exists an input weight to decrease? No No Output: A linear threshold gate with the reduced cost END
a b c d a b c d a b c d An example for simplification 10 8 6 5 5 3 2 4 4 3 2 3 3 3 2 f f f (b) (a) (c)
a b c d a b c d a b c d a b c d a b c d a b c d An example for simplification 10 8 4 2 6 8 5 5 3 2 4 4 3 2 1 1 1 1 3 3 3 2 4 4 2 2 2 2 1 1 f f f f f f (e) (f) (b) (a) (c) (d)
Conclusion • This paper considers the objective of implementation cost reduction. • A simplification procedure that includes an efficient equivalence checking operation of two LTGs is also proposed. • As the threshold logic is becoming popular, the proposed method will benefit the realization of digital designs in threshold logic.