Digital System Design Boolean Algebra and Logic Gate - PowerPoint PPT Presentation

1 / 51
About This Presentation
Title:

Digital System Design Boolean Algebra and Logic Gate

Description:

Axioms: associativity, distributivity, closure, identity elements, etc. ... X 0 = X -- Zero Axiom. X 1 = X -- Unit Axiom. X 1 = 1 -- Unit Property ... – PowerPoint PPT presentation

Number of Views:1264
Avg rating:3.0/5.0
Slides: 52
Provided by: pradondet
Category:

less

Transcript and Presenter's Notes

Title: Digital System Design Boolean Algebra and Logic Gate


1
Digital System DesignBoolean Algebra and Logic
Gate
  • Assoc. Prof. Pradondet Nilagupta
  • pom_at_ku.ac.th

2
Acknowledgement
  • This lecture note is modified from Engin112
    Digital Design by Prof. Maciej Ciesielski, Prof.
    Tilman Wolf, University of Massachusetts Amherst
    and original slide from publisher

3
Algebras
  • What is an algebra?
  • Mathematical system consisting of
  • Set of elements
  • Set of operators
  • Axioms or postulates
  • 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.
  • Note operators with two inputs are called binary
  • Does not mean they are restricted to binary
    numbers!
  • Operator(s) with one input are called unary

4
George Boole
  • Father of Boolean algebra
  • He came up with a type of linguistic algebra, the
    three most basic operations of which were (and
    still are) AND, OR and NOT. It was these three
    functions that formed the basis of his premise,
    and were the only operations necessary to perform
    comparisons or basic mathematical functions.
  • Booles system (detailed in his 'An Investigation
    of the Laws of Thought, on Which Are Founded the
    Mathematical Theories of Logic and
    Probabilities', 1854) was based on a binary
    approach, processing only two objects - the
    yes-no, true-false, on-off, zero-one approach.
  • Surprisingly, given his standing in the academic
    community, Boole's idea was either criticized or
    completely ignored by the majority of his peers.
  • Eventually, one bright student, Claude Shannon
    (1916-2001), picked up the idea and ran with it

George Boole (1815 - 1864)
5
Axioms of Algebraic Structures
  • A set of elements B and two binary operators
    and ?
  • Closure w.r.t. the operator (?)
  • x, y ?B ? xy ?B
  • Associative w.r.t. (?)
  • (xy)z x (yz)
  • (x?y) ?z x? (y?z)
  • Commutative w.r.t. (?)
  • xy yx
  • x?y y?x

6
Axioms of Algebraic Structures
  • An identity element w.r.t. (?)
  • 0x x0 x
  • 1?x x?1 x
  • ? x ? B, ? x' ? B (complement of x)
  • ? xx'1 and x?x'0
  • ? is distributive over x?(yz)(x?y)(x?z)
  • is distributive over? x(y?z)(xy)?(xz)
  • Note
  • the associative law can be derived
  • no additive and multiplicative inverses
  • complement

7
Boolean Algebra
  • We need to define algebra for binary values
  • Developed by George Boole in 1854
  • Huntington postulates for Boolean algebra (1904)
  • Closure with respect to operator and operator
  • Identity element 0 for operator and 1 for
    operator
  • Commutativity with respect to and
  • xy yx, xy yx
  • Distributivity of over , and over
  • x(yz) (xy)(xz) and x(yz)
    (xy)(xz)
  • Complement for every element x is x with xx1,
    xx0
  • There are at least two elements x,y?B such that
    x?y

8
Boolean Algebra
  • VERY nice machinery used to manipulate (simplify)
    Boolean functions
  • George Boole (1815-1864) An investigation of
    the laws of thought
  • Terminology
  • Literal A variable or its complement
  • Product term literals connected by
  • Sum term literals connected by

9
Two-valued Boolean Algebra
  • Two-valued Boolean is defined as
  • A set of elements B 0,1
  • operator operator
  • inverse
  • Observation?
  • is OR, is AND, is NOT

10
Boolean Algebra Properties
  • Let X boolean variable, 0,1 constants
  • X 0 X -- Zero Axiom
  • X 1 X -- Unit Axiom
  • X 1 1 -- Unit Property
  • X 0 0 -- Zero Property
  • X X X -- Idepotence
  • X X X -- Idepotence
  • X X 1 -- Complement
  • X X 0 -- Complement
  • (X) X -- Involution

11
Duality
  • 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, replace all
    operators with . operators, all . operators with
    operators, all ones with zeros, and all zeros
    with ones.
  • 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.

12
Basic Theorems and Properties of Boolean Algebra
  • Duality
  • the binary operators are interchanged AND lt-gt
    OR
  • the identity elements are interchanged 1 lt-gt 0

13
Boolean Theorems
  • Huntingtons 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) x0x, (b)
