Top Banner
1 COMP541 COMP541 Combinational Logic Combinational Logic Montek Singh Montek Singh Jan 16, 2007 Jan 16, 2007
42

1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

1

COMP541COMP541

Combinational LogicCombinational Logic

Montek SinghMontek Singh

Jan 16, 2007Jan 16, 2007

Page 2: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

2

TodayToday Basics of digital logic (review)Basics of digital logic (review)

Basic functionsBasic functions Boolean algebraBoolean algebra Gates to implement Boolean functionsGates to implement Boolean functions

Identities and Simplification (review?)Identities and Simplification (review?)

Page 3: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

3

Binary LogicBinary Logic Binary variablesBinary variables

Can be 0 or 1 (T or F, low or high)Can be 0 or 1 (T or F, low or high) Variables named with single letters in examplesVariables named with single letters in examples Really use words when designing circuitsReally use words when designing circuits

Basic FunctionsBasic Functions ANDAND OROR NOTNOT

Page 4: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

4

ANDAND Symbol is Symbol is dotdot

C = A · BC = A · B

Or no symbolOr no symbol C = ABC = AB

Truth table ->Truth table -> C is 1 only ifC is 1 only if

Both A and B are 1Both A and B are 1

Page 5: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

5

OROR Symbol is +Symbol is +

Not additionNot addition C = A + BC = A + B

Truth table ->Truth table -> C is 1 if either 1C is 1 if either 1

Or both!Or both!

Page 6: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

6

NOTNOT UnaryUnary Symbol is barSymbol is bar

C = ĀC = Ā

Truth table ->Truth table -> InversionInversion

Page 7: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

7

GatesGates Circuit diagrams are traditional to document Circuit diagrams are traditional to document

circuitscircuits Remember that 0 and 1 are represented by Remember that 0 and 1 are represented by

voltages voltages

Page 8: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

8

AND GateAND Gate

Timing Diagrams

Page 9: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

9

OR GateOR Gate

Page 10: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

10

InverterInverter

Page 11: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

11

More InputsMore Inputs Work same wayWork same way What’s output?What’s output?

Page 12: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

12

Representation: SchematicRepresentation: Schematic Schematic = circuit diagramSchematic = circuit diagram

Page 13: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

13

Representation: Boolean AlgebraRepresentation: Boolean Algebra For now equations with operators AND, OR, For now equations with operators AND, OR,

and NOTand NOT Can evaluate terms, then final ORCan evaluate terms, then final OR

Alternate representations nextAlternate representations next

ZY X F

Page 14: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

14

Representation: Truth TableRepresentation: Truth Table 22nn rows rows

where n = where n = # of variables# of variables

Page 15: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

15

FunctionsFunctions Can get same truth table with different Can get same truth table with different

functionsfunctions

Usually want ‘simplest’Usually want ‘simplest’ Fewest gates, or using only particular types of gatesFewest gates, or using only particular types of gates More on this laterMore on this later

