Thinking Mathematically by Robert Blitzer

Document Sample
Thinking Mathematically by Robert Blitzer Powered By Docstoc
					Boolean Algebra
       Boolean Algebra: Structure
 Instudying propositional logic (true, false),
 we learned about certain operators, that can
 be viewed as functions f:{T, F}2→{T, F}.

 Forexample, (T, T) = T, (T, F) = T,
 (F, T) = T, and (F, F) = F.

 From there,
            we learned about certain
 fundamental properties of wff's:
    Boolean Algebra: Structure
   ABBA          ABBA
                             commutative laws
   (A  B)  C  A  (B  C)
                   (A  B)  C  A  (B  C)
                             associative laws
   A  (B  C)  (A  B)  (A  C)
                A  (B  C)  (A  B)  (A  C)
                             distributive laws
   A  F  A A  T  A identity laws
   A  A'  T A  A'  F complement laws
     Boolean Algebra: Structure
   We also studied sets, and within Set
    Theory we discovered that given sets A,
    B and C within a universe U:
    Boolean Algebra: Structure
   AB=BA           AB=BA
                            commutative laws
   (A  B)  C = A  (B  C)
                    (A  B)  C = A  (B  C)
                            associative laws
   A  (B  C) = (A  B)  (A  C)
                 A  (B  C) = (A  B)  (A  C)
                            distributive laws
   AF=A        AU=A          identity laws
   A  A' = U A  A' =  complement laws
   Boolean Algebra: Structure
 One  of the beauties of mathematics is
  that there is a lot of consistency and
  many recurring patterns.
 Many different models satisfy the same
  (or similar) properties.
 Systems like the ones we have just seen
  are examples of a model called a
  Boolean algebra.
      Boolean Algebra: Structure