x1x Post. 3 (a) xyyx, (b) xyyx Post. 4
(a) x(yz) xyxz, (b) xyz
(xy)(xz) Post. 5 (a) xx1, (b) xx0
14
Proof of xxx
  • We can only useHuntington postulates
  • Show that xxx.
  • xx (xx)1 by 2(b)
  • (xx)(xx) by 5(a)
  • xxx by 4(b)
  • x0 by 5(b)
  • x by 2(a)
  • Q.E.D.
  • We can now use Theorem 1(a) in future proofs

Huntington postulates Post. 2 (a) x0x, (b)
x1x Post. 3 (a) xyyx, (b) xyyx Post. 4
(a) x(yz) xyxz, (b) xyz
(xy)(xz) Post. 5 (a) xx1, (b) xx0
15
Proof of xxx
  • Similar to previous proof
  • Show that xx x.
  • xx xx0 by 2(a)
  • xxxx by 5(b)
  • x(xx) by 4(a)
  • x1 by 5(a)
  • x by 2(b)
  • Q.E.D.

Huntington postulates Post. 2 (a) x0x, (b)
x1x Post. 3 (a) xyyx, (b) xyyx Post. 4
(a) x(yz) xyxz, (b) xyz
(xy)(xz) Post. 5 (a) xx1, (b) xx0 Th.
1 (a) xxx
16
Absorption Property (Covering)
  • x xy x
  • x(xy) x (dual)
  • Proofx xy x1 xy x(1y)
    x1 xQED (2 true by duality)

17
Consensus Theorem
  • xy xz yz xy xz
  • (xy)(xz)(yz) (xy)(xz) -- (dual)
  • Proofxy xz yz xy xz (xx)yz
    xy xz xyz xyz (xy xyz) (xz
    xzy) xy xzQED (2 true by duality).

18
Theorems to Apply to Exclusive-OR
19
Boolean Functions
  • Elements and operators can express a function
  • Value of function determined by value of
    variables
  • Complete function is evaluated for all possible
    values
  • Function can be represented by truth table
  • E.g., F x yz
  • Evaluate in steps
  • E.g., y and yz

20
Logic Circuit Diagram of Function
  • Logic function can be expressed as circuit
    diagram
  • Direct translation from algebraic expression
  • Example F x yz
  • Problem possibly multiple equivalent algebraic
    expressions
  • Difficult to compare Boolean functions

21
Design Problem
  • Design the control logic for a fan in a
    greenhouse.
  • The logic must sense three environmental
    conditions
  • It is raining outside (variable x)
  • It is humid inside (variable y)
  • It is hot inside (variable z)
  • The fan should turn on when
  • It is humid AND it is not raining AND it is hot
  • yxz
  • OR
  • It is not humid AND ((its not raining AND it is
    hot) OR it is raining)
  • y (xzx)
  • Create a Boolean function that controls the fan.
  • F1 yxz y(xzx)
  • F2 xyzxyzxy F3 xzxy
  • Question How to evaluate these solutions
    (equivalent functions)?

22
Boolean Function Representations
  • Greenhouse example function can be expressed as
  • Analytically, as sum of minterms
  • yxz y(xzx) yxzyxzyx
  • xyzxyzxy(zz)
  • xyzxyzxyzxyz
  • As a truth table
  • As a logic network
  • How to derive different solutions ?
  • How to evaluate these solutions ?

23
Comparison of Boolean Functions
  • How to compare expressions?
  • From the Greenhouse Example
  • Is yxz y(xzx) xzxy ? (are these
    functions equivalent?)
  • yxz y(xzx) yxzyxzyx
  • (yy)xzyx
  • xzxy
  • Yes, both expressions describe the same function
    (equivalent)
  • Problem hard to compare algebraic expressions
  • Easier with gate level comparison?

24
Comparison of Boolean functions
  • Comparison by algebraic expression
  • Good can handle many variables
  • Bad not clear how to get from one expression to
    another
  • Comparison on gate level
  • Bad same as algebraic expression
  • Bad hard to modify for comparison
  • Comparison by truth table
  • Good Only one representation in truth table
  • Bad cumbersome for 4 or more variables
  • Bad hard to derive gate level implementation
  • Comparison with canonical form
  • Good standardized form for algebraic expression
  • Bad not necessarily solution with least number
    of gates

