Chapter 6. Threshold Logic. Logic design of sw functions constructed of electronic gates different type of switching element : threshold element. Threshold.

Slides:



Advertisements
Similar presentations
Three Special Functions
Advertisements

Threshold Logic for Nanotechnologies
More Vectors.
PROOF BY CONTRADICTION
Linear Equations in Linear Algebra
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
5.3 Linear Independence.
Mintrue & Maxfalse method
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Linear Equations in Linear Algebra
6 6.3 © 2012 Pearson Education, Inc. Orthogonality and Least Squares ORTHOGONAL PROJECTIONS.
Lecture 3. Boolean Algebra, Logic Gates
Fall 2002CMSC Discrete Structures1 Yes, No, Maybe... Boolean Algebra.
2.7 NAND and NOR logic networks
Solving Equations with variables on both sides of the Equals Chapter 3.5.
Chapter 2: Boolean Algebra and Logic Functions
Tautology. Tautology Decision May be able to use unateness to simplify process Unate Function – one that has either the uncomplemented or complemented.
Graphing Linear Equations
BOOLEAN FUNCTION PROPERTIES
Programmable Logic Devices, Threshold Logic
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Lecture 4 4. Boolean functions – advanced
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
Chapter 3. Minimization of Switching Functions. Given a sw function f(x 1, x 2, …, x n ) and some cost criteria, find a representation of f which minimizes.
Review I Rosen , 3.1 Know your definitions!
1 1.3 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra VECTOR EQUATIONS.
Combinational Logic 1.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Linear Algebra. Circuits The circuits in computers and other input devices have inputs, each of which is either a 0 or 1, the output is also 0s and 1s.
Chapter 5. Functional Decomposition and Symmetric Functions.
Discrete Mathematics CS 2610 February 12, Agenda Previously Finished functions Began Boolean algebras And now Continue with Boolean algebras.
Word : Let F be a field then the expression of the form a 1, a 2, …, a n where a i  F  i is called a word of length n over the field F. We denote the.
Sullivan Algebra and Trigonometry: Section 4.5 Solving Polynomial and Rational Inequalities Objectives Solve Polynomial Inequalities Solve Rational Inequalities.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Discrete Mathematics CS 2610 February 10, Agenda Previously Functions And now Finish functions Start Boolean algebras (Sec. 11.1)
Topic 4 – Switching Circuits. Serial vs. Parallel Transmission Circuit elements can be connected in either a serial or parallel manner. Serial implies.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
1.4 Solving Inequalities I can: 1.Graph inequalities 2.Solve inequalities.
Solve 7n – 2 = 5n + 6. Example 1: Solving Equations with Variables on Both Sides To collect the variable terms on one side, subtract 5n from both sides.
Boolean Algebra.
©2010 Cengage Learning SLIDES FOR CHAPTER 4 APPLICATIONS OF BOOLEAN ALGEBRA MINTERM AND MAXTERM EXPANSIONS Click the mouse to move to the next page. Use.
UNIT 4 APPLICATIONS OF BOOLEAN ALGEBRA MINTERM AND MAXTERM EXPANSIONS Click the mouse to move to the next page. Use the ESC key to exit this chapter. This.
Computational Properties of Perceptron Networks n CS/PY 399 Lab Presentation # 3 n January 25, 2001 n Mount Union College.
CHAPTER SIX T HE P ROBABILISTIC M ETHOD M1 Zhang Cong 2011/Nov/28.
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
Fundamentals of Logic Design, 7 th editionRoth/Kinney © 2014 Cengage Learning Engineering. All Rights Reserved. 1 Boolean Algebra (continued) UNIT 3.
More NP-Complete and NP-hard Problems
Boolean Algebra & Logic Gates
Chapter 11 (Part 1): Boolean Algebra
Linear Equations in Linear Algebra
Chapter 2: Boolean Algebra and Logic Functions
Example: Solve the equation. Multiply both sides by 5. Simplify both sides. Add –3y to both sides. Simplify both sides. Add –30 to both sides. Simplify.
CHAPTER 1.3 Solving Equations.
… and now for the Final Topic:
Dr. Clincy Professor of CS
CMSC Discrete Structures
Chapter 2 Boolean Algebra and Logic Gate
Linear Equations in Linear Algebra
Linear Equations in Linear Algebra
CS Chapter 3 (3A and ) Part 3 of 8
Systems of Inequalities
Yes, No, Maybe... BooleanAlgebra 12/10/2018.
Applied Discrete Mathematics Week 4: Functions
CS Chapter 3 (3A and ) – Part 2 of 5
Chapter 5. The Duality Theorem
Instructor: Alexander Stoytchev
Analysis of Logic Circuits Example 1
CMSC Discrete Structures
Systems of Inequalities
Presentation transcript:

Chapter 6. Threshold Logic