ZY X F ))(( ZXY X F

Page 16: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

16

IdentitiesIdentities Use identities to manipulate functionsUse identities to manipulate functions I used distributive law … I used distributive law …

… … to transform fromto transform from

ZY X F

))(( ZXY X F

))(( ZX YX YZ X

toto

Page 17: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

17

Table of IdentitiesTable of Identities

Page 18: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

18

DualsDuals Left and right columns are Left and right columns are dualsduals Replace AND and OR, 0s and 1sReplace AND and OR, 0s and 1s

Page 19: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

19

Single Variable IdentitiesSingle Variable Identities

Page 20: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

20

CommutativityCommutativity Operation is independent of order of variablesOperation is independent of order of variables

Page 21: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

21

AssociativityAssociativity Independent of order in which we groupIndependent of order in which we group

So can also be written asSo can also be written as

andandZYX

XYZ

Page 22: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

22

DistributivityDistributivity

Can substitute arbitrarily large algebraic Can substitute arbitrarily large algebraic expressions for the variablesexpressions for the variables Distribute an operation over the entire expressionDistribute an operation over the entire expression

Page 23: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

23

DeMorgan’s TheoremDeMorgan’s Theorem Used a lotUsed a lot NOR NOR invert, then AND invert, then AND

NAND NAND invert, then OR invert, then OR

Page 24: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

24

Truth Tables for DeMorgan’sTruth Tables for DeMorgan’s

Page 25: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

25

Algebraic ManipulationAlgebraic Manipulation Consider functionConsider function

XZZYX YZ X F

Page 26: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

26

Simplify FunctionSimplify Function

XZZYX YZ X F

XZZ Z YX F )(

XZYX F 1

XZYX F

Apply

Apply

Apply

Page 27: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

27

Fewer GatesFewer Gates

XZYX F

Page 28: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

28

Consensus TheoremConsensus Theorem

The third term is redundantThe third term is redundant Can just dropCan just drop

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

ZXXYYZZXXY

Page 29: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

29

Complement of a FunctionComplement of a Function Definition: 1s & 0s swapped in truth tableDefinition: 1s & 0s swapped in truth table Mechanical way to derive algebraic formMechanical way to derive algebraic form

Take the dualTake the dualRecall: Interchange AND and OR, and 1s & 0sRecall: Interchange AND and OR, and 1s & 0s

Complement each literalComplement each literal

Page 30: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

30

Mechanically Go From Truth Table Mechanically Go From Truth Table to Functionto Function

Page 31: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

31

From Truth Table to FuncFrom Truth Table to Func Consider a truth tableConsider a truth table Can implement F by taking OR of all terms that Can implement F by taking OR of all terms that

are 1are 1

XYZZXYZYXZY XZ YX F

Page 32: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

32

Standard FormsStandard Forms Not necessarily simplest FNot necessarily simplest F But it’s a mechanical way to go from truth But it’s a mechanical way to go from truth

table to functiontable to function

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

Page 33: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

33

Definition: MintermDefinition: Minterm Product term in which all variables appear Product term in which all variables appear

once (complemented or not)once (complemented or not)

Page 34: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

34

Number of MintermsNumber of Minterms For For nn variables, there will be variables, there will be 22nn minterms minterms Like binary numbers from 0 to 2Like binary numbers from 0 to 2nn-1-1 In book, numbered same way (with decimal In book, numbered same way (with decimal

conversion)conversion)

Page 35: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

35

MaxtermsMaxterms Sum term in which all variables appear once Sum term in which all variables appear once

(complemented or not)(complemented or not)

Page 36: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

36

Minterm related to MaxtermMinterm related to Maxterm Minterm and maxterm with same subscripts Minterm and maxterm with same subscripts

are complementsare complements

ExampleExample

33 MZYXYZXm

Mjm j

Page 37: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

37

Sum of MintermsSum of Minterms Like the introductory slideLike the introductory slide OR all of the minterms of truth table row with OR all of the minterms of truth table row with

a 1a 1

Page 38: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

38

Complement of FComplement of F Not surprisingly, just sum of the other Not surprisingly, just sum of the other

mintermsminterms In this caseIn this case

mm11 + m + m33 + m + m44 + m + m66

Page 39: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

39

Product of MaxtermsProduct of Maxterms Recall that maxterm is true except for its own Recall that maxterm is true except for its own

casecase So M1 is only false for 001So M1 is only false for 001

Page 40: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

40

Product of MaxtermsProduct of Maxterms Can express F as AND of all rows that should Can express F as AND of all rows that should

evaluate to 0evaluate to 0

6431 MMMMF

))(( ZYXZYXF ))(( ZYXZYX

oror

Page 41: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

41

RecapRecap Working (so far) with AND, OR, and NOTWorking (so far) with AND, OR, and NOT Algebraic identitiesAlgebraic identities Algebraic simplificationAlgebraic simplification Minterms and maxtermsMinterms and maxterms Can now synthesize function (and gates) from Can now synthesize function (and gates) from

truth tabletruth table

Page 42: 1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.

42

Next TimeNext Time Lab PrepLab Prep

Demo lab softwareDemo lab software Talk about FPGA internalsTalk about FPGA internals Overview of components on boardOverview of components on board Downloading and testingDownloading and testing

Karnaugh maps: mechanical synthesis Karnaugh maps: mechanical synthesis approach (quick)approach (quick)