Top Banner
1 COMP541 COMP541 Combinational Logic Combinational Logic - II - II Montek Singh Montek Singh Jan 18, 2012 Jan 18, 2012
34
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 - II Montek Singh Jan 18, 2012.

1

COMP541COMP541

Combinational Logic - IICombinational Logic - II

Montek SinghMontek Singh

Jan 18, 2012Jan 18, 2012

Page 2: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

2

TodayToday Basics of Boolean Algebra (review)Basics of Boolean Algebra (review)

Identities and SimplificationIdentities and Simplification

Basics of Logic ImplementationBasics of Logic Implementation Minterms and maxtermsMinterms and maxterms Going from truth table to logic implementationGoing from truth table to logic implementation

Page 3: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

3

IdentitiesIdentities Use identities to manipulate functionsUse identities to manipulate functions You can use distributive law … You can use distributive law …

… … to transform fromto transform from

ZY X F

))(( ZXY X F

))(( ZX YX YZ X

toto

Page 4: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

4

Table of IdentitiesTable of Identities

Page 5: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

5

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 6: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

6

Single Variable IdentitiesSingle Variable Identities

Page 7: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

7

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

Page 8: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

8

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 9: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

9

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 10: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

10

DeMorganDeMorgan’’s Theorems Theorem Used a lotUsed a lot NOR NOR invert, then AND invert, then AND

NAND NAND invert, then OR invert, then OR

Page 11: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

11

Truth Tables for DeMorganTruth Tables for DeMorgan’’ss

Page 12: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

12

Algebraic ManipulationAlgebraic Manipulation Consider functionConsider function

XZZYX YZ X F

Page 13: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

13

Simplify FunctionSimplify Function

XZZYX YZ X F

XZZ Z YX F )(

XZYX F 1

XZYX F

Apply

Apply

Apply

Page 14: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

14

Fewer GatesFewer Gates

XZYX F

Page 15: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

15

Consensus TheoremConsensus Theorem

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

Proof summary:Proof 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 is already 1!Then one of the first two terms is already 1!

ZXXYYZZXXY

Page 16: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

16

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 17: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

17

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

Page 18: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

18

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 19: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

19

Standard FormsStandard Forms Not necessarily simplest FNot necessarily simplest F But itBut it’’s a mechanical way to go from truth 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 20: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

20

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 21: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

21

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 Often numbered same way (with decimal Often numbered same way (with decimal

conversion)conversion)

Page 22: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

22

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

(complemented or not)(complemented or not)

Page 23: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

23

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 24: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

24

Sum of MintermsSum of Minterms Like Slide 18Like Slide 18 OR all of the minterms of truth table row with OR all of the minterms of truth table row with

a 1a 1 ““ON-set mintermsON-set minterms””

Page 25: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

25

Sum of ProductsSum of Products Simplifying sum-of-minterms can yield a sum Simplifying sum-of-minterms can yield a sum

of productsof products Difference is each term need not be a mintermDifference is each term need not be a minterm

i.e., terms do not need to have all variablesi.e., terms do not need to have all variables

A bunch of ANDs and one ORA bunch of ANDs and one OR

Page 26: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

26

Two-Level ImplementationTwo-Level Implementation Sum of products has 2 levels of gatesSum of products has 2 levels of gates

Page 27: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

27

More Levels of Gates?More Levels of Gates? WhatWhat’’s best?s best?

Hard to answerHard to answer More gate delays (more on this later)More gate delays (more on this later) But maybe we only have 2-input gatesBut maybe we only have 2-input gates

So multi-input ANDs and ORs have to be decomposedSo multi-input ANDs and ORs have to be decomposed

Page 28: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

28

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 29: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

29

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

mintermsminterms ““OFF-set mintermsOFF-set minterms””

In this caseIn this case

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

Page 30: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

30

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 31: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

31

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 32: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

32

Product of SumsProduct of Sums Result: another standard formResult: another standard form ORs followed by ANDORs followed by AND

Terms do not have to be maxtermsTerms do not have to be maxterms

))(( ZYXZYXF

Page 33: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

33

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 34: 1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.

34

Next TimeNext Time Lab on Fri, 1/20:Lab on Fri, 1/20:

Demo lab softwareDemo lab software Do 1Do 1stst lab assignment lab assignment

download software: see website for linkdownload software: see website for linkcouple of simple Verilog programming problemscouple of simple Verilog programming problems

Next Week: More on combinational logicNext Week: More on combinational logic