Logic design of sw functions constructed of electronic gates different type of switching element : threshold element. Threshold element can be considered as a generalization of the conventional gates. A large class of sw fn. can be realized by a single threshold element through lots of combinations of weights and threshold. Threshold function : A fn f(x 1, x 2,, x n ) is defined as a threshold fn iff there exists a set of weights {w 1, w 2,, w n } and a threshold T such that f(x 1, x 2,, x n ) = 1, iff f(x 1, x 2,, x n ) = 0, iff,where T and weights w i ’s are real number, x i ’s are binary inputs, and each weight w i is associated with a particular input var x i. A straightforward approach to identify a threshold fn is to derive from the truth table, a set of 2 n linear simultaneous inequalities and to solve them. w 1 w i w n T x 1 x i x n f

Eg) f(x 1, x 2, x 3 ) =  (0,1,3) 0  T w 3  T w 2 < T w 2 +w 3  T w 1 < T w 1 +w 3 < T w 1 +w 2 < T w 1 +w 2 +w 3 < T Inequality( )f x 1 x 2 x 3 w 3 >w 2 w 3 >w 1 w 3 >w 1 +w 3  w 1 <0 To find more effective methods, we will study the properties of a Threshold fn. Capabilities and limitation (A two input NOR gate) -½-½ x1x2x1x2 f x 1 x 2 f Since a NOR gate is strongly logically complete, any combinational sw. fn can be realized by threshold elements alone. Because of huge possible combinations of weights and threshold, lots of sw. fn can be realized by only one threshold element  threshold fn

Is every sw. fn a threshold fn? No. Problem 1: Given a sw. fn f(x 1, x 2,, x n ), determine whether or not it is a threshold fn. and if it is, find weights and a threshold. Problem 2: If the given sw. fn is not a threshold fn, how many threshold elements are required to realized the given sw. fn. Properties: A fn f(x 1, x 2,, x n ) is positive in a var x i iff f(x 1, x 2,, x i-1, 1, x i+1,, x n )  f(x 1, x 2,, x i-1, 0, x i+1,, x n ) A fn f(x 1, x 2,, x n ) is negative in a var x i iff f(x 1, x 2,, x i-1, 0, x i+1,, x n ) < f(x 1, x 2,, x i-1, 1, x i+1,, x n ) A fn which is positive or negative in every var is called unate. positive unate : positive in every var negative unate : negative in every var A completely specified fn is unate iff any minimal S. of P. representation of the fn uses either literal x i or literal x i ’ but not both for 1  i  n. Eg) f(x 1, x 2, x 3 ) =  (0,1,3) = x 1 ’x 2 ’+x 1 ’x 3 ’(unate), x 1 ’x 2 +x 1 x 2 ’(not unate) x 1 x 2 x 3

Theorem: all threshold functions are unate. Proof: let f(x 1, x 2,, x n ) be a non unate fn. Suppose it is a threshold fn then there should be some x i such that f is neither positive or negative in x i. Since f ins non unate, there exist some input combination, say (a 1, a 2,, a n ) such that f(a 1, a 2,, a i-1, 0, a i+1,, a n ) = 1 f(a 1, a 2,, a i-1, 1, a i+1,, a n ) = 0 and some input combination say (b 1, b 2,, b n ) such that f(b 1, b 2,, b i-1, 0, b i+1,, b n ) = 0 f(b 1, b 2,, b i-1, 1, b i+1,, b n ) = 1 W i <0 W i >0 contradiction

Theorem: Not all unate function are a threshold fn. Proof) We need to give one example, consider f(x 1, x 2, x 3, x 4 ) =  (3,7,11,12,13,14,15) = x 1 x 2 +x 3 x 4  unate fn f(1,1,0,0)=1  w 1 +w 2  T f(1,0,1,0)=0  w 1 +w 3 < T f(0,0,1,1)=1  w 3 +w 4  T f(0,1,0,1)=0  w 2 +w 4 < T contradiction!!  The given fn is not a threshold fn. Consider that fn f(x 1, x 2,, x n ) is realized by V 1 = {w 1, w 2,, w n ; T} whose inputs are x 1, x 2,, x n. If one of input, say x j, is complemented, the function can be realizable by a single threshold element having a weight-threshold vector. V 2 = {w 1, w 2,, -w j,, w n ; T-w j } whose inputs are x 1, x 2,, -x j,, x n x 1 x 2 x 3 x w 1 +w 2 >w 1 +w 3  w 2 >w 3 w 3 +w 4 >w 2 +w 4  w 3 >w 2 w 1 w j w n T x 1 x j x n f w 1 -w j w n T-w j x 1 x j x n g 

We have to prove that f and g are identical fn. Case 1: x j =0 (x j ’=1) left side (f)right side (g) Case 1: x j =1 (x j ’=0) left side (f)right side (g) 1 1 Therefore, f and g are identical.

