logika11

Upload: skipjackk

Post on 03-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 logika11

    1/6

    1

    LOGIKA MATEMATIKA2004/2005

    Aljabar Boolean

    2

    Developed by George Boole in the 1850s

    M a t h e m a t i c a l t h e o r y o f l o g i c . Shannon was the first to use Boolean

    Algebra to solve problems in electronicc i r c u i t d e s i g n . ( 1 9 3 8 ) .

    The behavior of a Digital Circuit can bedescribed in terms of Boolean Algebra.

    Boolean algebra provides the operations andthe rules for working with the set{0, 1}.

    Boolean Algebra

    3

    Purpose of Boolean Algebra

    Boolean Algebra is thetool that allows logicalideas to be representedin a mathematical way,simplified and analyzed,and then translated intor ea l h a r d wa r e fo rimplementation (usingl o g i c a l g a t e s ) .

    Logical idea

    Gate - implementation

    Mathematicalrepresentation

    4

    Boolean Constants

    In Boolean algebra, there are onlytwo constants, true and false

    0VOff0false

    +5VOn1true

    Voltagelevel

    State ofa switch

    Binarydigit

    Booleanconstant

    5

    Boolean Variables

    Boolean variables are variables thatstore values that are Booleanc o n s t a n t s .

    6

    Boolean Operator AND

    If A and B are Boolean variables (or expressions)then

    A AND Bis true if and only if bothA and B are true.

    If A and B are Boolean variables (or expressions)then

    A AND Bis false if and only if eitherA or B is false or theyreboth false.

    We denote the AND operation likemultiplication in ordinary algebra: AB or A.B

  • 8/12/2019 logika11

    2/6

    7

    Boolean Operator OR

    If A and B are Boolean variables (or expressions)

    then A OR Bis true if and only if at least one of A and B istrue.If A and B are Boolean variables (or expressions)then

    A OR Bis false if and only if both A and B are false.

    We denote the OR operation like additionin ordinary algebra: A+B

    8

    Boolean Operator NOT

    If A is a Boolean variable (or expression)

    thenNOT A

    has the opposite value from A.

    We denote the NOToperation by putting abar over the variable (or expression) :

    _A

    9

    Truth Table for AND

    111

    001

    010

    000

    ABBA

    10

    Truth Table for OR

    111

    101

    110

    000

    A+BBA

    11

    Truth Table for NOT

    01

    10

    _

    AA

    12

    Boolean Operations

    The complement is denoted by a bar (on the slides, wewill use a minus sign). It is defined by

    -0 = 1 and -1 = 0.

    The Boolean sum, denoted by + or by OR, has thefollowing values:

    1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0

    The Boolean product, denoted by or by AND, has thefollowing values:

    1 1 = 1, 1 0 = 0, 0 1 = 0, 0 0 = 0

  • 8/12/2019 logika11

    3/6

    13

    The rules of Boolean Algebra are:

    AND Operations ()

    00 = 0 A0 = 010 = 0 A1 = A01 = 0 AA = A11 = 1 AA' = 0

    OR Operations (+)

    0+0 = 0 A+0 = A1+0 = 1 A+1 = 10+1 = 1 A+A = A1+1 = 1 A+A' = 1

    NOT Operations (')

    0' = 1 A'' = A1' = 0

    Associative Law

    (AB)C = A(BC) = ABC

    (A+B)+C = A+(B+C)= A+B+C

    Distributive Law

    A(B+C) = (AB) + (AC)

    A+(BC) = (A+B) (A+C)

    Some Theorems

    A+(AB) = A

    A(A+B) = A

    A(A+B) = ABA+(AB) = A+B

    A+(AB) = A+BA+(AB) = A+B

    ABC = (A+B+C)(ABC) = A+B+C

    Commutative LawCommutative Law

    AAB = BB = BAAA+B = B+AA+B = B+A

    PrecedencePrecedence

    AA B = (AB = (A))BBAAB+C = (AB+C = (AB) + CB) + CA+BA+BC = A + (BC = A + (BC)C)

    DeMorgan's Theorem

    (AB)' = A' + B' (NAND)(A+B)' = A' B' (NOR)

    De Morgans theorems

    14

    Boolean Functions and Expressions

    Definition: Let B = {0, 1}. The variable x is

    called a Boolean variable if it assumes valuesonly from B.

    A function from Bn, the set {(x1, x2, , xn)|xiB, 1 i n} , to B is called a Booleanfunction of degree n.

    Boolean functions can be represented usingexpressions made up from the variables andBoolean operations.

    15

    Boolean Functions and Expressions

    Question: How many different Boolean functions of degree 1 arethere?

    Solution: There are four of them, F1, F2, F3, and F4:

    0

    1

    F3

    1

    0

    F2

    101

    100

    F4F1x

    16

    Boolean Functions and Expressions

    Question: How many different Boolean functions of degree 2 arethere?

    Solution: There are 16 of them, F1, F2, , F16:

    1

    0

    0

    0

    F2

    0

    0

    0

    0

    F1

    010

    101

    011

    000

    F3yx

    1

    1

    1

    0

    F8

    0

    1

    1

    0

    F7

    0

    0

    0

    1

    F9

    0

    0

    1

    0

    F5

    1

    1

    0

    0

    F4

    1

    0

    1

    0

    F6

    0

    1

    0

    1

    F11

    1

    0

    0

    1

    F10

    0

    1

    1

    1

    F12

    1

    0

    1

    1

    F14

    0

    0

    1

    1

    F13

    1

    1

    0

    1

    F15

    1

    1

    1

    1

    F16

    17

    Evaluating a Boolean Expression

    Unlike ordinary algebra, for a BE, there are

    only finitely many possible assignments of

    values to the variables; so, theoretically, we

    can make a table, called a truth table, that

    shows the value of the BE for every possible

    set of values of the variables.

    For convenience, use

    0 = false

    1 = true 18

    Filling in a Truth Table

    If there are N variables, there are 2N

    possible combinations of values

    Thus, there are 2N rows in the truth table

    Fill in the values by counting up from 0 inbinary

  • 8/12/2019 logika11

    4/6

    19

    Truth Table for (X+Y)Z

    1110

    0001

    1101

    0011

    1

    0

    0

    0

    X

    1

    0

    1

    0

    Z

    11

    01

    00

    00

    (X+Y)ZY

    20

    Construct a truth table for

    _ ___

    E = AB + (A+C)B

    Example

    21

    111

    011

    101

    001

    110

    010

    100

    000

    CBA

    0

    0

    1

    1

    0

    0

    1

    1

    _

    B

    _ ___

    E =AB + (A+C)B

    0

    0

    1

    1

    0

    0

    0

    0

    _

    AB

    1

    1

    1

    1

    1

    0

    1

    0

    A+C

    0

    0

    0

    0

    0

    1

    0

    1

    ___

    (A+C)

    0

    0

    0

    0

    0

    1

    0

    0

    ___

    (A+C)B

    0

    0

    1

    1

    0

    1

    0

    0

    E

    22

    Boolean Functions and Expressions

    There is a simple method for deriving aBoolean expression for a function that isdefined by a table. This method is based onminterms.

    Definition: A literal is a Boolean variable orits complement. A minterm of the Booleanvariables x1, x2, , xn is a Boolean producty 1y 2 y n , where y i = x i or y i = -x i .

    Hence, a minterm is a product of n literals,w ith one l i tera l for each var iab le .

    23

    Boolean Functions and Expressions

    Example: Give a Boolean expression for the Boolean functionF(x, y) as defined by the following table:

    110

    001

    011

    000

    F(x, y)yx

    Possible solution: F(x, y) = (-x).y

    24

    Boolean Functions and Expressions

    Consider F(x,y,z) again:

    F(x, y, z) = 1 if and only if:

    x = y = z = 0 or

    x = y = 0, z = 1 or

    x = 1, y = z = 0Therefore,

    F(x, y, z) =(-x)(-y)(-z) +(-x)(-y)z +x(-y)(-z)

    0

    0

    1

    1

    F(x, y, z)

    1

    0

    1

    0

    z

    00

    10

    10

    00

    yx

    0

    0

    0

    1

    1

    0

    1

    0

    11

    11

    01

    01

  • 8/12/2019 logika11

    5/6

  • 8/12/2019 logika11

    6/6

    31

    Gambarlah circuituntuk menghasilkanoutput sbb :

    zyxzyx

    zyx

    xyx

    ).(

    ).(

    ).(

    ++

    +

    +

    32

    Carilah SPE dari fungsi F(x,y,z) = (x+y)~z,

    kemudian gambarkan circuit yang sesuaidengan fungsi tersebut.

    Jawab :

    33

    Carilah SPE dari fungsi boolean berikut ini dangambarkan circuit yang sesuai.

    yzxzyxF

    zyxzyxF

    )(),,(

    ),,(

    +=

    ++=