+ All Categories
Home > Documents > © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

© 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

Date post: 21-Jan-2016
Category:
Upload: bridget-austin
View: 219 times
Download: 0 times
Share this document with a friend
29
03 BA1 Page 1 ECEn 224 © 2003-2008 BYU Boolean Algebra – Part 1
Transcript
Page 1: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 1

ECEn 224 © 2003-2008BYU

Boolean Algebra – Part 1

Page 2: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 2

ECEn 224 © 2003-2008BYU

Boolean AlgebraObjectives

• Understand Basic Boolean Algebra

• Relate Boolean Algebra to Logic Networks

• Prove Laws using Truth Tables

• Understand and Use First Basic Theorems

• Apply Boolean Algebra to:– Simplifying Expressions

– Multiplying Out Expressions

– Factoring Expressions

Page 3: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 3

ECEn 224 © 2003-2008BYU

A New Kind of Algebra

Regular Algebra

Boolean Algebra

Values I ntegers Real Numbers Complex Numbers

Zero (0) One (1)

Operators + - / Logarithm, etc.

AND OR Complement

Page 4: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 4

ECEn 224 © 2003-2008BYU

Truth Tables

• A truth table provides a complete enumeration of the inputs and the corresponding output for a function.

If there are n inputs,There will be 2n rowsIn the table.

Unlike with regular algebra, full enumeration is possible (and useful) in Boolean Algebra

A B F

0 0 10 1 11 0 01 1 1

Page 5: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 5

ECEn 224 © 2003-2008BYU

Complement Operation

Also known as invert or not.The inverse of x is written as x’ or x.

x x'0 11 0

Page 6: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 6

ECEn 224 © 2003-2008BYU

Logical AND Operation

“•” denotes AND

Output is true iff all inputs are true

A B Q=A•B

0 0 00 1 01 0 01 1 1

Page 7: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 7

ECEn 224 © 2003-2008BYU

Logical OR Operation

“+” denotes OR

Output is true if any inputs are true

A B Q=A+B

0 0 00 1 11 0 11 1 1

Page 8: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 8

ECEn 224 © 2003-2008BYU

Boolean Expressions

Boolean expressions are made up of variables and constants combined by AND, OR and NOT

Examples: 1 A’ A•B C+D AB A(B+C) AB’+C

• A•B is the same as AB (• is omitted when obvious). • Parentheses are used like in regular algebra for grouping. • NOT has highest precedence, followed by AND then OR.

A term is a grouping of variables ANDed together.A literal is each instance of a variable or constant.This expression has 4 variables, 3 terms, and 6 literals:

a’b + bcd + a

Page 9: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 9

ECEn 224 © 2003-2008BYU

Boolean ExpressionsEach Boolean expression can be specified by a truth table which lists all possible combinations of the values of all variables in the expression.

F = A’ + B C

A B C A' B C F = A' + B C

0 0 0 1 0 10 0 1 1 0 10 1 0 1 0 10 1 1 1 1 11 0 0 0 0 01 0 1 0 0 01 1 0 0 0 01 1 1 0 1 1

Page 10: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 10

ECEn 224 © 2003-2008BYU

Boolean Expressions From Truth Tables

Each 1 in the output of a truth table specifies one term in the corresponding boolean expression.

The expression can be read off by inspection…

A B C F

0 0 0 00 0 1 00 1 0 10 1 1 01 0 0 01 0 1 01 1 0 01 1 1 1

F is true when:

A is false AND B is true AND C is false

OR

A is true AND B is true AND C is true

F = A’BC’ + ABC

Page 11: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 11

ECEn 224 © 2003-2008BYU

Another Example

F = A’B’C +A’BC’ +AB’C’ +ABC

F = ?A B C F

0 0 0 00 0 1 10 1 0 10 1 1 01 0 0 11 0 1 01 1 0 01 1 1 1

Page 12: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 12

ECEn 224 © 2003-2008BYU

Yet Another Example

F = A’B’ + A’B + AB’ + AB= 1 (F is always true)

There may be multiple expressions for any given truth table.

A B F

0 0 10 1 11 0 11 1 1

F = ?

Page 13: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 13

ECEn 224 © 2003-2008BYU

A B C F

0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

Converting Boolean Functions to Truth Tables

F = AB + BC

AB

BC

BC

Page 14: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 14

ECEn 224 © 2003-2008BYU

Converting Boolean Functions to Truth Tables

F = AB + BC

AB

BC

BC

A B C F

0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 01 0 1 01 1 0 11 1 1 1

Page 15: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 15

ECEn 224 © 2003-2008BYU

Some Basic Boolean TheoremsA 0 • A = 0

0 01 0

A 1 • A = A

0 01 1

A 0 + A = A

0 01 1

A 1 + A = 1

0 11 1

A B Q = A • B

0 0 00 1 01 0 01 1 1

A B Q = A + B

0 0 00 1 11 0 11 1 1

From these…

We can derivethese…

Page 16: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 16

ECEn 224 © 2003-2008BYU

Proof Using Truth TablesTruth Tables can be used to prove that 2 Boolean expressions are equal.

If the two expressions have the same value for all possible combinations of input variables, they are equal.

X Y’ + Y = X + Y

X Y Y' X Y' X Y' + Y X + Y

0 0 1 0 0 00 1 0 0 1 11 0 1 1 1 11 1 0 0 1 1

=

These two expressions are equal.

Page 17: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 17

ECEn 224 © 2003-2008BYU

Basic Boolean Algebra TheoremsHere are the first 5 Boolean Algebra theorems we will study and use.