If a function is realizable by a single threshold element (i.e. threshold function) then by an appropriate selection of complemented and uncomplemented input variables, it is realizable by an threshold element whose weight have any desired sign distribution. Let a threshold fn f(x 1, x 2,, x n ) be positive in var x i and the weight-threshold vector V= {w 1, w 2,, w n ; T},since f is positive in var x i, there exists a set of values a 1, a 2,, a i-1, a i+1,, a n for inputs x 1, x 2,, x i-1, x i+1,, x n such that f(a 1, a 2,, a i-1, 1, a i+1,, a n ) = 1 and f(a 1, a 2,, a i-1, 0, a i+1,, a n ) = 0 Hence, w 1 a 1 +w 2 a w i-1 a i-1 +w i +w i+1 a i+1 + +w n a n  T and w 1 a 1 +w 2 a w i-1 a i-1 +w i+1 a i+1 + +w n a n < T  w i >0 The weight w i associated with a threshold function which is positive in var x i, is positive.  The weights associated with a threshold function which is a positive in all its vars, are all positive. If a function f(x 1, x 2,, x n ) is threshold fn with V 1 = {w 1, w 2,, w n ; T}, is the complement f ’ (x 1, x 2,, x n ) a threshold fn? Then what is weigh-threshold vector, V 2 ?

We assume that the weighted sum is not equal to T for any input combination  w i x i >T  f=1  w i x i <T  f=0multiply by (-1) to each side.   (-w i )x i -T  f=0 (f ’ =1) V 2 = {-w 1, -w 2,, -w n ; -T} Linear separability If we use the n-cube representation for n-var threshold functions and regard the vertices as points in n-D space, w 1 x 1 +w 2 x 2 + +w n x n = T Correspond to an (n-1)-D hyperspace which cuts through the n-cube. Now, if w 1 x 1 +w 2 x 2 + +w n x n  T then f=1, if w 1 x 1 +w 2 x 2 + +w n x n < T then f=0, the hyper plane separates the true vertices from the false vertices  Threshold function = linearly separable function. If n=2, w 1 x 1 +w 2 x 2 =T x1x1 x2x2

If n=3, w 1 x 1 +w 2 x 2 +w 3 x 3 =T  Plane equation x2x2 x3x3 x1x1 True vertices x2x2 x3x3 x1x1 Linear equation False vertices XOR function f x 1 x 2 OR function f x 1 x 2 x1x1 x2x2 x1x1 x2x2 (1,0) (0,0) (1,1) (0,1) (0,0) (0,1) separable Not separable  XOR isn’t threshold function  We can separate between true and false vertices

Our objective is to present a procedure which will determine whether a given sw fn is a threshold fn, and if it is, will provide the value of weights and threshold 1. Test the given fn for unateness.  convert to a positive unate fn 2. Try to find only positive weights for a positive unate fn using minimal true vertices and maximal false vertices. 3. Convert to original inputs and adjust weights and threshold. Ex) f(x 1, x 2, x 3, x 4 ) =  (0,1,4,5,6,7,8,9,11,12,13,14,15) x 1 x 2 x 3 x f = x 2 +x 3 ’+x 1 x 4 We can say positive unate in x 1, x 2, x 4 negative unate in x 3 Let g(y 1, y 2, y 3, y 4 ) = f(x 1, x 2, x 3 ’, x 4 ) then g(y 1, y 2, y 3, y 4 ) = y 2 +y 3 +y 1 y 4

Minimal true vertices of a positive unate fn: any true vertex, say (a 1, a 2,, a n ) such that there is no other true vertex, say (b 1, b 2,, b n ) such that (b 1, b 2,, b n ) < (a 1, a 2,, a n ) Maximal false vertices of a positive unate fn: any false vertex, say (a 1, a 2,, a n ) such that there is no other false vertex, say (b 1, b 2,, b n ) such that (b 1, b 2,, b n ) > (a 1, a 2,, a n ) y 1 y 2 y 3 y false vertices true vertices maximal false vertices minimal true vertices f  0  w i x i < T f  1  w i x i  T

w4w1w4w1 w 3 w 2 w 1 +w 4 Conti. example) w 4 <w 3 w 4 <w 2 w 4 <w 1 +w 4 w 1 <w 3 w 1 <w 2 If we choose, w 3 =4, w 4 =2, w 1 =2, and w 2 =4 Ex) f(x 1, x 2, x 3, x 4 ) =  (0,1,3,4,5,6,7,12,13) x 1 x 2 x 3 x f = x 1 ’x 2 +x 1 ’x 3 ’+x 1 ’x 4 +x 2 x 3 ’ positive unate in x 2, x 4 negative unate in x 1, x 3 Let g(y 1, y 2, y 3, y 4 ) = f(x 1 ’, x 2, x 3 ’, x 4 ) then g(y 1, y 2, y 3, y 4 ) = y 1 y 2 +y 1 y 3 +y 1 y 4 +y 2 y f  y1y2y3y4y1y2y3y4 x1x2x3x4x1x2x3x

y 1 y 2 y 3 y false vertices true vertices w 1 w 2 +w 4 w 3 +w 4 w 2 +w 3 w 1 +w 4 w 1 +w 3 w 1 +w 2 w 1 <w 2 +w 3 w 2 +w 4 <w 2 +w 3 w 2 <w 1 w 2 +w 4 <w 1 +w 3 w 4 <w 1 w 4 <w 2 w 3 <w 1 w 3 +w 4 <w 1 +w 2  w 1 >w 2,w 3,w 4  w 4 <w 3 If we choose, w 1 =6, w 2 =5, w 3 =4, w 4 =2, and T= f  y1y2y3y4y1y2y3y4 x1x2x3x4x1x2x3x