Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 150 - Spring 2001 - Combinational Logic - 1 Combinational logic zLogic functions, truth tables, and switches yNOT, AND, OR, NAND, NOR, XOR,... yMinimal.

Similar presentations


Presentation on theme: "CS 150 - Spring 2001 - Combinational Logic - 1 Combinational logic zLogic functions, truth tables, and switches yNOT, AND, OR, NAND, NOR, XOR,... yMinimal."— Presentation transcript:

1 CS 150 - Spring 2001 - Combinational Logic - 1 Combinational logic zLogic functions, truth tables, and switches yNOT, AND, OR, NAND, NOR, XOR,... yMinimal set zAxioms and theorems of Boolean algebra yProofs by re-writing yProofs by perfect induction zGate logic yNetworks of Boolean functions yTime behavior zCanonical forms yTwo-level yIncompletely specified functions zSimplification yBoolean cubes and Karnaugh maps yTwo-level simplification

2 CS 150 - Spring 2001 - Combinational Logic - 2 XY16 possible functions (F0–F15) 000000000011111111 010000111100001111 100011001100110011 110101010101010101 X Y F X Y X nor Y not (X or Y) X nand Y not (X and Y) 10 not X X and Y X or Y not Y X xor Y X = Y Possible logic functions of two variables zThere are 16 possible functions of 2 input variables: yin general, there are 2**(2**n) functions of n inputs

3 CS 150 - Spring 2001 - Combinational Logic - 3 Cost of different logic functions zDifferent functions are easier or harder to implement yEach has a cost associated with the number of switches needed y0 (F0) and 1 (F15): require 0 switches, directly connect output to low/high yX (F3) and Y (F5): require 0 switches, output is one of inputs yX' (F12) and Y' (F10): require 2 switches for "inverter" or NOT-gate yX nor Y (F4) and X nand Y (F14): require 4 switches yX or Y (F7) and X and Y (F1): require 6 switches  X = Y (F9) and X  Y (F6): require 16 switches yBecause NOT, NOR, and NAND are the cheapest they are the functions we implement the most in practice

4 CS 150 - Spring 2001 - Combinational Logic - 4 XYX nand Y 001 110 XYX nor Y 001 110 X nand Y  not ( (not X) nor (not Y) ) X nor Y  not ( (not X) nand (not Y) ) Minimal set of functions zCan we implement all logic functions from NOT, NOR, and NAND? yFor example, implementing X and Y is the same as implementing not (X nand Y) zIn fact, we can do it with only NOR or only NAND yNOT is just a NAND or a NOR with both inputs tied together yand NAND and NOR are "duals", i.e., easy to implement one using the other zBut lets not move too fast... ylets look at the mathematical foundation of logic

