combinational logic 1. 2 topics basics of digital logic basic functions ♦ boolean algebra ♦...

48
Combinational Logic 1

Upload: virginia-kelly

Post on 13-Jan-2016

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

CombinationalLogic 1

Page 2: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

2

Topics

• Basics of digital logic • Basic functions♦ Boolean algebra♦ Gates to implement Boolean functions

• Identities and Simplification

Page 3: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

3

Binary Logic

• Binary variables♦ Can be 0 or 1 (T or F, low or high)♦ Variables named with single letters in

examples♦ Use words when designing circuits

• Basic Functions♦ AND♦ OR♦ NOT

Page 4: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

4

AND Operator

• Symbol is dot♦ Z = X · Y

• Or no symbol♦ Z = XY

• Truth table ->• Z is 1 only if♦ Both X and Y are 1

Page 5: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

5

OR Operator

• Symbol is +♦ Not addition♦ Z = X + Y

• Truth table ->• Z is 1 if either 1♦ Or both!

Page 6: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

6

NOT Operator

• Unary• Symbol is bar (or ’)♦ Z = X’

• Truth table ->• Inversion

Page 7: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

7

Gates

• Circuit diagrams are traditionally used to document circuits

• Remember that 0 and 1 are represented by voltages

Page 8: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

8

AND Gate

Timing Diagrams

Page 9: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

9

OR Gate

Page 10: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

10

Inverter

Page 11: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

11

More Inputs

• Work same way• What’s output?

Page 12: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

12

Digital Circuit Representation: Schematic

Page 13: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

13

Digital Circuit Representation: Boolean Algebra

• For now equations with operators AND, OR, and NOT

• Can evaluate terms, then final OR

• Alternate representations next

ZY X F

Page 14: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

14

Digital Circuit Representation: Truth Table

• 2n rowswhere n # ofvariables

Page 15: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

15

Functions

• Can get same truth table with different functions

• Usually want simplest function♦ Fewest gates or using particular types

of gates♦ More on this later

ZY X F ))(( ZXY X F

Page 16: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

16

Identities

• Use identities to manipulate functions

• On previous slide, I used distributive law

to transform fromZY X F ))(( ZXY X F

))(( ZX YX YZ X

to

Page 17: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

17

Table of Identities

Page 18: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

18

Duals

• Left and right columns are duals

• Replace AND with OR, 0s with 1s

Page 19: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

19

Single Variable Identities

Page 20: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

20

Commutative

• Order independent

Page 21: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

21

Associative

• Independent of order in which we group

• So can also be written asand

ZYX XYZ

Page 22: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

22

Distributive

• Can substitute arbitrarily large algebraic expressions for the variables

Page 23: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

23

DeMorgan’s Theorem

• Used a lot• NOR equals invert AND

• NAND equals invert OR

Page 24: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

24

Truth Tables for DeMorgan’s

Page 25: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

25

Algebraic Manipulation

• Consider functionXZZYX YZ X F

Page 26: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

26

Simplify Function

XZZ Z YX F )(

XZYX F 1

XZYX F

Apply

Apply

Apply

XZZYX YZ X F

Page 27: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

27

Fewer GatesXZYX F

Page 28: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

28

Consensus Theorem

• The third term is redundant♦ Can just drop

• Proof in book, but in summary♦ For third term to be true, Y & Z both 1♦ Then one of the first two terms must be

1!

ZXXYYZZXXY

Page 29: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

29

Complement of a Function

• Definition:

1s & 0s swapped in truth table

Page 30: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

30

Truth Table of the Complement of a Function

X Y Z F = X + Y’Z F’

0 0 0 0 1

0 0 1 1 0

0 1 0 0 1

0 1 1 0 1

1 0 0 1 0

1 0 1 1 0

1 1 0 1 0

1 1 1 1 0

Page 31: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

31

Algebraic Form for Complement• Mechanical way to derive

algebraic form for the complement of a function

1. Take the dual• Recall: Interchange AND & OR, and 1s & 0s

2. Complement each literal (a literal is a variable complemented or not; e.g. x , x’ , y, y’ each is a literal)

Page 32: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

32

Example: Algebraic form for the complement of a function

F = X + Y’Z• To get the complement F’

1. Take dual of right hand side

X . (Y’ + Z)2. Complement each literal: X’ . (Y

+ Z’)

F’ = X’ . (Y + Z’)

Page 33: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

Mechanically Go From Truth Table to Function

Page 34: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

34

From Truth Table to Function

• Consider a truth table• Can implement F

by taking OR of all terms that correspond to rows for which F is 1 “Standard Form” of

the function

XYZZXYZYXZY XZ YX F

Page 35: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

35

Standard Forms

• Not necessarily simplest F• But it’s mechanical way to go

from truth table to function

• Definitions:♦ Product terms – AND ĀBZ♦ Sum terms – OR X + Ā♦ This is logical product and sum, not

arithmetic

Page 36: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

36

Definition: Minterm

• Product term in which all variables appear once (complemented or not)

• For the variables X, Y and Z example minterms : X’Y’Z’, X’Y’Z, X’YZ’, …., XYZ

Page 37: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

37

Definition: Minterm (continued)

MinTerm

Each minterm represents exactly one combination of the binary variables in a truth table.

Page 38: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

38

Truth Tables of Minterms

Page 39: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

39

Number of Minterms

• For n variables, there will be 2n minterms

• Minterms are labeled from minterm 0, to minterm 2n-1

♦m0 , m1 , m2 , … , m2n

-2 , m2n

-1

• For n = 3, we have

♦m0 , m1 , m2 , m3 , m4 , m5 , m6 , m7

Page 40: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

40

Definition: Maxterm

• Sum term in which all variables appear once (complemented or not)

• For the variables X, Y and Z the maxterms are:

X+Y+Z , X+Y+Z’ …. , X’+Y’+Z’

Page 41: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

41

Definition: Maxterms (continued)

mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm,mxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

Maxterm

Page 42: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

42

Truth Tables of Maxterms

Page 43: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

43

Minterm related to Maxterm

• Minterms and maxterms with same subscripts are complements

• Example33 MZYXYZXm

Mjm j

Page 44: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

44

Standard Form of F:Sum of Minterms

• OR all of the minterms of truth table for which the functionvalue is 1

• F = m0 + m2 + m5 + m7

Page 45: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

45

Complement of F

• Not surprisingly, just sum of the other minterms

• In this caseF’ = m1 + m3 + m4 + m6

Page 46: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

46

Product of Maxterms

• Recall that maxterm is true except for its own row

• So M1 is only false for 001

Page 47: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

47

Product of Maxterms

• F = m0 + m2 + m5 + m7

• Remember:♦ M1 is only false for 001♦ M3 is only false for 011♦ M4 is only false for 100♦ M6 is only false for 110

• Can express F as AND of M1, M3, M4, M6

6431 MMMMF

))(( ZYXZYXF ))(( ZYXZYX

or

Page 48: Combinational Logic 1. 2 Topics Basics of digital logic Basic functions ♦ Boolean algebra ♦ Gates to implement Boolean functions Identities and Simplification

48

Recap

• Working (so far) with AND, OR, and NOT

• Algebraic identities• Algebraic simplification• Minterms and maxterms• Can now synthesize function

from truth table