unit 1 - boolean algebra

Upload: tomhaks

Post on 05-Apr-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Unit 1 - Boolean Algebra

    1/28

    Combinational vs.Sequential Circuits

    Acombinationalcircuithas inputs, outputs andan internal logic circuit

    Constitutes a mappingfrom the inputs to theoutputs

    Asequentialcircuit hasinputs, outputs, aninternal logic circuit and

    binary cellsas memory

    Abinary cellis a memorydevice with two possible states.

  • 8/2/2019 Unit 1 - Boolean Algebra

    2/28

    Boolean Algebra

    Variables in a Booleanalgebra take on valuesthat are not numbers

    but logical values:TRUE or FALSE

    x= TRUE, y = FALSE George Boole1815 - 1864

    It is not of the essence of mathematics to be conversant with

    the ideas of number and quantity.

    ~ An Investigation into the Laws of Thought, on Which are

    Founded the Mathematical Theories of Logic and Probabilities

  • 8/2/2019 Unit 1 - Boolean Algebra

    3/28

  • 8/2/2019 Unit 1 - Boolean Algebra

    4/28

    LOW

    HIGH

    Logical Variables

    Logical variables takeonly two values:

    1.0

    3.0

    0.4

    0.2

    Voltage

    Level[V]

    In actual computers,

    these are representedby voltage levels

    TRUE 1 HIGHFALSE 0 LOW

  • 8/2/2019 Unit 1 - Boolean Algebra

    5/28

    Logical Operators

    Logical operatorsmathematicallyassociate one or more

    (logical) input valueswith a single (logical)output value

    Logic gates are thephysical devices that

    perform logicaloperations (forinstance, in circuits)

    Basic Logical Operators

    One Input

    Two (or More) Inputs

    NOT(negation)

    OR

    (disjunction)

    AND(conjunction)

  • 8/2/2019 Unit 1 - Boolean Algebra

    6/28

    Switching Circuits

    Boolean algebra was firstapplied to switching circuits

    ORgate

    ANDgate

    Light

    Bulb

    Battery

    LightBulb

    Battery

    xy

    xy

    x y

    y

    x

    In the input, use a '1' to represent a closed switch, a'0' for an open switch; in the output, use a '1' for a lit

    bulb, a '0' for an unlit bulb

  • 8/2/2019 Unit 1 - Boolean Algebra

    7/28

    Truth Tables

    Since there are only two possible values (0 or 1) for

    any logical variable, we can define each of thelogical operations by the output they produce givenall of the possible inputs

    x

    0 11 0

    NOT

    xx

    NOTgate(inverter)

    xor

    (Logic) xor

    x

    F TT F

    x

  • 8/2/2019 Unit 1 - Boolean Algebra

    8/28

    Truth Tables

    x y xy

    0 0 00 1 0

    1 0 0

    1 1 1

    AND

    xy

    *x y

    ANDgate

    xyor

    x y(Logic)or

  • 8/2/2019 Unit 1 - Boolean Algebra

    9/28

    Truth Tables

    x y x + y

    0 0 00 1 1

    1 0 1

    1 1 1

    OR

    x

    yx + y

    ORgate

    x y(Logic)or

  • 8/2/2019 Unit 1 - Boolean Algebra

    10/28

    Order of Operations

    The logical operatorshave an order ofprecedence:

    1. NOT

    2. AND

    3. OR

    F = x + yz

    G x + y z

    H = x + yz

    J x + yzAs usual brackets canalways be used tochange the order ofprecedence

    BooleanExpressions

  • 8/2/2019 Unit 1 - Boolean Algebra

    11/28

    Boolean Postulates

    The truth tables for each of the basic logicaloperations can also be stated as postulatesfor anew kind of algebra a Boolean algebra

    0 0 00*0 0 P2a P2b

    1 1 11*1 1 P3a P3b

    0 1 11*0 0 P4a P4b

    1 0 0 1 P5a P5b

    1 if 0 0 if 1x x x x P1a P1b

    Boolean

    algebra is

    closed overthe values

    {0, 1}

  • 8/2/2019 Unit 1 - Boolean Algebra

    12/28

    Boolean Algebra

    This new algebra of logical operators has severalproperties in common with the more familiaralgebra of addition and multiplication

    Commutative Property

    Associative Property

    The order in which Boolean

    variables areANDedorOReddoesnt matter to the result

    The manner in which ANDedorORedBoolean variablesare groupeddoesnt matter to

    the result

    * *

    x y

    x y y x

    y x

    * * * *

    x y

    x

    z x

    y z

    y

    z

    z

    x y

  • 8/2/2019 Unit 1 - Boolean Algebra

    13/28

    Boolean Algebra

    Boolean algebra has one more property that is notfamiliar from the algebra of addition and multiplication

    Distributive Property I

    * * *x y z x y x z

    Distributive Property II

    * *x y z x y x z

  • 8/2/2019 Unit 1 - Boolean Algebra

    14/28

    Relation to Set Theory

    The logical operators are related to set theory

    NOT

    OR

    AND

    x

    x + y

    *x y

    complement

    union

    intersection

    x

    x y

    x y

    x

    x yx yx y

  • 8/2/2019 Unit 1 - Boolean Algebra

    15/28

    Relation to Set Theory

    In terms of set theory, this corresponds to:

    0 0 00*0 0 P2a P2b

    There is no intersection between oneempty set and another empty set.

    The union of one empty set and

    another empty set is still empty.

    Note: Since a 0indicates a Boolean value FALSE,the set ofTRUE values with which it is associated is

    empty. Hence, a 0 corresponds to the empty set.

  • 8/2/2019 Unit 1 - Boolean Algebra

    16/28

    Relation to Set Theory

    In terms of set theory, this corresponds to:

    0 1 11*0 0 P4a P4b

    There is no intersection between theentire universe and an empty set.

    The union of the entire universe and

    an empty set is still the universe.

    U U

    U

    Note: Since a 1indicates TRUE, the set ofTRUEvalues with which it is associated is the entire universe

    of possibilities. Hence, a 1 corresponds to the universe.

  • 8/2/2019 Unit 1 - Boolean Algebra

    17/28

    Boolean Theorems

    In terms of set theory, this corresponds to:

    *0 0x T9a

    There is no intersection between a

    setx and an empty set.x

    In terms of truth tables, this corresponds to:

    x x *00 0 by P2a

    1 0 by P4a

  • 8/2/2019 Unit 1 - Boolean Algebra

    18/28

    Boolean Theorems

    0x x T9b

    The union of a setx and an empty

    set is still the setx.x x

    In terms of truth tables, this corresponds to:

    In terms of set theory, this corresponds to:

    x x +00 0 by P2b

    1 1 by P4b

    0 is the identityelementwithrespect to OR

  • 8/2/2019 Unit 1 - Boolean Algebra

    19/28

  • 8/2/2019 Unit 1 - Boolean Algebra

    20/28

    Boolean Theorems

    1 1x T10b

    The union of a setx and the universeis still the universe.

    x U U

    In terms of truth tables, this corresponds to:

    In terms of set theory, this corresponds to:

    x x +10 1 by P4b

    1 1 by P3b

  • 8/2/2019 Unit 1 - Boolean Algebra

    21/28

    Boolean Theorems

    * x x x xx x T11a T11b

    0 1* x xx x T12a T12b

    Idempotency Theorems

    Inverse Elements

    x x xx T13a T13b

    Double Negation

    Both AND and OR are idempotent, meaning that ANDing orORing a Boolean variable with itself once has the same effectas ANDing or ORing the variable with itself many times.

    Every Boolean variable has an inverse element given in termsof the NOT operator.

  • 8/2/2019 Unit 1 - Boolean Algebra

    22/28

    Absorption Theorems

    Absorption theoremsallow the simplification ofcircuits by reducing the

    number of gates.x xy x T14aProve

    x y

    x xyx xy

    (identity element for )*1 *x xy x x y by T10a AND

    (distribution)* 1x y by P8a*1x by T10b

    (identity element for )x by T10a AND

  • 8/2/2019 Unit 1 - Boolean Algebra

    23/28

    Proof Using Truth Tables

    Boolean proofs may be completed using the theoremsor, equivalently, using truth tables

    x

    0

    01

    1

    y

    0

    10

    1

    xy

    0

    10

    0

    x + xy

    0

    11

    1

    x + y

    0

    11

    1

    x x y x y T14dProve

    x1

    10

    0

    Permutationsare listed in

    the order ofthe binarynumbers

    from 0 to 3

  • 8/2/2019 Unit 1 - Boolean Algebra

    24/28

    F0

    0

    0

    0

    0

    0

    0

    0

    0

    F1

    1

    0

    0

    0

    0

    0

    0

    0

    F2

    0

    1

    0

    0

    0

    0

    0

    0

    Proof Using Truth Tables

    ForNvariables, there are 2Npermutations of 0 and 1

    There are therefore

    possible Boolean functions

    forNvariables

    y

    0

    0

    1

    1

    0

    0

    1

    1

    z

    0

    1

    0

    1

    0

    1

    0

    1

    For instance, for three variables,N= 3:

    There are 23= 8 permutations.

    Permutations are listed in the order of the

    binary numbers from 0to 7.

    There are 28= 256 Boolean functions.

    x

    0

    0

    0

    0

    1

    1

    1

    1

    22N

    F3

    0

    0

    1

    0

    0

    0

    0

    0

    F4

    0

    0

    0

    1

    0

    0

    0

    0

    F5

    0

    0

    0

    0

    1

    0

    0

    0

  • 8/2/2019 Unit 1 - Boolean Algebra

    25/28

    Derived Boolean Operators -NAND

    x y xy (xy)0 0 0 1

    0 1 0 1

    1 0 0 1

    1 1 1 0

    NAND

    xy

    NANDgate

    xy

    or NANDx y

    or

    x y

  • 8/2/2019 Unit 1 - Boolean Algebra

    26/28

  • 8/2/2019 Unit 1 - Boolean Algebra

    27/28

    Derived Boolean Operators XOR (Exclusive OR)

    x y

    0 0 0

    0 1 1

    1 0 1

    1 1 0

    XOR

    xy

    XORgate

    x y

    or

    XORx y

    x y

  • 8/2/2019 Unit 1 - Boolean Algebra

    28/28

    Derived Boolean Operators XNOR (Exclusive NOR or Equivalence)

    x y

    0 0 0 1

    0 1 1 0

    1 0 1 0

    1 1 0 1

    XNOR

    xy

    XNORgate

    or

    XNORx y

    x y x y

    x y

    x yor