5 CS 150 - Spring 2001 - Combinational Logic - 5 An algebraic structure zAn algebraic structure consists of ya set of elements B ybinary operations { +, } yand a unary operation { ' } ysuch that the following axioms hold: 1. set B contains at least two elements, a, b, such that a  b 2. closure: a + b is in Ba b is in B 3. commutativity: a + b = b + aa b = b a 4. associativity: a + (b + c) = (a + b) + ca (b c) = (a b) c 5. identity: a + 0 = aa 1 = a 6. distributivity: a + (b c) = (a + b) (a + c) a (b + c) = (a b) + (a c) 7. complementarity: a + a' = 1a a' = 0

6 CS 150 - Spring 2001 - Combinational Logic - 6 Boolean algebra zBoolean algebra yB = {0, 1} y+ is logical OR, is logical AND y' is logical NOT zAll algebraic axioms hold

7 CS 150 - Spring 2001 - Combinational Logic - 7 X, Y are Boolean algebra variables XYX Y 000 010 100 111 XYX'Y'X YX' Y'( X Y ) + ( X' Y' ) 0011011 0110000 1001000 1100101 ( X Y ) + ( X' Y' )  X = Y XYX'X' Y 0010 0111 1000 1100 Boolean expression that is true when the variables X and Y have the same value and false, otherwise Logic functions and Boolean algebra zAny logic function that can be expressed as a truth table can be written as an expression in Boolean algebra using the operators: ', +, and

8 CS 150 - Spring 2001 - Combinational Logic - 8 Axioms and theorems of Boolean algebra zIdentity 1. X + 0 = X1D. X 1 = X zNull 2. X + 1 = 12D. X 0 = 0 zIdempotency: 3. X + X = X3D. X X = X zInvolution: 4. (X')' = X zComplementarity: 5. X + X' = 15D. X X' = 0 zCommutativity: 6. X + Y = Y + X6D. X Y = Y X zAssociativity: 7. (X + Y) + Z = X + (Y + Z)7D. (X Y) Z = X (Y Z)

9 CS 150 - Spring 2001 - Combinational Logic - 9 Axioms and theorems of Boolean algebra (cont’d) zDistributivity: 8. X (Y + Z) = (X Y) + (X Z) 8D. X + (Y Z) = (X + Y) (X + Z) zUniting: 9. X Y + X Y' = X9D. (X + Y) (X + Y') = X zAbsorption: 10. X + X Y = X10D. X (X + Y) = X 11. (X + Y') Y = X Y11D. (X Y') + Y = X + Y zFactoring: 12. (X + Y) (X' + Z) =12D. X Y + X' Z = X Z + X' Y (X + Z) (X' + Y) zConcensus: 13. (X Y) + (Y Z) + (X' Z) = 17D. (X + Y) (Y + Z) (X' + Z) = X Y + X' Z (X + Y) (X' + Z)

10 CS 150 - Spring 2001 - Combinational Logic - 10 Axioms and theorems of Boolean algebra (cont’) zde Morgan's: 14. (X + Y +...)' = X' Y'...14D. (X Y...)' = X' + Y' +... zgeneralized de Morgan's: 15. f'(X1,X2,...,Xn,0,1,+,) = f(X1',X2',...,Xn',1,0,,+) zestablishes relationship between and +

11 CS 150 - Spring 2001 - Combinational Logic - 11 Axioms and theorems of Boolean algebra (cont’) zDuality yDual of a Boolean expression is derived by replacing by +, + by, 0 by 1, and 1 by 0, and leaving variables unchanged yAny theorem that can be proven is thus also proven for its dual! yMeta-theorem (a theorem about theorems) zduality: 16. X + Y +...  X Y... zgeneralized duality: 17. f (X1,X2,...,Xn,0,1,+,)  f(X1,X2,...,Xn,1,0,,+) zDifferent than deMorgan’s Law ythis is a statement about theorems ythis is not a way to manipulate (re-write) expressions

12 CS 150 - Spring 2001 - Combinational Logic - 12 Proving theorems (rewriting) zUsing the axioms of Boolean algebra: ye.g., prove the theorem: X Y + X Y' = X ye.g., prove the theorem: X + X Y = X distributivity (8)X Y + X Y'= X (Y + Y') complementarity (5)X (Y + Y') = X (1) identity (1D)X (1)= X identity (1D)X + X Y= X 1 + X Y distributivity (8)X 1 + X Y= X (1 + Y) identity (2)X (1 + Y)= X (1) identity (1D)X (1) = X

13 CS 150 - Spring 2001 - Combinational Logic - 13 (X + Y)' = X' Y' NOR is equivalent to AND with inputs complemented (X Y)' = X' + Y' NAND is equivalent to OR with inputs complemented XYX'Y'(X + Y)'X' Y' 0011 0110 1001 1100 XYX'Y'(X Y)'X' + Y' 0011 0110 1001 1100 Proving theorems (perfect induction) zUsing perfect induction (complete truth table): ye.g., de Morgan's: 10001000 11101110 10001000 11101110

