Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Boolean Algebra and Logic Gate

Similar presentations


Presentation on theme: "Chapter 2 Boolean Algebra and Logic Gate"— Presentation transcript:

1 Chapter 2 Boolean Algebra and Logic Gate
Digital Logic Design Chapter 2 Boolean Algebra and Logic Gate Originally by T.Tasniem Al-Yahya

2 2.2 Basic Definitions (Reading)
2.3 Axiomatic Definition of Boolean Algebra 2.4 Basic Theorems and Properties of Boolean Algebra

3 Algebras What is an Algebra? Mathematical system consisting of
Set of elements Set of operators Axioms or postulates: the basic assumptions fron which it is possible to deduce the rules theorems and properities of the system Why is it important? Defines rules of “calculations” Example: arithmetic on natural numbers Set of elements: N = {1,2,3,4,…} Operator: +, –, * Axioms: associativity, distributivity, closure, identity elements, etc.

4 Algebras (Recall) Most common axioms (postulates): Closure
Associative law Commutative law Identity element Inverse Distributive law

5 Algebras (Recall) Closure: a set S is closed with respect to a binary operator  if, for every pair of elements of S, the binary operator specifies a rule for obtaining a unique element of S. Example: S=N={1,2,3,...} ={+,×} not {-} Associative law: a binary operator  on a set S is said to be associative whenever: (x  y)  z = x  (y  z) for all x, y, z Î S

6 Algebras (Recall) 3. Commutative law: a binary operator  on a set S is said to be commutative whenever x  y = y  x for all x, y Î S Example: S=N={1,2,3,...} ={+,×} not {-} Identity element: a set S is said to have an identity element with respect to a binary operation  on S if there exists an element e Î S with the property that: e  x = x  e = x for every x Î S S=I={…,-1,0,1,...} ={+}, e = 0 N does not have an identity element since 0 is excluded from the set

7 Algebras (Recall) Inverse: a set having S the identity element e with respect to the binary operator  is said to have an inverse whenever, for every x Î S, there exists an element y Î S such that x  y = e Example: S=I={…,-1,0,1,...} ={+}, e = 0 If y + x = 0 then y= - x Distributive law: if  and ☉ are two binary operators on a set S,  is said to be distributive over ☉ whenever x  (y ☉ z) = (x  y) ☉(x  z) S=I={…,-1,0,1,...} , =×, ☉ = +

8 2.2 Basic Definitions (Reading)
2.3 Axiomatic Definition of Boolean Algebra 2.4 Basic Theorems and Properties of Boolean Algebra

9 Boolean Algebra boolean algebra is an algebra that deals with binary and logic operations. Boolean Algebra was developed by George Boole (Mathematical theory of logic) in the 1854. E.V. Huntington formulated the axioms for the formal definition of Boolean Algebra in 1904.

10 Boolean Algebra (cont.)
Boolean Algebra: Algebra structure defined by Set of elements B, at least two elements (0,1). Example: B={0,1,11,10} Set of operators: Unary: NOT (-) Binary: OR (+), AND (・) Axioms or postulates: (6 axioms, see next slides). Boolean variable: a variable x is a Boolean variable if : value of xÎ B

11 Axiomatic Definition of Boolean Algebra
Closure: Closure with respect to operator + and operator ・. Identity element (e  x = x  e = x) : 0 for operator + 1 for operator ・ Commutative law with respect to + and operator ・: x + y = y + x x ・ y = y ・ x Distributive law of ・ over +, and + over ・: x ・ (y + z) = (x ・ y) + (x ・ z) x + (y ・ z) = (x + y) ・(x + z)

12 Cont. 6. There exists at least two elements x,yB , such that xy
5. Complement: for every of a x Î B, there exist an element x’ Î B, such that: x + x’ = 1 x ・ x’ = 0 Complement is not valid for ordinary algebra 6. There exists at least two elements x,yB , such that xy Huntington postulates do not include associative law, but it can be derived from the other postulates. The distributive law of + over ., is valid for boolean algebra but not for ordinary algebra.

13 Axioms of Two-Valued Boolean Algebra
Set of operators: Unary: NOT (-) Binary: OR (+), AND (・) Huntington axioms or postulates: Verify that Huntington axioms hold? (next slides) And x y x.y 1 OR x y x + y 1 NOT x x' 1

