boolean algebra

16
Boolean Algebra Introduction to Boolean Algebra Boolean algebra which deals with two-valued (true / false or 1 and 0) variables and functions find its use in modern digital computers since they too use two-level systems called binary systems. Let us examine the following statement:"I will buy a car If I get a salary increase or I win the lottery." This statement explains the fact that the proposition "buy a car" depends on two other propositions "get a salary increase" and "win the lottery". Any of these propositions can be either true or false hence the table of all possible situations: Salary Increase Win Lottery Buy a car = Salary Increase or Win Lottery False False False False 1 / 16

Upload: abhishek-bajaj

Post on 05-Nov-2015

216 views

Category:

Documents


2 download

DESCRIPTION

Boolean Content

TRANSCRIPT

  • Boolean Algebra

    Introduction to Boolean Algebra Boolean algebra which deals with two-valued (true / false or 1 and 0) variables and functionsfind its use in modern digital computers since they too use two-level systems called binarysystems. Let us examine the following statement:"I will buy a car If I get a salary increase or I win thelottery." This statement explains the fact that the proposition "buy a car" depends on two otherpropositions "get a salary increase" and "win the lottery". Any of these propositions can beeither true or false hence the table of all possible situations: Salary Increase Win Lottery Buy a car = Salary Increase or Win Lottery False False False False

    1 / 16

  • Boolean Algebra

    True True True False True True True True The mathematician George Boole, hence the name Boolean algebra, used 1 for true, 0 for falseand + for the or connective to write simpler tables. Let X = "get a salary increase", Y = "win thelottery" and F = "buy a car". The above table can be written in much simpler form as shownbelow and it defines the OR function. X

    2 / 16

  • Boolean Algebra

    Y F = X + Y 0 0 0 0 1 1 1 0 1

    3 / 16

  • Boolean Algebra

    1 1 1 Let us now examine the following statement:"I will be able to read e-books online if I buy acomputer and get an internet connection." The proposition "read e-books" depends on twoother propositions "buy a computer" and "get an internet connection". Again using 1 for True, 0for False, F = "read e-books" , X = "buy a computer", Y = "get an internet connection" and use .for the connective and, we can write all possible situations using Boolean algebra as shown below. The above tablecan be written in much simpler form as shown below and it defines the AND function. X Y F = X . Y 0 0

    4 / 16

  • Boolean Algebra

    0 0 1 0 1 0 0 1 1 1

    5 / 16

  • Boolean Algebra

    We have so far defined two operators: OR written as + and AND written . . The third operator inBoolean algebra is the NOT operator which inverts the input. Whose table is given below whereNOT X is written as X'. X NOT X = X' 0 1 1 0 The 3 operators are the basic operators used in Boolean algebra and from which morecomplicated Boolean expressions may be written. Example: F = X . (Y + Z) Truth Tables Truth tables are a means of representing the results of a logic function using a table. They areconstructed by defining all possible combinations of the inputs to a function, and thencalculating the output for each combination in turn. For the three functions we have just defined,the truth tables are as follows.

    6 / 16

  • Boolean Algebra

    AND X Y F(X,Y) 0 0 0 0 1 0 1

    7 / 16

  • Boolean Algebra

    0 0 1 1 1 OR X Y F(X,Y) 0 0

    8 / 16

  • Boolean Algebra

    0 0 1 1 1 0 1 1 1 1

    9 / 16

  • Boolean Algebra

    NOT X F(X) 0 1 1 0 Truth tables may contain as many input variables as desired F(X,Y,Z) = X.Y + Z X Y

    10 / 16

  • Boolean Algebra

    Z F(X,Y,Z) 0 0 0 0 0 0 1 1 0

    11 / 16

  • Boolean Algebra

    1 0 0 0 1 1 1 1 0 0 0

    12 / 16

  • Boolean Algebra

    1 0 1 1 1 1 0 1 1 1 1

    13 / 16

  • Boolean Algebra

    1 Different Properties or Laws of Boolean Algebra A "property" or a "law," describes how differing variables relate to each other in a system ofnumbers. Commutative Property It applies equally to addition and multiplication. In essence, the commutative property tells uswe can reverse the order of variables that are either added together or multiplied togetherwithout changing the truth of the expression.

    Associative Property

    14 / 16

  • Boolean Algebra

    This property tells us we can associate groups of added or multiplied variables together withparentheses without altering the truth of the equations.

    Distributive Property Distributive Property, illustrating how to expand a Boolean expression formed by the product ofa sum, and in reverse shows us how terms may be factored out of Boolean sums-of-products.

    15 / 16

  • Boolean Algebra

    To summarize, here are the three basic properties: commutative, associative, and distributive.

    Identities In mathematics, an identity is a statement true for all possible values of its variable or variables.The algebraic identity of x + 0 = x tells us that anything (x) added tozero equals the original "anything," no matter what value that "anything" (x) may be. Booleanalgebra has its own unique identities based on the bivalent states of Boolean variables.

    Inverse Another identity having to do with complementation is that of the double complement: a variableinverted twice. Complementing a variable twice (or any even number of times) results in theoriginal Boolean value. This is analogous to negating (multiplying by -1) in real-number algebra:an even number of negations cancel to leave the original value.

    Duality Principle In Boolean algebras the duality Principle can be is obtained by interchanging AND and ORoperators and replacing 0's by 1's and 1's by 0's. Compare the identities on the left side with theidentities on the right. Example X.Y+Z' = (X'+Y').Z Indempotent Law An input ANDed with itself or ORed with itself is equal to that input. 1. A + A = A,A variable OR'ed with itself is always equal to the variable. 2. A . A = A,A variable AND'ed with itself is always equal to the variable. Involution Law: A =A When A=0, A=1, A=1=0=A When A=1, A =0, A=0=1=A Thus A=A Absorption Law: (i) A+AB=A LHS=A+AB=A.1+A.B=A(1+B)+A(B+1)=A.1=A=RHS (ii) A.(A+B)=A LHS=A.)A+B)=A.A+A.B=A+A.B=A+A.B=A(1+B)=A.1=A=RHS Complementary Law A term ANDed with its complement equals 0, and a term ORed with its complement equals 1 AA' = 0 A+A' = 1 De Morgans Theorem De Morgan was a great logician and Mathematician, as well as a friend of Charles Boole. Thetheorems given by De Morgan are associated with Boolean algebra. First Theorem: The complement of a sum equals to the product of the complements. (A+B) =A.B Proof: LHS= (A+B) = (0+0) = 0=1 RHS=A.B=0.0=1.1=1 Second Theorem: The complement of a product equals the sum of the complements. Proof: LHS = (A.B) = (0.0) = 0 = 1 RHS = A + B = 0 + 0 =1 +1 =1 Summary of Boolean indetities

    16 / 16