25
Canonical Form
  • A form is canonical if representation of a
    function in this form is unique
  • Truth table is canonical representation
  • Uses minterms as basic component
  • A minterm is a product (ANDing) of all variables
  • Each variable of function appears in minterm
  • Variable is in normal form (x) or in
    complemented form (x)
  • Example minterms for 3-variable function
  • All algebraic expressions
  • can be converted into canonical form

26
Canonical Form
  • Function is expressed as sum of minterms
  • Greenhouse example yxz y(xzx)
    yxzyxzyx
  • xyzxyzxy(zz)
  • xyzxyzxyzxyz
  • m3 m1 m5 m4
  • Function sum of all minterms where truth
    table is 1

27
Canonical Form
  • Canonical form Sum of minterms
  • Example FABC
  • Expansion of mintermsA ABCABCABCABCBC
    ABCABC
  • F ABCABCABC
  • ABCABC
  • Alternate forms
  • Fm1m4m5m6m7
  • F?(1,4,5,6,7)
  • Is this the only canonical form?
  • No, other forms exist (dual form, etc.)

28
DeMorgans Theorem
  • A key theorem in simplifying Boolean expressions
  • DeMorgans theorem expresses duality
  • For two variables
  • (x y) x ? y
  • (x ? y) x y
  • Can be generalized to arbitrary number of
    variables
  • (abc z) a b c z , or (? xi)
    ? xi
  • (a b c ? ? ? z) abcz , or (?
    xi) ? xi
  • where ? OR, ? AND
  • Proof for DeMorgans theorem by truth tables
  • See Mano p. 59

29
Dual Canonical Form
  • Sum of minterms can be converted to product of
    maxterms
  • Maxterms contain every variable in the function
  • Each maxterm is an OR of variables in different
    polarities
  • Function is a product (ANDing) of maxterms where
    truth table is 0
  • Due to duality
  • mj Mj
  • Example
  • F M0M2M3
  • (ABC)(ABC)(ABC)
  • From DeMorgan
  • F ABCABCABC
  • m0m2m3
  • Complement on both sides
  • F m1m4m5m6m7
  • Both canonical forms expresssame function

30
Dual Canonical Form
  • Sum of minterms can be converted to product of
    maxterms
  • Recall
  • A minterm is a product (AND) of all variables in
    respective polarities (positive or complemented)
  • e.g., a b c is a minterm for a 3-variable
    function
  • Note a b is not a minterm in a 3-variable
    function
  • (it is a product term)
  • Function is OR of minterms where F 1
  • A maxterm is a sum (OR) of all variables in
    respective polarities
  • Maxterm contains every variable in the function
  • All the variables are OR-ed together in a maxterm
  • Function is product (AND) of maxterms where F 0

31
Dual Canonical Form
  • Function is product (AND) of maxterms where F 0
  • Duality (DeMorgan)
  • (? xi) ? xi
  • mj Mj
  • Example F (m1,m4,m5,m6,m7)
  • Examine the complement of F
  • F m0m2m3
  • ABC ABC ABC
  • Take a complement (DeMorgan)
  • (F) (ABC)(ABC)(ABC)
  • M0M2M3
  • Since (F) F
  • F M0M2M3
  • m1m4m5m6m7
  • Both canonical forms express same function
  • F ? mi ? Mi

32
Example
  • Truth table for f1(a,b,c) at right
  • The canonical sum-of-products form for f1
    isf1(a,b,c) m1 m2 m4 m6
    abc abc abc abc
  • The canonical product-of-sums form for f1
    isf1(a,b,c) M0 M3 M5 M7
    (abc)(abc)
    (abc)(abc).
  • Observe that mj Mj

33
Shorthand ? and ?
  • f1(a,b,c) ? m(1,2,4,6), where ? indicates that
    this is a sum-of-products form, and m(1,2,4,6)
    indicates that the minterms to be included are
    m1, m2, m4, and m6.
  • f1(a,b,c) ? M(0,3,5,7), where ? indicates that
    this is a product-of-sums form, and M(0,3,5,7)
    indicates that the maxterms to be included are
    M0, M3, M5, and M7.
  • Since mj Mj for any j, ? m(1,2,4,6) ?
    M(0,3,5,7) f1(a,b,c)

34
Conversion Between Canonical Forms
  • Replace ? with ? (or vice versa) and replace
    those js that appeared in the original form with
    those that do not.
  • Examplef1(a,b,c) abc abc abc abc
    m1 m2 m4 m6 ?(1,2,4,6)
    ?(0,3,5,7) (abc)(abc)(abc
    )(abc)

