boolean algebra. introduction 1854: logical algebra was published by george boole known today as...

21
Boolean Algebra Boolean Algebra

Upload: alannah-shelton

Post on 23-Dec-2015

220 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Boolean AlgebraBoolean Algebra

Page 2: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

IntroductionIntroduction

1854: 1854: Logical algebraLogical algebra was published was published by by George BooleGeorge Boole known today as known today as “Boolean Algebra”“Boolean Algebra” It’s a convenient way and systematic It’s a convenient way and systematic

way of expressing and analyzing the way of expressing and analyzing the operation of logic circuits.operation of logic circuits.

1938: 1938: Claude ShannonClaude Shannon was the was the first to apply Boole’s work to the first to apply Boole’s work to the analysis and design of logic circuits.analysis and design of logic circuits.

Page 3: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Boolean Operations & Boolean Operations & ExpressionsExpressions

VariableVariable – a symbol used to – a symbol used to represent a logical quantity.represent a logical quantity.

ComplementComplement – the inverse of a – the inverse of a variable and is indicated by a bar variable and is indicated by a bar over the variable.over the variable.

LiteralLiteral – a variable or the – a variable or the complement of a variable.complement of a variable.

Page 4: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Boolean AdditionBoolean Addition Boolean addition is equivalent to the OR Boolean addition is equivalent to the OR

operationoperation

A A sum termsum term is produced by an OR operation is produced by an OR operation with no AND ops involved.with no AND ops involved. i.e.i.e. A A sum termsum term is equal to 1 when one or more of the is equal to 1 when one or more of the

literals in the term are 1.literals in the term are 1. A A sum termsum term is equal to 0 only if each of the literals is equal to 0 only if each of the literals

is 0. is 0.

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

DCBACBABABA ,,,

Page 5: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Boolean MultiplicationBoolean Multiplication Boolean multiplication is equivalent to the Boolean multiplication is equivalent to the

AND operationAND operation

A A product termproduct term is produced by an AND is produced by an AND operation with no OR ops involved.operation with no OR ops involved. i.e.i.e. A A product termproduct term is equal to 1 only if each of the is equal to 1 only if each of the

literals in the term is 1.literals in the term is 1. A A product termproduct term is equal to 0 when one or more is equal to 0 when one or more

of the literals are 0. of the literals are 0.

0·0 = 0

DBCACABBAAB ,,,

0·1 = 0 1·0 = 0 1·1 = 1

Page 6: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Laws & Rules of Boolean Laws & Rules of Boolean AlgebraAlgebra

The basic laws of Boolean algebra:The basic laws of Boolean algebra: The The commutativecommutative laws laws ((กฏการสลั�บที่�กฏการสลั�บที่�)) The The associativeassociative laws laws ( (กฏการจั�ดกลั��มกฏการจั�ดกลั��ม)) The The distributivedistributive laws laws ( (กฏการกระจัายกฏการกระจัาย))

Page 7: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Commutative LawsCommutative Laws

The The commutative law of additioncommutative law of addition for two variables is written as: for two variables is written as: A+B A+B = B+A= B+A

The The commutative law of commutative law of multiplicationmultiplication for two variables is for two variables is written as: written as: AB = BAAB = BA

AB

A+BBA

B+A

AB

ABBA

B+A

Page 8: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Associative LawsAssociative Laws

The The associative law of additionassociative law of addition for 3 for 3 variables is written as: variables is written as: A+(B+C) = A+(B+C) = (A+B)+C(A+B)+C

The The associative law of multiplicationassociative law of multiplication for 3 variables is written as: for 3 variables is written as: A(BC) = A(BC) = (AB)C(AB)C

A

BA+(B+C)

C

A

B(A+B)+C

C

A

BA(BC)

C

A

B(AB)C

C

B+C

A+B

BC

AB

Page 9: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Distributive LawsDistributive Laws

The The distributive lawdistributive law is written for 3 is written for 3 variables as follows: variables as follows: A(B+C) = AB + ACA(B+C) = AB + AC

B

C

A

B+C

A

B

C

AXX

AB

AC

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

Page 10: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Rules of Boolean AlgebraRules of Boolean Algebra

1.6

.5

1.4

00.3

11.2

0.1

AA

AAA

AA

A

A

AA

BCACABA

BABAA

AABA

AA

AA