14 Verify that Huntington axioms hold
Closure? Yes, from tables all operations results {0,1} B Identity? Yes, 0 for operator + and 1 for operator ・ 0+0 = = 1+0 = 1; 1・1 = 1 1・0 = 0・1 = 0. Commutative? Yes, for +: = 0, = 1, = = 1 Yes, for ・: 0 ・ 0 = 0, 1 ・ 1 = 1, 0 ・ 1 = 1 ・ 0 = 0 x ・ y = y・x

15 Verify that Huntington axioms hold
Distributivity? Yes, check using a truth table for・ over +, and + over ・. x y z y+z x.(y+z) x.y x.z (x.y)+(x.z) 1

16 Verify that Huntington axioms hold
Complement? Yes, x + x’ = 1 : 0 + 0’= = 1 ; 1 + 1’= = 1 Yes, x ・ x’ = 0 : 0 ・ 0’= 0 ・ 1 = 0 ; 1 ・ 1’= 1 ・ 0 = 0 6. There exists at least two elements x,yB , such that xy Yes, 01

17 2.2 Basic Definitions (Reading)
2.3 Axiomatic Definition of Boolean Algebra 2.4 Basic Theorems and Properties of Boolean Algebra

18 Basic Theorems and Properties of Boolean Algebra
The principle of duality is an important concept. This says that if an expression is valid in Boolean algebra, the dual of that expression is also valid. To form the dual of an expression, interchange + (OR) operators and . (AND) operators, and replace 1’s with 0’s, and 0’s with 1’s. Form the dual of the expression a + (bc) = (a + b)(a + c) Following the replacement rules… a(b + c) = ab + ac Take care not to alter the location of the parentheses if they are present.

19 Cont. Huntington’s postulates define some rules
Need more rules to modify algebraic expressions Theorems that are derived from postulates What is a theorem? A formula or statement that is derived from postulates (or other proven theorems) Basic theorems of Boolean algebra Theorem 1 (a): x + x = x (b): x · x = x Looks straightforward, but needs to be proven ! Post. 1: closure Post. 2: (a) x+0=x, (b) x·1=x Post. 3: (a) x+y=y+x, (b) x·y=y·x Post. 4: (a) x(y+z) = xy+xz, (b) x+yz = (x+y)(x+z) Post. 5: (a) x+x’=1, (b) x·x’=0

20 Cont.

21 Cont. We can only use Huntington postulates: Show that x+x=x.
x+x = (x+x)·1 by 2(b) = (x+x)(x+x’) by 5(a) = x+xx’ by 4(b) = x+0 by 5(b) = x by 2(a) Q.E.D. We can now use Theorem 1(a) in future proofs Post. 2: (a) x+0=x, (b) x·1=x Post. 3: (a) x+y=y+x, (b) x·y=y·x Post. 4: (a) x(y+z) = xy+xz, (b) x+yz = (x+y)(x+z) Post. 5: (a) x+x’=1, (b) x·x’=0

22 Operator Precedence The operator precedence for evaluating Boolean Expression is Parentheses NOT AND OR Examples x y' + z (x y + z)'

23 2.5 Boolean Functions 2.6 Canonical and Standard Forms 2.8 Digital Logic Gates

24 Boolean Functions A Boolean function expresses the logical relationship between binary variables and is evaluated by determining the binary value of the expression for all possible values of the variables. A Boolean function is an algebraic expression formed of: Binary variables The constants 0 and 1 The logic operation symbols For a given value of the binary variables, the function can be equal to either 0 or 1. Examples F1 (x,y,z) = F1= x y z' F2 (x,y,z) = F2= x + y'z F3 (x,y,z) = F3= x' y' z + x' y z + x y' F4 (x,y,z) = F4= x y' + x' z

25 Boolean function representation Example 1
A boolean function can be represented in a truth table, where the number of rows 2n, for a function of n variables. A boolean function can be represented by a circuit diagram. F2(x,y,z) = F2= x + y'z x Y z F2 1 F2= x + y'z y' y'z

26 Boolean function representation Example 2
F3 (x,y,z) = F3= x' y' z + x' y z + x y' x y z F3 1 x' y' x' y'z F3= x' y' z + x' y z + x y' x' yz xy '