A Boolean algebra is a set B on which are
 defined
     two binary operations: + and 
     and one unary operation '
 and   in which there are two distinct elements
     0 (additive identity)
     and 1 (multiplicative identity)
 such  that the following properties hold for
 all x, y, z  B:
    Boolean Algebra: Structure
   x+y=y+x                   xy=yx
                                   commutative laws
   (x + y) + z = x + (y + z)
                             (x  y)  z = x  (y  z)
                                   associative laws
   x + (y  z) = (x + y)  (x + z)
                          x  (y + z) = (x  y) + (x  z)
                                   distributive laws
   x+0=x             x1=x        identity laws
   x + x' = 1       x  x' = 0    complement laws
       Boolean Algebra: Structure
   Example:
      Consider the set B = {0, 1} and define the operations +

       and  to be x + y = max(x, y) and x  y = min(x, y). Let 0'
       = 1 and 1' = 0.
      The above forms a Boolean algebra.

        • commutative: obviously max(x,y) = max(y,x)
          and the same for min.
        • associative: intuitively true.
        • distributive: max(x, min(y,z)) =
                            min(max(x,y), max(x,z))
        • identity
        • complement
      Boolean Algebra: Structure
 The    idempotent property: x + x = x
     x + x = (x + x)  1        multiplicative identity

           = (x + x)  (x + x') additive complement
           = x + (x  x')       distributive property
           =x+0               multiplicative complement
           =x                      additive identity
      Boolean Algebra: Structure
 The   Principle of Duality:
     If some equality holds within a Boolean
      algebra, then the corresponding equality
      obtained by substituting
       • + for ,
       •  for +,
       • 0 for 1
       • and 1 for 0
     will also be true.
      Boolean Algebra: Structure
 Uniqueness:  If x + x1 = 1 and x  x1 = 0,
  then x1 = x'.
 De Morgan: (x + y)' = x'  y',
               (x  y)' = x' + y'
 Absorption: x + (x  y) = x,
               x  (x + y) = x
 Double negation: (x')' = x
     Boolean Algebra: Structure
 One   more thing:
    If (B, + , , ') is a Boolean algebra, then |B|
     = 2n
           Logic Networks
 Claude    Shannon (1938)
     Boolean algebras and logic circuits.
  x=1                   x=0

            x=1
                              1
            x=0
               Logic Networks

A      B      A+B   A      B       A B
                                          A          A'
1      1       1    1      1        1
                                          1          0
1      0       1    1      0        0
                                          0          1
0      1       1    0      1        0
                                          inverter
0      0       0    0      0        0
    OR gate             AND gate
               Logic Networks

A    B (A + B)'     A    B   (A  B)'
1    1    0         1    1      0
1    0    0         1    0      1
0    1    0         0    1      1
0    0    1         0    0      1
    NOR gate            NAND gate
      Logic Networks and Truth
               Tables
 Consider a truth table involving three
 variables.
     There will be 23 = 8 lines.
     There are 2  23 = 28 = 256 unique truth tables.

     Each truth table can be represented by
      logic circuits using the basic gates shown
      earlier.
    Logic Networks and Truth
             Tables
   Consider the following table:
          x1   x2   x3   f(x1,x2,x3)
          1    1    1         1
          1    1    0         0
          1    0    1        1
          1    0    0        1
          0    1    1        0
          0    1    0        0
          0    0    1        1
          0    0    0        0
    Logic Networks and Truth
             Tables
 The truth table on the previous slide
  can be implemented by any number
  of logic circuits using AND, OR and
  inverter gates in combination.
 One such circuit can be built using

  the sum-of-products notation.
 Let's go back to that table.
Logic Networks and Truth
         Tables
   x1   x2   x3   f(x1,x2,x3)
   1    1    1        1         x1x2x3      sum of
   1    1    0        0                    products
   1    0    1        1         x1x'2x3
   1    0    0        1         x1x'2x'3
   0    1    1        0
   0    1    0        0
   0    0    1        1         x'1x'2x3
   0    0    0        0
x1x2x3 + x1x'2x3 + x1x'2x'3 + x'1x'2x3
     Logic Circuits and Truth Tables
x1
x2
x3

x1
x2
x3

x1
x2
x3

x1
x2
x3
Logic Circuits and Truth Tables
 But  is this the only circuit that
  corresponds to the earlier truth table?
 Not by a long shot!
 Consider the expression x1x3 + x1x'2 +
  x'2x3
Logic Circuits and Truth Tables
x1   x2   x3   x1x3   x1x'2   x'2x3     x 1x 3 +
                                      x1x'2+x'2x3
1    1    1     1      0       0           1
1    1    0     0      0       0           0
1    0    1     1      1       1           1
1    0    0     0      1       0           1
0    1    1     0      0       0           0
0    1    0     0      0       0           0
0    0    1     0      0       1           1
0    0    0     0      0       0           0
Logic Circuits and Truth Tables
 The   truth table on the previous slide is
  identical to the earlier one.
 Note that it only requires three AND
  gates leading to the OR gate.
 Note that each of these AND gates
  requires only 2 (not 3) inputs.
 It's simpler.
 It's cheaper.
            Minimization
 There  is a technique for finding the
  minimal circuit for a given truth table.
 It involves a special map called the
  Karnaugh Map.
 Here are the general pictures for
  Karnaugh Maps corresponding to two-
  variable, three-variable and four-
  variable expressions.
                   Karnaugh Maps
       x1 x'1                 x1x2   x1x'2 x'1x'2 x'1x2
x2      1      1
                        x3      1     1     1     1
x'2
                        x'3     1     1           1

               x1x2   x1x'2 x'1x'2 x'1x2
      x3x4
      x3x'4
      x'3x'4
      x'3x4
           Karnaugh Maps
 Note that adjacent squares have only one
  variable that changes (e.g. – x1 to x'1)
 Note that Karnaugh Maps "wrap around",
  top-to-bottom, left-to-right.
 We look for sub-rectangles (perhaps
  wrapping around) with both the number of
  rows and the number of columns being
  powers of two (1, 2, 4, etc.)
          Karnaugh Maps
 Find  the smallest number of largest
  rectangles that cover all the 1's and
  only the 1's.
 Each rectangle is a product of
  variables (or inverses of variables).
 The simplest expression is the sum of
  these rectangles.
              Karnaugh Maps
 Consider    the following map:
              x1x2     x1x'2  x'1x'2       x'1x2
   x3x4         1         1            1
  x3x'4         1         1
  x'3x'4                  1
  x'3x4

           x1x3 + x'2x3x4 + x1x'2x'4
              Karnaugh Maps
 Consider    the following map:
              x1x2     x1x'2  x'1x'2       x'1x2
   x3x4         1         1            1
  x3x'4         1         1
  x'3x'4                  1
  x'3x4

           x1x3 + x'2x3x4 + x1x'2x'4
              Karnaugh Maps
 Consider   the following map:
             x1x2     x1x'2  x'1x'2       x'1x2
   x3x4        1                    1      1
  x3x'4
  x'3x'4                  1
  x'3x4        1                           1

           x2x4 + x'1x3x4 + x1x'2x’3x'4
                Karnaugh Maps
 Consider      the following map:
                x1x2     x1x'2  x'1x'2   x'1x2
   x3x4          1        1       1       1
  x3x'4          1                        1
  x'3x'4         1                        1
  x'3x4          1                        1

           x2    + x3x4

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:7
posted:9/30/2012
language:Unknown
pages:32