14 CS 150 - Spring 2001 - Combinational Logic - 14 A simple example z1-bit binary adder yinputs: A, B, Carry-in youtputs: Sum, Carry-out A B Cin Cout S ABCinSCout 000 001 010 011 100 101 110 111 0110100101101001 0001011100010111 Cout = A' B Cin + A B' Cin + A B Cin' + A B Cin S = A' B' Cin + A' B Cin' + A B' Cin' + A B Cin

15 CS 150 - Spring 2001 - Combinational Logic - 15 Apply the theorems to simplify expressions zThe theorems of Boolean algebra can simplify Boolean expressions ye.g., full adder's carry-out function (same rules apply to any function) Cout = A' B Cin + A B' Cin + A B Cin' + A B Cin = A' B Cin + A B' Cin + A B Cin' + A B Cin + A B Cin = A' B Cin + A B Cin + A B' Cin + A B Cin' + A B Cin = (A' + A) B Cin + A B' Cin + A B Cin' + A B Cin = (1) B Cin + A B' Cin + A B Cin' + A B Cin = B Cin + A B' Cin + A B Cin' + A B Cin + A B Cin = B Cin + A B' Cin + A B Cin + A B Cin' + A B Cin = B Cin + A (B' + B) Cin + A B Cin' + A B Cin = B Cin + A (1) Cin + A B Cin' + A B Cin = B Cin + A Cin + A B (Cin' + Cin) = B Cin + A Cin + A B (1) = B Cin + A Cin + A B

16 CS 150 - Spring 2001 - Combinational Logic - 16 XYZ000010100111XYZ000010100111 XY0110XY0110 XYZ000011101111XYZ000011101111 X Y X X Y Y Z Z From Boolean expressions to logic gates zNOTX'X~X zANDX YXYX  Y zORX + YX  Y

17 CS 150 - Spring 2001 - Combinational Logic - 17 X Y Z XYZ001011101110XYZ001011101110 XYZ001010100110XYZ001010100110 Z X Y X Y Z XYZ001010100111XYZ001010100111 XYZ000011101110XYZ000011101110 Z X Y X xor Y = X Y' + X' Y X or Y but not both ("inequality", "difference") X xnor Y = X Y + X' Y' X and Y are the same ("equality", "coincidence") From Boolean expressions to logic gates (cont’d) zNAND zNOR  XOR X  Y zXNOR X = Y

18 CS 150 - Spring 2001 - Combinational Logic - 18 T1 T2 use of 3-input gate A B C D T2 T1 Z A B C D Z From Boolean expressions to logic gates (cont’d) zMore than one way to map expressions to gates ye.g., Z = A' B' (C + D) = (A' (B' (C + D)))

19 CS 150 - Spring 2001 - Combinational Logic - 19 time change in Y takes time to "propagate" through gates Waveform view of logic functions zJust a sideways truth table ybut note how edges don't line up exactly yit takes time for a gate to switch its output!