27 Boolean function representation Example 3
F4 (x,y,z) = F4= x y' + x' z x y z F4 1 xy' y' F4= x y' + x' z x' x'z

28 Algebraic Manipulation
When a boolean expression is implemented with logic gates, each term requires a gate and each variable designates an input to gate By manipulating a boolean expression according to the rules of boolean algebra, it is sometimes possible to obtain a simpler expression for the same function and thus reduces the cost of the circuit. To minimize Boolean expressions Reduce the number of terms ,Literals or both

29 Algebraic Manipulation
F3 (x,y,z) = F3= x' y' z + x' y z + x y' = x' z ( y+ y ' ) + x y ' = x' z + x y ' =F4

30 Algebraic Manipulation Examples
F (x,y,z) = F = x' y' +xyz + x' y = x'(y'+y) + xyz = x' + xyz = (x' + x) (x' + yz) = 1 (x' + yz) = x' + yz M (x,y) = M = x+x'y = (x+x')(x+y) = 1 (x+y) = x+y

31 Lets compare the circuits of F = x' y' +xyz + x' y
Here are 2 different but equivalent circuits of F. The one with fewer gates is better: Less cost to build Less power consumption Requires fewer wires and components

32 Complement of a Function
A complement of a function F is F’ can be either obtained by: Truth table : An interchange of 0's for 1's and 1's for 0's in the value of column of F Algebraically: An interchange of AND with OR & (OR with And) operators and complementing each literal. (DeMorgan's theorem) (A+B+C+D F)' = A'B'C'D'... F' (ABCD ... F)' = A'+ B'+C'+D' ... +F‘ A simpler procedure to derive the complement function is to take the dual of the function and complement each literal.

33 Complement of a Function Example
Give the complement of the function F= [x(y'z'+yz)], by truth table and algebraically? Truth table: Algebraically: F' = [x(y'z'+yz)]' = x' + (y'z'+yz)' = x' + (y'z')' (yz)‘ = x' + (y+z) (y'+z') = x' + yz‘+y'z Dual of F = x + (y‘+ z‘ ) (y+z) F ' = x' + (y+z) (y'+z') x y z F F' 1

34 2.5 Boolean Functions 2.6 Canonical and Standard Forms 2.8 Digital Logic Gates

35 Minterms A minterm (standard product): an AND term consists of all literals in their normal form or in their complement form. (from the truth table: x is primed if x=0, x is unprimed if x=1) Example: Given two binary variables x and y, list all the minterms. n variables can be combined to form 2n minterms. Each minterm is true for exactly one combination of inputs. (how?) x y Minterm m0=x'y' 1 m1=x'y m2=xy' m3=xy

36 Maxterms A maxterm(standard sum): an OR term consists of all literals in their normal form or in their complement form. (from the truth table: x is primed if x=1, x is unprimed if x=0) Example: Given two binary variables x and y, list all the Maxterms. n variables con be combined to form 2n maxterms. Each maxterm is false for exactly one combination of inputs. (how?) x y Maxterm M0=x+y 1 M1=x+y' M2=x‘+y M3=x‘+y'

37 Minterm and Maxterm are related
Each maxterm is the complement of its corresponding minterm, and vice versa. Mn ' = mn Example: M0 ' = m0

38 Minterm and Maxterm (cont.)
Any Boolean function can be expressed from a truth table by: Forming a minterm for each combination of the variables that produces a 1 in the function and then taking the OR of all those terms f1 = x'y'z + xy'z' + xyz = m1 + m4 +m7 (Minterms) The ORing of minterms

39 Minterm and Maxterm (cont.)
The complement of a Boolean function: F 1= x' y' z + x y'z ' + x y z The minterms that produce a 0 f1' = m0 + m2 +m3 + m5 + m6= x'y'z'+x'yz'+x'yz+xy'z+xyz' f1 = (f1')' = (x+y+z)(x+y'+z) (x+y'+z') (x'+y+z')(x'+y'+z) = M0 M2 M3 M5 M6 Any boolean function can be expressed as a product of Maxterms (the ANDing of maxterms )