35
Standard Forms (NOT Unique)
  • Standard forms are like canonical forms, except
    that not all variables need appear in the
    individual product (SOP) or sum (POS) terms.
  • Examplef1(a,b,c) abc bc acis a
    standard sum-of-products form
  • f1(a,b,c) (abc)(bc)(ac)is a standard
    product-of-sums form.

36
Conversion of SOP from standard to canonical form
  • Expand non-canonical terms by inserting
    equivalent of 1 in each missing variable x (x
    x) 1
  • Remove duplicate minterms
  • f1(a,b,c) abc bc ac abc
    (aa)bc a(bb)c abc abc abc
    abc abc abc abc abc abc

37
Conversion of POS from standard to canonical form
  • Expand noncanonical terms by adding 0 in terms of
    missing variables (e.g., xx 0) and using the
    distributive law
  • Remove duplicate maxterms
  • f1(a,b,c) (abc)(bc)(ac)
    (abc)(aabc)(abbc)
    (abc)(abc)(abc)
    (abc)(abc) (abc)(abc)(ab
    c)(abc)

38
Sum of Product (SOP) Form
  • Any function can be expressed as Sum of Products
    (SOP)
  • A product term is a product (AND) of the
    variables in respective polarities
  • Minterm is a special case of product term (has
    all variables)
  • SOP is not canonical, many SOP forms exist for
    same function
  • Greenhouse example yxz y(xzx) xyz
    xyz x y
  • xz yz

SOP has natural representation in practice, as
two-level logic network
  • SOP table
  • (list only for F1)

39
Counting Boolean Functions
  • Now we can express algebraic functions uniquely
  • Unique sum of minterms or product of maxterms
    representations
  • How many binary Boolean functions exist?
  • How many different combinations of minterms can
    one pick?
  • There are 4 minterms in a binary function
  • Each minterm can be present in the sum or not
  • Two choices for each minterm
  • Total 2416 combination
  • How many Boolean functions exist with n
    variables?
  • 2n minterms
  • Total 22n combinations

40
Truth Table of Two Binary Variables
41
Possible combinations Binary Boolean Functions
42
Digital Logic Gates
Name Graphics Algebraic
Truth Symbols Function
Table
43
Digital Logic Gates
Name Graphics Algebraic
Truth Symbols Function
Table
44
Multiple-input Gates
  • NOR does not extend easily
  • Associativity does not hold
  • Multiple-input gate

45
Multiple Input NAND and NOR
  • Multiple NOR a complement of OR gate
  • Multiple NAND a complement of AND gate
  • The cascaded NAND operations sum of products
  • The cascaded NOR operations product of sums

46
Multiple-input XOR
  • Extension of exclusive-OR not straightforward
  • What is the definition for 3 variables?
  • Turns into odd function
  • Function is 1 when there is an odd number of 1s
  • Uncommon in hardware implementations

47
Positive and Negative Logic
  • Signal levels are represented as H (high) and L
    (low)
  • e.g., H is 5V and L is 0V
  • Positive logic
  • H corresponds to logic 1
  • L corresponds to logic 0
  • Negative logic
  • H corresponds to logic 0
  • L corresponds to logic 1
  • User has choice of logic used

48
Positive and Negative Logic
  • Truth table with H and L
  • In positive logic AND
  • In negative logic OR

Arrows indicate negative logic
49
Integrated Circuits
  • Small-scale integration (SSI)
  • 10s of logic gates
  • Early 60s for Apollo and Minuteman missiles
  • Medium-scale integration (MSI)
  • 100s 1,000s of logic gates
  • Late 60s
  • Large-scale integration (LSI)
  • 1,000s 10,000s of logic gates
  • Mid 70s
  • Very large-scale integration (VLSI)
  • 100,000s of logic gates
  • 80s
  • Ultra large-scale integration (ULSI)
  • Millions of logic gates
  • 90s and 00s

50
The characteristics of digital logic families
  • Fan-out the number of standard loads that the
    ouput of a typical gate can drive
  • Power dissipation
  • Propagation delay the average transition delay
    time for the signal to propagate from input to
    output
  • Noise margin the minimum of external noise
  • voltage that caused an undesirable change in the
    circuit output

51
Chip Design
  • Why is it better to have more gates on a single
    chip?
  • Easier to build systems
  • Lower power consumption
  • Higher clock frequencies
  • What are the drawbacks of large circuits?
  • Complex to design
  • Chips have design constraints
  • Hard to test
  • Need tools to help develop integrated circuits
  • Computer Aided Design (CAD) tools
  • Automate tedious steps of design process
  • Hardware description language (HDL) describe
    circuits
  • VHDL (see the lab) is one such system
Write a Comment
User Comments (0)
About PowerShow.com