lec5 intro to computer engineering by hsien-hsin sean lee georgia tech -- boolean algebra

15
ECE2030 Introduction to Computer Engineering Lecture 5: Boolean Algebra Prof. Hsien-Hsin Sean Lee Prof. Hsien-Hsin Sean Lee School of Electrical and Computer School of Electrical and Computer Engineering Engineering Georgia Tech Georgia Tech

Upload: hsien-hsin-lee

Post on 15-Apr-2017

440 views

Category:

Devices & Hardware


2 download

TRANSCRIPT

Page 1: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

ECE2030 Introduction to Computer Engineering

Lecture 5: Boolean Algebra

Prof. Hsien-Hsin Sean LeeProf. Hsien-Hsin Sean LeeSchool of Electrical and Computer EngineeringSchool of Electrical and Computer EngineeringGeorgia TechGeorgia Tech

Page 2: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

2

What is Boolean Algebra• An algebra dealing with

– Binary variables by alphabetical letters– Logic operations: OR, AND, XOR, etc

• Consider the following Boolean equation

ZZYYXZ)Y,F(X,

• A Boolean function can be represented by a truth table which list all combinations of 1’s and 0’s for each binary value

Page 3: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

3

Fundamental Operators• NOT

– Unary operator– Complements a Boolean variable represented

as A’, ~A, or Ā• OR

– Binary operator– A “OR”-ed with B is represented as A + B

• AND– Binary operator– A “AND”-ed with B is represented as AB or A·B– Can perform logical multiplication

Page 4: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

4

Binary Boolean Operations• All possible outcomes of a 2-input Boolean

functionA B F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15

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

A·B AB

A+B Identity

A

B

ĀBA+B

AB

A·BNULL

Page 5: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

5

Precedence of Operators• Precedence of Operator Evaluation (Similar

to decimal arithmetic)– () : Parentheses– NOT– AND– OR EBA)DCB(AF

Page 6: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

6

Function EvaluationEBA)DCB(AF

ABCDE=00000

0011011)00(0

010)010(0000)000(0F

ABCDE=10000

1001110)00(1

010)010(1001)000(1F

Page 7: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

7

Basic Identities of Boolean Algebra

Theorem) (Consensus ZXXYYZZXXY

ation)(Simplific YXYXX

Law)n (Absorptio XXYXLaw) s(DeMorgan' YX YX

ive)(Distribut XZXY Z)X(Yve)(Associati ZY)(X Z)(YX

ve)(Commutati X Y Y XLaw)n (Involutio XX

t)(Complemen 1XX

Law)t (Idempoten XXX 11X

(Identity) X0X

Page 8: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

8

Derivation of SimplificationYXX

YXY)(1X

YXXYX

)YX(XX

YXYXX

YX

Page 9: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

9

Derivation of Consensus TheoremYZZXXY

)X(XYZZXXY

YZXXYZZXXY

Y)Z(1XZ)XY(1

ZXXYYZZXXY

ZXXY

Page 10: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

10

Duality Principle• A Boolean equation remains valid if

we take the dual of the expressionsdual of the expressions on both sides of the equals sign

• Dual of expressions – Interchange 1’s and 0’s– Interchange AND () and OR (+)

Page 11: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

11

Duality PrincipleX1X X0X

00X 11X

0XX 1XX

XYYX XYYX

XXX XXX

Z)(XY)(XZYX XZXYZ)X(Y

YXYX YXYX

XY)(XX X YXX

YXY)X(X YX YXX

Z)XY)((XZ)Z)(YXY)((X ZXXY YZZXXY

Page 12: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

12

Simplification Examples

?XZZYXYZXF (1)

?YXZXYF (2)

?EDCBADCBACBABAAF (3)

C)(B A

)CBC)((BA BC)CBA( Prove (4)

Page 13: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

13

DeMorgan’s Law

BABA

BABA

Page 14: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

14

Example in Lecture 4BCAF

BC)A(F

A

C

B

A C

B

Vdd

F

Page 15: Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boolean Algebra

15

Another Way to Draw ItBCAF

B)C(AF

A

C

B

A C

B

Vdd

F