40 Minterm and Maxterm (cont.)
Any Boolean function can be expressed as: A sum of minterms (“sum” meaning the ORing of terms) (SOP). A product of maxterms (“product” meaning the ANDing of terms) (POS). Both Boolean functions are said to be in Canonical form (Why?). Because SOP contains all possible combination of minterms. and, POS contains all possible combination of maxterms.

41 Sum of Minterms (SOP) Sum of minterms: there are 2n minterms and 22n combinations of function with n Boolean variables. Example 2.4: express F = A+BC' as a sum of minterms. Either algebraically: F = A+B'C = A (B+B') + B'C = AB +AB' + B'C = AB(C+C') + AB'(C+C') + (A+A')B'C = ABC+ABC'+AB'C+AB'C'+A'B'C F = A'B'C +AB'C' +AB'C+ ABC'+ ABC = m1+m4+m5+m6+ m7 F(A, B, C) = S(1, 4, 5, 6, 7) or, built the truth table first ( 1 for which A=1 and BC=01)

42 Product of Maxterms (POS)
Product of maxterms: using distributive law to expand. x + yz = (x + y)(x + z) = (x+y+zz') (x+z+yy') = (x+y+z) (x+y+z') (x+y'+z)

43 Product of Maxterms (POS)
Example 2.5: express F = xy + x'z as a product of maxterms. F = xy + x'z = (xy + x') (xy +z) (distributive law) =(x+x')(y+x')(x+z)(y+z) = (x'+y)(x+z)(y+z) x'+y = x' + y + zz' = (x'+y+z)(x'+y+z') // term 1 x+z = x + z + yy' = (x+y+z)(x+y'+z) // term 2 y+z = y + z + xx' = (x+y+z)(x'+y+z) // term 3 Combine all terms and remove those which appear more than once F = (x+y+z)(x+y'+z)(x'+y+z)(x'+y+z') = M0M2M4M5 F(x, y, z) = P(0, 2, 4, 5)

44 Cont. The complement of a function expressed as the sum of minterms equals the sum of minterms missing from the original function. F(A, B, C) = S(1, 4, 5, 6, 7) Thus, F'(A, B, C) = S(0, 2, 3) By DeMorgan's theorem F(A, B, C) = P(0, 2, 3) F'(A, B, C) =P (1, 4, 5, 6, 7) mj' = Mj Sum of minterms = product of maxterms S of 1's P of 0's Total # 2n

45 Conversion between Canonical Forms
Example F = xy + xz F(x, y, z) = S(1, 3, 6, 7) F(x, y, z) = P (0, 2, 4, 5) To convert from one canonical form to another, interchange the Symbols S and P and list those numbers missing from the original form.

46 Standard Forms Canonical forms are very seldom the ones with the least number of literals, because each minterm or maxterm must contain all the variables Standard forms: the terms that form the function may contain one, two, or any number of literals. Sum of products: F1 = y' + xy+ x'yz' Product of sums: F2 = x(y'+z)(x'+y+z') Sum of product is represented by a group of AND gates followed by a single OR gate. A product of sum is represented by a group of OR gates followed by a single AND gate. Non standard form ex: F3=AB +C (D+E)

47 2.5 Boolean Functions 2.6 Canonical and Standard Forms 2.8 Digital Logic Gates

48 Summary of Logic Gates Figure 2.5 Digital logic gates

49 Summary of Logic Gates Figure 2.5 Digital logic gates

50 Multiple Inputs All gates except for the inverter and buffer can be extended to have more than two inputs. NAND and NOR are commutative but not associative → their gates can be extended to have more than 2 inputs if we define the multiple NOR(or Nand)gate as a complemented OR (or AND) gate

51 Figure 2.7 Multiple-input and cascated NOR and NAND gates
Multiple Inputs Multiple NOR = a complement of OR gate, Multiple NAND = a complement of AND. The cascaded NAND operations = sum of products. The cascaded NOR operations = product of sums. Figure 2.7 Multiple-input and cascated NOR and NAND gates

52 Multiple Inputs The XOR and XNOR gates are commutative and associative and can be extended to more than two inputs. Multiple-input XOR gates are uncommon? XOR is an odd function: it is equal to 1 if the inputs variables have an odd number of 1's. Figure input XOR gate

53 Reading Chapter 2: , 2.6, 2.8


Download ppt "Chapter 2 Boolean Algebra and Logic Gate"

Similar presentations


Ads by Google