AAA

))(.(12

.11

.10

.9

0.8

.7

___________________________________________________________A, B, and C can represent a single variable or a combination of variables.

Page 11: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

DeMorgan’s TheoremsDeMorgan’s Theorems

DeMorgan’s theorems provide DeMorgan’s theorems provide mathematical verification of:mathematical verification of: the equivalency of the NAND and the equivalency of the NAND and

negative-OR gatesnegative-OR gates the equivalency of the NOR and the equivalency of the NOR and

negative-AND gates.negative-AND gates.

Page 12: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

DeMorgan’s TheoremsDeMorgan’s Theorems The complement of two The complement of two

or more ANDed or more ANDed variables is equivalent variables is equivalent to the OR of the to the OR of the complements of the complements of the individual variables.individual variables.

The complement of two The complement of two or more ORed variables or more ORed variables is equivalent to the is equivalent to the AND of the AND of the complements of the complements of the individual variables. individual variables.

YXYX

YXYX

NAND Negative-OR

Negative-ANDNOR

Page 13: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

DeMorgan’s Theorems DeMorgan’s Theorems (Exercises)(Exercises)

Apply DeMorgan’s theorems to the Apply DeMorgan’s theorems to the expressions:expressions:

ZYXW

ZYX

ZYX

ZYX

Page 14: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

DeMorgan’s Theorems DeMorgan’s Theorems (Exercises)(Exercises)

Apply DeMorgan’s theorems to the Apply DeMorgan’s theorems to the expressions:expressions:

)(

)(

FEDCBA

EFDCBA

DEFABC

DCBA

Page 15: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Boolean Analysis of Logic Boolean Analysis of Logic CircuitsCircuits

Boolean algebra provides a concise Boolean algebra provides a concise way to express the operation of a way to express the operation of a logic circuit formed by a logic circuit formed by a combination of logic gatescombination of logic gates so that the output can be determined so that the output can be determined

for various combinations of input for various combinations of input values.values.

Page 16: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Boolean Expression for a Logic Boolean Expression for a Logic CircuitCircuit

To derive the Boolean expression for To derive the Boolean expression for a given logic circuit, begin at the a given logic circuit, begin at the left-most inputs and work toward the left-most inputs and work toward the final output, writing the expression final output, writing the expression for each gate.for each gate.

CD

B

A

CD

B+CD

A(B+CD)

Page 17: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Constructing a Truth Table Constructing a Truth Table for a Logic Circuitfor a Logic Circuit

Once the Boolean expression for a given Once the Boolean expression for a given logic circuit has been determined, a logic circuit has been determined, a truth table that shows the output for all truth table that shows the output for all possible values of the input variables possible values of the input variables can be developed.can be developed. Let’s take the previous circuit as the Let’s take the previous circuit as the

example:example:

A(B+CD)A(B+CD) There are four variables, hence 16 (2There are four variables, hence 16 (244) )

combinations of values are possible.combinations of values are possible.

Page 18: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Constructing a Truth Table Constructing a Truth Table for a Logic Circuitfor a Logic Circuit

Evaluating the expressionEvaluating the expression To evaluate the expression To evaluate the expression A(B+CD)A(B+CD), ,

first find the values of the variables that first find the values of the variables that make the expression equal to 1 (using make the expression equal to 1 (using the rules for Boolean add & mult).the rules for Boolean add & mult).

In this case, the expression equals 1 In this case, the expression equals 1 only if A=1 and B+CD=1 becauseonly if A=1 and B+CD=1 because

A(B+CD) = 1A(B+CD) = 1··1 = 11 = 1

Page 19: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Constructing a Truth Table Constructing a Truth Table for a Logic Circuitfor a Logic Circuit

Evaluating the expression (cont’)Evaluating the expression (cont’) Now, determine when Now, determine when B+CDB+CD term equals term equals

1.1. The term The term B+CD=1B+CD=1 if either if either B=1B=1 or or CD=1CD=1

or if both or if both BB and and CDCD equal 1 because equal 1 because

B+CD = 1+0 = 1B+CD = 1+0 = 1

B+CD = 0+1 = 1B+CD = 0+1 = 1

B+CD = 1+1 = 1B+CD = 1+1 = 1 The term The term CD=1CD=1 only if only if C=1C=1 and and D=1D=1

Page 20: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Constructing a Truth Table Constructing a Truth Table for a Logic Circuitfor a Logic Circuit

Evaluating the expression (cont’)Evaluating the expression (cont’) Summary:Summary: A(B+CD)=1A(B+CD)=1

When When A=1A=1 and and B=1B=1 regardless of the values of regardless of the values of CC and and DD

When A=1When A=1 and and C=1C=1 and and D=1D=1 regardless of the regardless of the value of value of BB

The expression The expression A(B+CD)=0A(B+CD)=0 for all other for all other value combinations of the variables.value combinations of the variables.

Page 21: Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published

Constructing a Truth Table Constructing a Truth Table for a Logic Circuitfor a Logic Circuit

Putting the results Putting the results in truth table in truth table formatformat

INPUTSINPUTS OUTPUTOUTPUT

AA BB CC DD A(B+CD)A(B+CD)

00 00 00 00

00 00 00 11

00 00 11 00

00 00 11 11

00 11 00 00

00 11 00 11

00 11 11 00

00 11 11 11

11 00 00 00

11 00 00 11

11 00 11 00

11 00 11 11

11 11 00 00

11 11 00 11

11 11 11 00

11 11 11 11

INPUTSINPUTS OUTPUTOUTPUT

AA BB CC DD A(B+CD)A(B+CD)

00 00 00 00

00 00 00 11

00 00 11 00

00 00 11 11

00 11 00 00

00 11 00 11

00 11 11 00

00 11 11 11

11 00 00 00

11 00 00 11

11 00 11 00

11 00 11 11

11 11 00 00 11

11 11 00 11 11

11 11 11 00 11

11 11 11 11 11

When A=1 and B=1 regardless of the values of C and DWhen A=1 and C=1 and D=1 regardless of the value of B

A(B+CD)=1

INPUTSINPUTS OUTPUTOUTPUT

AA BB CC DD A(B+CD)A(B+CD)

00 00 00 00

00 00 00 11

00 00 11 00

00 00 11 11

00 11 00 00

00 11 00 11

00 11 11 00

00 11 11 11

11 00 00 00

11 00 00 11

11 00 11 00

11 00 11 11 11

11 11 00 00 11

11 11 00 11 11

11 11 11 00 11

11 11 11 11 11

INPUTSINPUTS OUTPUTOUTPUT

AA BB CC DD A(B+CD)A(B+CD)

00 00 00 00 00

00 00 00 11 00

00 00 11 00 00

00 00 11 11 00

00 11 00 00 00

00 11 00 11 00

00 11 11 00 00

00 11 11 11 00

11 00 00 00 00

11 00 00 11 00

11 00 11 00 00

11 00 11 11 11

11 11 00 00 11

11 11 00 11 11

11 11 11 00 11

11 11 11 11 11