X + 0 = X X • 1 = X

X + 1 = 1 X • 0 = 0

X + X = X X • X = X

X + X' = 1 X • X' = 0

( X' )' = X

Page 18: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 18

ECEn 224 © 2003-2008BYU

Basic Boolean Algebra Theorems

While these laws don’t seem very exciting, they can be very useful in simplifying Boolean expressions:

Simplify: (M N’ + M’ N) P + P’ + 1

X + 1

1

Page 19: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 19

ECEn 224 © 2003-2008BYU

Commutative Laws

X • Y = Y • X X + Y = Y + X

Associative Laws

(X • Y) • Z = X • (Y • Z) = X • Y • Z

(X + Y) + Z = X + (Y + Z ) = X + Y + Z

Just like regular algebra

Page 20: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 20

ECEn 224 © 2003-2008BYU

Distributive Law

X ( Y + Z ) = X Y + X Z

Prove with a truth table:

X Y Z Y + Z X ( Y + Z ) X Y X Z X Y + X Z

0 0 0 0 0 0 0 0

0 0 1 1 0 0 0 0

0 1 0 1 0 0 0 0

0 1 1 1 0 0 0 0

1 0 0 0 0 0 0 0

1 0 1 1 1 0 1 1

1 1 0 1 1 1 0 1

1 1 1 1 1 1 1 1

=Just like regular algebra

Page 21: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 21

ECEn 224 © 2003-2008BYU

Other Distributive Law

X + Y Z = ( X + Y ) ( X + Z )

NOT like regular algebra!

Proof: ( X + Y ) ( X + Z ) = X ( X + Z) + Y ( X + Z )

= X X + X Z + Y X + Y Z

= X + X Z + X Y + Y Z

= X • 1 + X Z + X Y + Y Z

= X ( 1 + Z + Y ) + Y Z

= X • 1 + Y Z

= X + Y Z

Page 22: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 22

ECEn 224 © 2003-2008BYU

Simplification Theorems

X Y + X Y’ = X ( X + Y ) (X + Y’) = X

X + X Y = X X ( X + Y ) = X

X + Y X’ = X + Y X ( X’ + Y ) = X Y

These are useful for simplifying Boolean Expressions.

The trick is to find X and Y.

( A’ + B + CD) (B’ + A’ + CD)

( A’ + CD + B) (A’ + CD + B’)

A’ + CD

Rearrange terms

(X + Y)(X + Y’) = X

Page 23: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 23

ECEn 224 © 2003-2008BYU

Multiplying Out

• All terms are products only• (no parentheses)

A B C’ + D E + F G H YesA B + C D + E YesA B + C ( D + E ) No

Multiplied out = sum-of-products form (SOP)

Page 24: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 24

ECEn 224 © 2003-2008BYU

Multiplying Out - Example

( A’ + B )( A’ + C )( C + D )Use ( X + Y )( X + Z ) = X + Y Z

( A’ + B C )( C + D )Multiply Out

A’ C + A’ D + B C C + B C D

Use X • X = X A’ C + A’ D + B C + B C D

Use X + X Y = X

A’ C + A’ D + BC

Using the theorems may be simpler than brute force.But, brute force does work…

Page 25: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 25

ECEn 224 © 2003-2008BYU

Factoring

• Final form is products only• All sum terms are single variables only

( A + B + C’ ) ( D + E ) Yes( A + B )( C + D’ )E’F Yes( A + B + C’ ) ( D + E ) + H No( A’ + BC ) ( D + E ) No

Factored out = product-of-sums form (POS)

Page 26: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 26

ECEn 224 © 2003-2008BYU

Factoring - Example

A B + C DUse X + Y Z = ( X + Y )( X + Z )

( A B + C )( A B + D )Use X + Y Z = ( X + Y )( X + Z ) again

( A + C )( B + C )( A B + D )

And again

( A + C )( B + C )( A + D )( B + D )

Sum of Products (SOP)

Product of Sums (POS)

Page 27: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 27

ECEn 224 © 2003-2008BYU

POS vs. SOP

• Any expression can be written either way• Can convert from one to another using theorems

• Sometimes SOP looks simpler– AB + CD = ( A + C )( B + C )( A + D )( B + D )

• Sometimes POS looks simpler– (A + B)(C + D) = BD + AD + BC + AC

• SOP will be most commonly used in this class but we must learn both

Page 28: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 28

ECEn 224 © 2003-2008BYU

Duality

• If an equality is true its dual will be true as well• To form the dual:

– AND OR– Invert constant 0’s or 1’s– Do NOT invert variables

X + 0 = X X • 1 = X

X + 1 = 1 X • 0 = 0

X + X = X X • X = X

X + X' = 1 X • X' = 0

Because these are true

These are also true

Page 29: © 2003-2008 BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.

03 BA1 Page 29

ECEn 224 © 2003-2008BYU

Theorem Summary

X + 0 = X X • 1 = X

X + 1 = 1 X • 0 = 0

X + X = X X • X = X

X + X’ = 1 X • X’ = 0

(X’)’ = X

XY + XY’ = X (X + Y) (X + Y’) = X

X + XY = X X(X + Y) = X

X + YX’ = X + Y X(Y + X’) = X Y

XY + X’Z + YZ = XY + X’Z (X + Y)(X’ + Z)(Y + Z) = (X + Y)(X’ + Z)

For each theorem on the left, the dual is listed on the right.

HINT: when forming duals, first apply parentheses around all AND terms.


Recommended