20 CS 150 - Spring 2001 - Combinational Logic - 20 ABCZ00000011010001111000101111011110ABCZ00000011010001111000101111011110 Choosing different realizations of a function two-level realization (we don't count NOT gates) XOR gate (easier to draw but costlier to build) multi-level realization (gates with fewer inputs)

21 CS 150 - Spring 2001 - Combinational Logic - 21 Which realization is best? zReduce number of inputs yliteral: input variable (complemented or not) xcan approximate cost of logic gate as 2 transistors per literal xwhy not count inverters? yFewer literals means less transistors xsmaller circuits yFewer inputs implies faster gates xgates are smaller and thus also faster yFan-ins (# of gate inputs) are limited in some technologies zReduce number of gates yFewer gates (and the packages they come in) means smaller circuits xdirectly influences manufacturing costs

22 CS 150 - Spring 2001 - Combinational Logic - 22 Which is the best realization? (cont’d) zReduce number of levels of gates yFewer level of gates implies reduced signal propagation delays yMinimum delay configuration typically requires more gates xwider, less deep circuits zHow do we explore tradeoffs between increased circuit delay and size? yAutomated tools to generate different solutions yLogic minimization: reduce number of gates and complexity yLogic optimization: reduction while trading off against delay

23 CS 150 - Spring 2001 - Combinational Logic - 23 Are all realizations equivalent? zUnder the same input stimuli, the three alternative implementations have almost the same waveform behavior ydelays are different yglitches (hazards) may arise yvariations due to differences in number of gate levels and structure zThree implementations are functionally equivalent

24 CS 150 - Spring 2001 - Combinational Logic - 24 Implementing Boolean functions zTechnology independent yCanonical forms yTwo-level forms yMulti-level forms zTechnology choices yPackages of a few gates yRegular logic yTwo-level programmable logic yMulti-level programmable logic

25 CS 150 - Spring 2001 - Combinational Logic - 25 Canonical forms zTruth table is the unique signature of a Boolean function zMany alternative gate realizations may have the same truth table zCanonical forms yStandard forms for a Boolean expression yProvides a unique algebraic signature

26 CS 150 - Spring 2001 - Combinational Logic - 26 ABCFF' 00001 00110 01001 01110 10001 10110 11010 11110 F = F' = A'B'C' + A'BC' + AB'C' Sum-of-products canonical forms zAlso known as disjunctive normal form zAlso known as minterm expansion F = 001 011 101 110 111 + A'BC+ AB'C+ ABC' + ABC A'B'C

27 CS 150 - Spring 2001 - Combinational Logic - 27 short-hand notation for minterms of 3 variables ABCminterms 000A'B'C'm0 001A'B'Cm1 010A'BC'm2 011A'BCm3 100AB'C'm4 101AB'Cm5 110ABC'm6 111ABCm7 F in canonical form : F(A, B, C)=  m(1,3,5,6,7) = m1 + m3 + m5 + m6 + m7 = A'B'C + A'BC + AB'C + ABC' + ABC canonical form  minimal form F(A, B, C)= A'B'C + A'BC + AB'C + ABC + ABC' = (A'B' + A'B + AB' + AB)C + ABC' = ((A' + A)(B' + B))C + ABC' = C + ABC' = ABC' + C = AB + C Sum-of-products canonical form (cont’d) zProduct term (or minterm) yANDed product of literals – input combination for which output is true yEach variable appears exactly once, in true or inverted form (but not both)

28 CS 150 - Spring 2001 - Combinational Logic - 28 ABCFF' 00001 00110 01001 01110 10001 10110 11010 11110 F = 000 010 100 F = F' = (A + B + C') (A + B' + C') (A' + B + C') (A' + B' + C) (A' + B' + C') Product-of-sums canonical form zAlso known as conjunctive normal form zAlso known as maxterm expansion (A + B + C)(A + B' + C) (A' + B + C)

29 CS 150 - Spring 2001 - Combinational Logic - 29 ABCmaxterms 000A+B+CM0 001A+B+C'M1 010A+B'+CM2 011A+B'+C'M3 100A'+B+CM4 101A'+B+C'M5 110A'+B'+CM6 111A'+B'+C'M7 short-hand notation for maxterms of 3 variables F in canonical form: F(A, B, C)=  M(0,2,4) = M0 M2 M4 = (A + B + C) (A + B' + C) (A' + B + C) canonical form  minimal form F(A, B, C)= (A + B + C) (A + B' + C) (A' + B + C) = (A + B + C) (A + B' + C) (A + B + C) (A' + B + C) = (A + C) (B + C) Product-of-sums canonical form (cont’d) zSum term (or maxterm) yORed sum of literals – input combination for which output is false yeach variable appears exactly once, in true or inverted form (but not both)

30 CS 150 - Spring 2001 - Combinational Logic - 30 S-o-P, P-o-S, and de Morgan’s theorem zSum-of-products yF' = A'B'C' + A'BC' + AB'C' zApply de Morgan's y(F')' = (A'B'C' + A'BC' + AB'C')' yF = (A + B + C) (A + B' + C) (A' + B + C) zProduct-of-sums yF' = (A + B + C') (A + B' + C') (A' + B + C') (A' + B' + C) (A' + B' + C') zApply de Morgan's y(F')' = ( (A + B + C')(A + B' + C')(A' + B + C')(A' + B' + C)(A' + B' + C') )' yF = A'B'C + A'BC + AB'C + ABC' + ABC

31 CS 150 - Spring 2001 - Combinational Logic - 31 canonical sum-of-products minimized sum-of-products canonical product-of-sums minimized product-of-sums F1 F2 F3 B A C F4 Four alternative two-level implementations of F = AB + C

32 CS 150 - Spring 2001 - Combinational Logic - 32 Waveforms for the four alternatives zWaveforms are essentially identical yExcept for timing hazards (glitches) yDelays almost identical (modeled as a delay per level, not type of gate or number of inputs to gate)

33 CS 150 - Spring 2001 - Combinational Logic - 33 Mapping between canonical forms zMinterm to maxterm conversion yUse maxterms whose indices do not appear in minterm expansion  e.g., F(A,B,C) =  m(1,3,5,6,7) =  M(0,2,4) zMaxterm to minterm conversion yUse minterms whose indices do not appear in maxterm expansion  e.g., F(A,B,C) =  M(0,2,4) =  m(1,3,5,6,7) zMinterm expansion of F to minterm expansion of F' yUse minterms whose indices do not appear  e.g., F(A,B,C) =  m(1,3,5,6,7) F'(A,B,C) =  m(0,2,4) zMaxterm expansion of F to maxterm expansion of F' yUse maxterms whose indices do not appear  e.g., F(A,B,C) =  M(0,2,4) F'(A,B,C) =  M(1,3,5,6,7)

34 CS 150 - Spring 2001 - Combinational Logic - 34 ABCDWX YZ 00000001 00010010 00100011 00110100 01000101 01010110 01100111 01111000 10001001 10010000 1010XXXX 1011XXXX 1100XXXX 1101XXXX 1110XXXX 1111XXXX off-set of W these inputs patterns should never be encountered in practice – "don't care" about associated output values, can be exploited in minimization Incompleteley specified functions zExample: binary coded decimal increment by 1 yBCD digits encode decimal digits 0 – 9 in bit patterns 0000 – 1001 don't care (DC) set of W on-set of W

35 CS 150 - Spring 2001 - Combinational Logic - 35 Notation for incompletely specified functions zDon't cares and canonical forms ySo far, only represented on-set yAlso represent don't-care-set yNeed two of the three sets (on-set, off-set, dc-set) zCanonical representations of the BCD increment by 1 function: yZ = m0 + m2 + m4 + m6 + m8 + d10 + d11 + d12 + d13 + d14 + d15  Z =  [ m(0,2,4,6,8) + d(10,11,12,13,14,15) ] yZ = M1 M3 M5 M7 M9 D10 D11 D12 D13 D14 D15  Z =  [ M(1,3,5,7,9) D(10,11,12,13,14,15) ]

36 CS 150 - Spring 2001 - Combinational Logic - 36 Simplification of two-level combinational logic zFinding a minimal sum of products or product of sums realization yExploit don't care information in the process zAlgebraic simplification yNot an algorithmic/systematic procedure yHow do you know when the minimum realization has been found? zComputer-aided design tools yPrecise solutions require very long computation times, especially for functions with many inputs (> 10) yHeuristic methods employed – "educated guesses" to reduce amount of computation and yield good if not best solutions zHand methods still relevant yTo understand automatic tools and their strengths and weaknesses yAbility to check results (on small examples)

37 CS 150 - Spring 2001 - Combinational Logic - 37 ABF001010101110ABF001010101110 B has the same value in both on-set rows – B remains A has a different value in the two rows – A is eliminated F = A'B'+AB' = (A'+A)B' = B' The Uniting Theorem zKey tool to simplification: A (B' + B) = A zEssence of simplification of two-level logic yFind two element subsets of the ON-set where only one variable changes its value – this single varying variable can be eliminated and a single product term used to represent both elements

38 CS 150 - Spring 2001 - Combinational Logic - 38 1-cube X 01 Boolean cubes zVisual technique for indentifying when the uniting theorem can be applied zn input variables = n-dimensional "cube" 2-cube X Y 11 00 01 10 3-cube X Y Z 000 111 101 4-cube W X Y Z 0000 1111 1000 0111

39 CS 150 - Spring 2001 - Combinational Logic - 39 ABF001010101110ABF001010101110 ON-set = solid nodes OFF-set = empty nodes DC-set =  'd nodes two faces of size 0 (nodes) combine into a face of size 1(line) A varies within face, B does not this face represents the literal B' Mapping truth tables onto Boolean cubes zUniting theorem combines two "faces" of a cube into a larger "face" zExample: A B 11 00 01 10 F

40 CS 150 - Spring 2001 - Combinational Logic - 40 ABCinCout 0000 0010 0100 0111 1000 1011 1101 1111 Cout = BCin+AB+ACin A(B+B')Cin the on-set is completely covered by the combination (OR) of the subcubes of lower dimensionality - note that “111” is covered three times Three variable example zBinary full-adder carry-out logic A B C 000 111 101 (A'+A)BCin AB(Cin'+Cin)

41 CS 150 - Spring 2001 - Combinational Logic - 41 F(A,B,C) =  m(4,5,6,7) on-set forms a square i.e., a cube of dimension 2 represents an expression in one variable i.e., 3 dimensions – 2 dimensions A is asserted (true) and unchanged B and C vary This subcube represents the literal A Higher dimensional cubes zSub-cubes of higher dimension than 2 A B C 000 111 101 100 001 010 011 110

42 CS 150 - Spring 2001 - Combinational Logic - 42 m-dimensional cubes in a n-dimensional Boolean space zIn a 3-cube (three variables): y0-cube, i.e., a single node, yields a term in 3 literals y1-cube, i.e., a line of two nodes, yields a term in 2 literals y2-cube, i.e., a plane of four nodes, yields a term in 1 literal y3-cube, i.e., a cube of eight nodes, yields a constant term "1" zIn general, ym-subcube within an n-cube (m < n) yields a term with n – m literals

43 CS 150 - Spring 2001 - Combinational Logic - 43 ABF001010101110ABF001010101110 Karnaugh maps zFlat map of Boolean cube yWrap–around at edges yHard to draw and visualize for more than 4 dimensions yVirtually impossible for more than 6 dimensions zAlternative to truth-tables to help visualize adjacencies yGuide to applying the uniting theorem yOn-set elements with only one variable changing value are adjacent unlike the situation in a linear truth-table 02130213 01 A B 0 1 1 00 1

44 CS 150 - Spring 2001 - Combinational Logic - 44 Karnaugh maps (cont’d) zNumbering scheme based on Gray–code ye.g., 00, 01, 11, 10 yOnly a single bit changes in code for adjacent map cells 02130213 0001 AB C 0 1 64756475 1110 C B A 02130213 64756475 C B A 04150415 128 139 D A 37263726 1511 1410 C B 13 = 1101= ABC’D

45 CS 150 - Spring 2001 - Combinational Logic - 45 Adjacencies in Karnaugh maps zWrap from first to last column zWrap top row to bottom row 000010 001011 110100 111101 C B A A B C 000 111 101 100 001 010 011 110

46 CS 150 - Spring 2001 - Combinational Logic - 46 obtain the complement of the function by covering 0s with subcubes Karnaugh map examples zF = zCout =  f(A,B,C) =  m(0,4,6,7) 0 00010001 101110111 Cin B A 10 B A 100010000 011101111 C B A B’ AB AC + ACin+ BCin + B’C’ + AB’

47 CS 150 - Spring 2001 - Combinational Logic - 47 F(A,B,C) =  m(0,4,5,7) F'(A,B,C) =  m(1,2,3,6) F' simply replace 1's with 0's and vice versa G(A,B,C) = More Karnaugh map examples 0011 C B A 100010000 011101111 C B A 011101111 100010000 C B A A = AC + B’C’ = BC’ + A’C

48 CS 150 - Spring 2001 - Combinational Logic - 48 C+ B’D’ find the smallest number of the largest possible subcubes to cover the ON-set (fewer terms with fewer inputs per term) Karnaugh map: 4-variable example  F(A,B,C,D) =  m(0,2,3,5,6,7,8,10,11,14,15) F = D A B A B C D 0000 1111 1000 0111 10011001 010001000 11 11 C + A’BD

49 CS 150 - Spring 2001 - Combinational Logic - 49 + B’C’D Karnaugh maps: don’t cares  f(A,B,C,D) =  m(1,3,5,7,9) + d(6,12,13) ywithout don't cares xf = 01 X0X1X0X1 D A1 110X110X 00 B C A’D

50 CS 150 - Spring 2001 - Combinational Logic - 50 Karnaugh maps: don’t cares (cont’d)  f(A,B,C,D) =  m(1,3,5,7,9) + d(6,12,13) yf = A'D + B'C'Dwithout don't cares yf = with don't cares don't cares can be treated as 1s or 0s depending on which is more advantageous 01 X0X1X0X1 D A1 110X110X 00 B C A'D by using don't care as a "1" a 2-cube can be formed rather than a 1-cube to cover this node + C'D

51 CS 150 - Spring 2001 - Combinational Logic - 51 we'll need a 4-variable Karnaugh map for each of the 3 output functions Design example: two-bit comparator block diagram LT EQ GT A B C D A B C D N1 N2 ABCDLTEQGT 0000010 01100 10100 11100 0100001 01010 10100 11100 1000001 01001 10010 11100 1100001 01001 10001 11010 and truth table

52 CS 150 - Spring 2001 - Combinational Logic - 52 A' B' D + A' C + B' C D B C' D' + A C' + A B D' LT= EQ= GT= K-map for EQK-map for LTK-map for GT Design example: two-bit comparator (cont’d) 0 00100010 00 D A11 010001000 B C 10011001 00 D A00 10011001 B C 010001000 11 D A00 0 00100010 B C = (A xnor C) (B xnor D) LT and GT are similar (flip A/C and B/D) A'B'C'D' + A'BC'D + ABCD + AB'CD’

53 CS 150 - Spring 2001 - Combinational Logic - 53 two alternative implementations of EQ with and without XOR XNOR is implemented with at least 3 simple gates Design example: two-bit comparator (cont’d)

54 CS 150 - Spring 2001 - Combinational Logic - 54 block diagram and truth table 4-variable K-map for each of the 4 output functions A2A1B2B1P8P4P2P1 00000000 010000 100000 110000 01000000 010001 100010 110011 10000000 010010 100100 110110 11000000 010011 100110 111001 Design example: 2x2-bit multiplier P1 P2 P4 P8 A1 A2 B1 B2

55 CS 150 - Spring 2001 - Combinational Logic - 55 K-map for P8 K-map for P4 K-map for P2K-map for P1 Design example: 2x2-bit multiplier (cont’d) 00 00 B1 A200 011101111 A1 B2 0 00010001 0 00100010 B1 A2 010001000 100010000 A1 B2 00 01 B1 A2 01010101 01100110 A1 B2 00 00 B1 A200 100010000 A1 B2 P8 = A2A1B2B1 P4= A2B2B1' + A2A1'B2 P2= A2'A1B2 + A1B2B1' + A2B2'B1 + A2A1'B1 P1= A1B1

56 CS 150 - Spring 2001 - Combinational Logic - 56 I8I4I2I1O8O4O2O1 00000001 00010010 00100011 00110100 01000101 01010110 01100111 01111000 10001001 10010000 1010XXXX 1011XXXX 1100XXXX 1101XXXX 1110XXXX 1111XXXX block diagram and truth table 4-variable K-map for each of the 4 output functions O1 O2 O4 O8 I1 I2 I4 I8 Design example: BCD increment by 1

57 CS 150 - Spring 2001 - Combinational Logic - 57 O8 = I4 I2 I1 + I8 I1' O4 = I4 I2' + I4 I1' + I4’ I2 I1 O2 = I8’ I2’ I1 + I2 I1' O1 = I1' O8 O4 O2 O1 Design example: BCD increment by 1 (cont’d) 00 X1X0X1X0 I1 I8 010001000 XX I4 I2 01 X0X0X0X0 I1 I801 XX I4 I2 01010101 X0X0X0X0 I1 I8 10011001 XX I4 I2 10 X1X0X1X0 I1 I801 XX I4 I2

58 CS 150 - Spring 2001 - Combinational Logic - 58 Definition of terms for two-level simplification zImplicant ySingle element of ON-set or DC-set or any group of these elements that can be combined to form a subcube zPrime implicant yImplicant that can't be combined with another to form a larger subcube zEssential prime implicant yPrime implicant is essential if it alone covers an element of ON-set yWill participate in ALL possible covers of the ON-set yDC-set used to form prime implicants but not to make implicant essential zObjective: yGrow implicant into prime implicants (minimize literals per term) yCover the ON-set with as few prime implicants as possible (minimize number of product terms)

59 CS 150 - Spring 2001 - Combinational Logic - 59 0X110X111 10101010 D A 100010000 11 B C 5 prime implicants: BD, ABC', ACD, A'BC, A'C'D Examples to illustrate terms 01 10101010 D A 01010101 10 B C 6 prime implicants: A'B'D, BC', AC, A'C'D, AB, B'CD minimum cover: AC + BC' + A'B'D essential minimum cover: 4 essential implicants essential

60 CS 150 - Spring 2001 - Combinational Logic - 60 Algorithm for two-level simplification zAlgorithm: minimum sum-of-products expression from a Karnaugh map yStep 1: choose an element of the ON-set yStep 2: find "maximal" groupings of 1s and Xs adjacent to that element xconsider top/bottom row, left/right column, and corner adjacencies xthis forms prime implicants (number of elements always a power of 2) yRepeat Steps 1 and 2 to find all prime implicants yStep 3: revisit the 1s in the K-map xif covered by single prime implicant, it is essential, and participates in final cover x1s covered by essential prime implicant do not need to be revisited yStep 4: if there remain 1s not covered by essential prime implicants xselect the smallest number of prime implicants that cover the remaining 1s

61 CS 150 - Spring 2001 - Combinational Logic - 61 X101X101 011101111 D A 0X010X01 X001X001 B C 3 primes around AB'C'D' Algorithm for two-level simplification (example) X101X101 011101111 D A 0X010X01 X001X001 B C 2 primes around A'BC'D' X101X101 011101111 D A 0X010X01 X001X001 B C 2 primes around ABC'D X101X101 011101111 D A 0X010X01 X001X001 B C minimum cover (3 primes) X101X101 011101111 D A 0X010X01 X001X001 B C X101X101 011101111 D A 0X010X01 X001X001 B C 2 essential primes X101X101 011101111 D A 0X010X01 X001X001 B C

62 CS 150 - Spring 2001 - Combinational Logic - 62 Combinational logic summary zLogic functions, truth tables, and switches yNOT, AND, OR, NAND, NOR, XOR,..., minimal set zAxioms and theorems of Boolean algebra yProofs by re-writing and perfect induction zGate logic yNetworks of Boolean functions and their time behavior zCanonical forms yTwo-level and incompletely specified functions zSimplification yTwo-level simplification zLater yAutomation of simplification yMulti-level logic yDesign case studies yTime behavior


Download ppt "CS 150 - Spring 2001 - Combinational Logic - 1 Combinational logic zLogic functions, truth tables, and switches yNOT, AND, OR, NAND, NOR, XOR,... yMinimal."

Similar presentations


Ads by Google