P. 1
Mx1Lecture2

# Mx1Lecture2

|Views: 13|Likes:

See more
See less

11/29/2010

pdf

text

original

# Combinational Logic Circuits Design

Part 1 – Gate Circuits, Boolean Equations, Circuit Optimization
Dr Shoudong Huang
School of Electrical, Mechanical and Mechatronic Systems, Faculty of Engineering and Information Technology UTS

Binary Logic and Gates
Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic logical operators are the logic functions AND, OR and NOT. Logic gates implement logic functions. Boolean Algebra: a useful mathematical system for specifying and transforming logic functions. We study Boolean algebra as a foundation for designing and analyzing digital systems!
Combinational logic - Part 1 2

Binary Variables
Recall that the two binary values have different names:
• • • • True/False On/Off Yes/No 1/0

We use 1 and 0 to denote the two values. Variable identifier examples:
• A, B, y, z, or X1 for now • RESET, START_IT, or ADD1 later
Combinational logic - Part 1 3

NOT is denoted by an overbar ( ¯ ).Logical Operations The three basic logical operations are: • AND • OR • NOT AND is denoted by a dot (·).Part 1 4 . OR is denoted by a plus (+). Combinational logic . or (~) before the variable.

” Note: The statement: 1 + 1 = 2 (read “one plus one equals two”) is not the same as 1 + 1 = 1 (read “1 or 1 equals 1”).Notation Examples Examples: • Y = A · B is read “Y is equal to A AND B. Combinational logic .Part 1 5 .” • z = x + y is read “z is equal to x OR y.” • X = A is read “X is equal to NOT A.

Part 1 6 .Operator Definitions Operations are defined on the values "0" and "1" for each operator: AND OR NOT 0·0=0 0·1=0 1·0=0 1·1=1 0+0=0 0+1=1 1+0=1 1+1=1 0=1 1=0 Combinational logic .

Truth Tables Truth table − a tabular listing of the values of a function for all possible combinations of values on its arguments Example: Truth tables for the basic logic operations: X 0 0 1 1 AND Y Z = X·Y 0 0 1 0 0 0 1 1 X 0 0 1 1 Y 0 1 0 1 OR Z = X+Y 0 1 1 1 NOT X 0 1 Z=X 1 0 Combinational logic .Part 1 7 .

Logic Function Implementation
Using Switches
• For inputs:
logic 1 is switch closed logic 0 is switch open Switches in parallel => OR

• For outputs:
logic 1 is light on logic 0 is light off.

Switches in series => AND

• NOT uses a switch such Normally-closed switch => NOT that:
logic 1 is switch open logic 0 is switch closed C

Combinational logic - Part 1

8

Logic Function Implementation (Continued)
Example: Logic Using Switches
B A C

D

Light is on (L = 1) for L(A, B, C, D) = and off (L = 0), otherwise.

Combinational logic - Part 1

9

Logic Gate Symbols and Behavior
Logic gates have special symbols:

And waveform behavior in time as follows:

Combinational logic - Part 1

10

expressions and logic diagrams are not. truth tables and logic diagrams describe the same function! Truth tables are unique.Part 1 11 . Combinational logic .Logic Diagrams and Expressions Truth Table XYZ 000 001 010 011 100 101 110 111 F = X + Y 0 1 0 0 1 1 1 1 Equation ·Z X Y Z F = X +Y Z Logic Diagram F Boolean equations. This gives flexibility in implementing functions.

4. X . X(Y + Z) = XY + XZ 16. 5.X = 0 10. 6. B.Part 1 12 . (X + Y) + Z = X + (Y + Z) 14. 7. (XY) Z = X(YZ) Distributive 15. · and ) that satisfies the following basic identities: 1. 9. X + YZ = (X + Y) (X + Z) DeMorgan ’s 17. X + Y = Y + X 12. Y XY = YX Commutative Associative 13. X . together with three binary operators (denoted +. 8.X = X X . 3. 11. X+0= X X+1 =1 X+X =X X+X =1 X=X 2.1 =X X . X + Y = X . Y = X + Y Combinational logic .Boolean Algebra by an English Mathematician George Boole (1815-1864) An algebraic structure defined on a set of at least two elements.0 =0 X .

we leave out the symbol “·” The identities above are organized into pairs. The identities appear in dual pairs. i.Some Properties of Identities & the Algebra If the meaning is unambiguous. Combinational logic . When there is only one identity on a line the identity is self-dual. These pairs have names as follows: 1-4 Existence of 0 and 1 5-6 Idempotence 7-8 Existence of complement 9 Involution 10-11 Commutative Laws 12-13 Associative Laws 14-15 Distributive Laws 16-17 DeMorgan’s Laws The dual of an algebraic expression is obtained by interchanging + and · and interchanging 0’s and 1’s.Part 1 13 .. the dual expression = the original expression. e.

the dual of an expression does not equal the expression itself.Part 1 14 .Some Properties of Identities & the Algebra (Continued) Unless it happens to be self-dual. Example: F = (A + C) · B + 0 dual F = (A · C + B) · 1 = A · C + B Example: G = X · Y + (W + Z) dual G = Example: H = A · B + A · C + B · C dual H = Are any of these functions self-dual? Combinational logic .

OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D) Combinational logic .Boolean Operator Precedence The order of evaluation in a Boolean expression is: 1. Parentheses 2. NOT 3. AND 4.Part 1 15 .

Example 1: Boolean Algebraic Proof A + A·B = A Proof Steps A + A·B (Absorption Theorem) Justification (identity or theorem) = A·1+A·B X=X·1 = A · ( 1 + B) X · Y + X · Z = X ·(Y + Z)(Distributive Law) =A·1 =A 1+X=1 X·1=X Our primary reason for doing proofs is to learn: • Careful and efficient use of the identities and theorems of Boolean algebra.Part 1 16 . irrespective of the application. and • How to choose the appropriate identity or theorem to apply to make forward progress. Combinational logic .

Example 2: Boolean Algebraic Proofs AB + AC + BC = AB + AC (Consensus Theorem) Proof Steps Justification (identity or theorem) AB + AC + BC = AB + AC + 1 · BC ? = AB +AC + (A + A) · BC ? = Combinational logic .Part 1 17 .

Part 1 18 .Example 3: Boolean Algebraic Proofs ( X + Y ) Z + X Y = Y( X + Z ) Proof Steps Justification (identity or theorem) ( X + Y )Z + X Y = Combinational logic .

Useful Theorems x y + x y = y (x + y )(x + y )= y x + x⋅y = x x ⋅ (x + y ) = x Minimization Absorption x + x y = x + y x (x + y )= xy Simplification x y+x z+y z = x y+x z Consensus (x + y ) (x + z ) (y + z ) = (x + y ) (x + z ) x+y =x y x y =x+y DeMorgan' s Laws Combinational logic .Part 1 19 .

Part 1 20 .Proof of Simplification x y+x y=y (x + y )(x + y ) = y Combinational logic .

Boolean Function Evaluation F1 = xy z F2 = x + yz F3 = x y z + x y z + x y F4 = x y + x z x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 z F1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 F2 0 1 0 0 1 1 1 1 F3 F4 Combinational logic .Part 1 21 .

Expression Simplification An application of Boolean algebra Simplify to contain the smallest number of literals (complemented and uncomplemented variables): A B + ACD + A BD + AC D + A BCD = AB + ABCD + A C D + A C D + A B D = AB + AB(CD) + A C (D + D) + A B D = AB + A C + A B D = B(A + AD) +AC = B (A + D) + A C 5 literals Combinational logic .Part 1 22 .

Interchange AND and OR operators 2. Complement each constant value and literal Example: Complement F = xy z + x y z F = (x + y + z)(x + y + z) Example: Complement G = (a + bc)d + e G= Combinational logic .Part 1 23 .Complementing Functions Use DeMorgan's Theorem to complement a function: 1.

Part 1 24 .Overview – Canonical Forms What are Canonical Forms? Minterms and Maxterms Index Representation of Minterms and Maxterms Sum-of-Minterm (SOM) Representations Product-of-Maxterm (POM) Representations Representation of Complements of Functions Conversions between Representations Combinational logic .

Part 1 25 . • Has a correspondence to the truth tables Canonical Forms in common usage: • Sum of Minterms (SOM) • Product of Maxterms (POM) Combinational logic .Canonical Forms It is useful to specify Boolean functions in a form that: • Allows comparison for equality.

Example: Two variables (X and Y)produce 2 x 2 = 4 combinations: XY (both normal) X Y (X normal.g. Y complemented) XY (X complemented.g. Combinational logic .. Y normal) X Y (both complemented) Thus there are four minterms of two variables..Part 1 26 . x) or complemented (e.Minterms Minterms are AND terms with every variable present in either true or complemented form. x ). there are 2n minterms for n variables. Given that each binary variable may appear normal (e.

Example: Two variables (X and Y) produce 2 x 2 = 4 combinations: X + Y (both normal) X + Y (x normal. x).g. there are 2n maxterms for n variables. Given that each binary variable may appear normal (e.. y complemented) X + Y (x complemented.g. x) or complemented (e. y normal) X + Y (both complemented) Combinational logic .Part 1 27 .Maxterms Maxterms are OR terms with every variable in true or complemented form..

Combinational logic .Part 1 28 .Maxterms and Minterms Examples: Two variable minterms and maxterms. Index 0 1 2 Minterm xy xy xy Maxterm x+y x+y x+y 3 xy x+y The index above is important for describing which variables in the terms are true and which are complemented.

a b c. • Minterms: a b c. a b c • Terms: (a + c). b. c: • Maxterms: (a + b + c). and (a + b) do not contain all variables Combinational logic . All variables will be present in a minterm or maxterm and will be listed in the same order (usually alphabetically) Example: For variables a. (a + b + c) • Terms: (b + a + c).Standard Order Minterms and maxterms are designated with a subscript The subscript is a number. corresponding to a binary pattern The bits in the pattern represent the complemented or normal state of each variable listed in a standard order.Part 1 29 . and (c + b + a) are NOT in standard order. b c. a c b.

For Maxterms: • “0” means the variable is “Not Complemented” and • “1” means the variable is “Complemented”.Part 1 30 . is used to determine whether the variable is shown in the true form or complemented form.Purpose of the Index The index for the minterm or maxterm. expressed as a binary number. For Minterms: • “1” means the variable is “Not Complemented” and • “0” means the variable is “Complemented”. Combinational logic .

then Z.Y. called m0 is X Y Z . All three variables are complemented for minterm 0 ( X . Y. Y. then Y.Index Example in Three Variables Example: (for three variables) Assume the variables are called X.Z). The standard order is X. Z) and no variables are complemented for Maxterm 0 (X. Maxterm 0.Part 1 31 . Minterm 6 ? Maxterm 6 ? Combinational logic . and Z. • • • • Minterm 0. The Index 0 (base 10) = 000 (base 2) for three variables). called M0 is (X + Y + Z).

Index Examples – Four Variables Index i 0 1 3 5 7 10 13 15 Binary Minterm Maxterm Pattern mi Mi abcd a + b + c + d 0000 0001 ? abcd ? 0011 a+b+c+d 0101 abcd a + b + c + d ? 0111 a+b+c+d 1010 abcd a + b + c + d ? abcd 1101 abcd a + b + c + d 1111 Combinational logic .Part 1 32 .

the above holds for terms of n variables giving: M i = m i and m i = M i Thus Mi is the complement of mi.Minterm and Maxterm Relationship Review: DeMorgan's Theorem x · y = x + y and x + y = x · y Two-variable example: M 2 = x + y and m 2 = x·y Thus M2 is the complement of m2 and vice-versa. Combinational logic .Part 1 33 . Since DeMorgan's Theorem holds for n variables.

Function Tables for Both Minterms of 2 variables xy 00 01 10 11 m0 1 0 0 0 m1 m2 m3 0 0 0 1 0 0 0 1 0 0 0 1 Maxterms of 2 variables x y M0 00 0 01 1 10 1 11 1 M1 1 0 1 1 M2 1 1 0 1 M3 1 1 1 0 Each column in the maxterm function table is the complement of the column in the minterm function table since Mi is the complement of mi.Part 1 34 . Combinational logic .

Combinational logic . All other entries are 0.Observations In the function tables: • Each minterm has one and only one 1 present in the 2n terms (a minimum of 1s). This gives us two canonical forms: • Sum of Minterms (SOM) • Product of Maxterms (POM) for stating any Boolean function. These are called the maxterms of the function.Part 1 35 . We can implement any function by "ANDing" the maxterms corresponding to "0" entries in the function table. • Each maxterm has one and only one 0 present in the 2n terms All other entries are 1 (a maximum of 1s). We can implement any function by "ORing" the minterms corresponding to "1" entries in the function table. These are called the minterms of the function.

Minterm Function Example Example: Find F1 = m1 + m4 + m7 F1 = x y z + x y z + x y z x y z index m1 + m4 + m7 = F1 000 001 010 011 100 101 110 111 0 1 2 3 4 5 6 7 0 1 0 0 0 0 0 0 + + + + + + + + 0 0 0 0 1 0 0 0 + + + + + + + + 0 0 0 0 0 0 0 1 =0 =1 =0 =0 =1 =0 =0 =1 36 Combinational logic .Part 1 .

Minterm Function Example F(A. B.Part 1 37 . D. D. C. C. E) = m2 + m9 + m17 + m23 F(A. B. E) = Combinational logic .

Maxterm Function Example Example: Implement F1 in maxterms: F1 = M0 · M2 · M3 · M5 · M6 F1 = (x + y + z) ·(x + y + z)·(x + y + z ) ·( x + y + z )·( x + y + z) xyz 000 001 010 011 100 101 110 111 i 0 1 2 3 4 5 6 7 M0 ⋅ M2 ⋅ M3 ⋅ M5 ⋅ M6 0 ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 1 1 ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 1 1 ⋅ 0 ⋅ 1 ⋅ 1 ⋅ 1 1 ⋅ 1 ⋅ 0 ⋅ 1 ⋅ 1 1 ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 1 1 ⋅ 1 ⋅ 1 ⋅ 0 ⋅ 1 1 ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 0 1 ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 1 = F1 =0 =1 =0 =0 =1 =0 =0 =1 38 Combinational logic .Part 1 .

First expand terms: f = x ( y + y ) + x y Then distribute terms: f = xy + x y + x y Express as sum of minterms: f = m3 + m2 + m0 Combinational logic . Example: Implement f = x + x y as a sum of minterms. • For the function table. the minterms used are the terms corresponding to the 1's • For expressions.Canonical Sum of Minterms Any Boolean function can be expressed as a Sum of Minterms. expand all terms first to explicitly list all minterms.Part 1 39 . Do this by “ANDing” any term missing a variable v with a term (v + v ).

Another SOM Example Example: F = A + B C There are three variables. and C which we take to be the standard order. A. B. Expanding the terms with missing variables: Collect terms (removing all but one of duplicate terms): Express as SOM: Combinational logic .Part 1 40 .

Shorthand SOM Form
From the previous example, we started with: F=A+BC We ended up with: F = m1+m4+m5+m6+m7 This can be denoted in the formal shorthand: F( A , B, C) = Σm(1,4,5,6,7 ) Note that we explicitly show the standard variables in order and drop the “m” designators.
Combinational logic - Part 1 41

Canonical Product of Maxterms
Any Boolean Function can be expressed as a Product of Maxterms (POM).
• For the function table, the maxterms used are the terms corresponding to the 0's. • For an expression, expand all terms first to explicitly list all maxterms. Do this by first applying the second distributive law , “ORing” terms missing variable v with a term equal to and then applying the distributive law again.

vv

Example: Convert to product of maxterms:
Apply

f ( x, y , z ) = x + x y
the distributive law:

x + x y = (x + x )(x + y ) = 1 (x + y ) = x + y

x + y + z z = (x + y + z ) (x + y + z )
Combinational logic - Part 1 42

Express as POM: f = M2 · M3

Another POM Example
Convert to Product of Maxterms: f(A, B, C) = A C + B C + A B Use x + y z = (x+y)·(x+z) with x = (A C + B C), y = A , and z = B to get: f = (A C + B C + A )(A C + B C + B) Then use x + x y = x + y to get: f = ( C + BC + A )(A C + C + B ) and a second time to get: f = ( C + B + A )(A + C + B ) Rearrange to standard order, f = ( A + B + C)(A + B + C) to give f = M5 · M2
Combinational logic - Part 1 43

2. y . 5 .6) F( x. 7 ) F( x.7 ) Combinational logic . 3 .4. Example: Given F ( x . z ) = Σm ( 1. z ) = ΠM(1. z ) = Σm( 0. Alternatively. 3. y . y .5.Part 1 44 .Function Complements The complement of a function expressed as a sum of minterms is constructed by selecting the minterms missing in the sum-of-minterms canonical forms. the complement of a function expressed by a Sum of Minterms form is simply the Product of Maxterms with the same indices.

Part 1 45 . giving the other form of the original function: F( x . Example:Given F as before:F( x .6) Then use the other form with the same indices – this forms the complement again. y . • Change from products to sums. y .4.4.Conversion Between Forms To convert between sum-of-minterms and productof-maxterms form (or vice-versa) we follow these steps: • Find the function complement by swapping terms in the list with terms not in the list. or vice versa.5.7 ) Form the Complement: F( x. 3. z ) = ΠM( 0. z ) = Σm( 0. z ) = Σm(1. 2.6 ) Combinational logic . 2. y .

Part 1 46 .Standard Forms Standard Sum-of-Products (SOP) form: equations are written as an OR of AND terms Standard Product-of-Sums (POS) form: equations are written as an AND of OR terms Examples: • SOP: A B C + A B C + B • POS: (A + B) · (A+ B + C )· C These “mixed” forms are neither SOP nor POS • (A B + C) (A + C) • A B C + A C (A + B) Combinational logic .

Standard Sum-of-Products (SOP) A sum of minterms form for n variables can be written down directly from a truth table. • Implementation of this form is a two-level network of gates such that: • The first level consists of n-input AND gates. This form often can be simplified so that the corresponding circuit is simpler. Combinational logic .Part 1 47 . and • The second level is a single OR gate (with fewer than 2n inputs).

Standard Sum-of-Products (SOP) A Simplification Example: F( A .7 ) Writing the minterm expression: F = A B C + A B C + A B C + ABC + ABC Simplifying: F= Simplified F contains 3 literals compared to 15 in minterm F Combinational logic . B.4.Part 1 48 .6. C) = Σm(1.5.

AND/OR Two-level Implementation of SOP Expression The two implementations for F are shown below – it is quite apparent which is simpler! A B C A B C A B C A B C A B C A B C F F Combinational logic .Part 1 49 .

or other standard forms (SOP. Product-ofMaxterms). • Simpler equations lead to simpler two-level implementations Questions: • How can we attain a “simplest” expression? • Is there only one minimum cost circuit? Circuit optimization will deal with these issues.SOP and POS Observations The previous examples show that: • Canonical Forms (Sum-of-minterms. Combinational logic . POS) differ in complexity • Boolean algebra can be used to manipulate equations into simpler forms.Part 1 50 .

Circuit Optimization Goal: To obtain the simplest implementation for a given function Optimization is a more formal approach to simplification that is performed using a specific procedure or algorithm Optimization requires a cost criterion to measure the simplicity of a circuit Distinct cost criteria we will use: • Literal cost (L) • Gate input cost (G) • Gate input cost with NOTs (GN) Combinational logic .Part 1 51 .

Literal Cost Literal – a variable or it complement Literal cost – the number of literal appearances in a Boolean expression corresponding to the logic circuit diagram Examples: • • • • F = BD + A B C + A C D L=8 F = BD + A BC + A B D + AB C L= F = (A + B)(A + D)(B + C + D)(B + C + D) L = Which solution is best? Combinational logic .Part 1 52 .

the number of inputs to the gates in the implementation corresponding exactly to the given equation or equations. the number of distinct complemented single literals (GN). Example: • F = BD + A B C + AC D G = 11. GN = 14 • F = BD + A B C + A B D + AB C G = .(G) and • optionally.inverters not counted.Gate Input Cost Gate input costs . GN = • Which solution is best? Combinational logic . GN .inverters counted) For SOP and POS equations. (G .Part 1 53 . GN = • F = (A + B)(A + D)(B + C + D)( B + C + D) G = . it can be found from the equation(s) by finding the sum of: • all literal appearances • the number of terms excluding single literal terms.

G (gate input count) adds the remaining OR gate inputs GN(gate input count with NOTs) adds the inverter inputs Combinational logic .Cost Criteria (continued) Example 1: GN = G + 2 = 9 L=5 F=A+BC+ BC G=L+2= 7 B C A F L (literal count) counts the AND inputs and the single literal OR input.Part 1 54 .

Part 1 F 55 .Cost Criteria (continued) Example 2: F = A B C + AB C L = 6 G = 8 GN = 11 F = (A + C)( B + C)( A + B) L = 6 G = 9 GN = 12 A B C F Same function and same A literal cost B But first circuit has better C gate input count and better gate input count with NOTs Select it! Combinational logic .

Introduce a graphical technique using Karnaugh maps (K-maps. Some important questions: • When do we stop trying to reduce the cost? • Do we know when we have a minimum cost? Treat optimum or near-optimum cost functions for two-level (SOP and POS) circuits. for short) Combinational logic .Boolean Function Optimization Minimizing the gate input (or literal) cost of a (a set of) Boolean equation(s) reduces circuit cost. We choose gate input cost. Boolean Algebra and graphical techniques are tools to minimize cost criteria values.Part 1 56 .

Karnaugh Maps (K-map) A K-map is a collection of squares • • • • Each square represents a minterm The collection of squares is a graphical representation of a Boolean function Adjacent squares differ in the value of one variable Alternative algebraic expressions for the same function are derived by recognizing patterns of squares The K-map can be viewed as • A reorganized version of the truth table • A topologically-warped Venn diagram as used to visualize sets in algebra of sets Combinational logic .Part 1 57 .

Some Uses of K-Maps Provide a means for: • Finding optimum or near optimum SOP and POS standard forms. and • Demonstrating concepts used by computeraided design programs to simplify large circuits Combinational logic .Part 1 58 . and two-level AND/OR and OR/AND circuit implementations for functions with small numbers of variables • Visualizing concepts related to manipulating Boolean expressions.

m1 and m3 differ in the x variable as well. minterm m0 and minterm m2 differ in the x variable. • Also.Two Variable Maps A 2-variable Karnaugh Map: y=0 y=1 • Note that minterm m0 and minterm m1 are “adjacent” x = 0 m0 = m1 = xy xy and differ in the value of the variable y x = 1 m2 = m3 = xy xy • Similarly. m2 and m3 differ in the value of the variable y Combinational logic . • Finally.Part 1 59 .

1} to implement a particular function.K-Map and Truth Tables The K-Map is just a different form of the truth table.c and d from the set {0. Function Table Input Values (x.b.y) 00 01 10 11 Function Value F(x.y) a b c d K-Map y=0 x=0 a x=1 c y=1 b d 60 Combinational logic . F(x.Part 1 . Example – Two variable function: • We choose a.y).

y) = x F=x y=0y=1 x=0 x=1 0 1 0 1 For function F(x.K-Map Function Representation Example: F(x.y).Part 1 61 . the two adjacent cells containing 1’s can be combined using the Minimization Theorem: F( x . y ) = x y + x y = x Combinational logic .

K-Map Function Representation Example: G(x.y).y) = x + y G = x+y y = 0 y = 1 x=0 x=1 0 1 1 1 For G(x. y ) = (x y + x y )+ (xy + x y )= x + y Duplicate xy Combinational logic . two pairs of adjacent cells containing 1’s can be combined using the Minimization Theorem: G( x .Part 1 62 .

Part 1 63 . the minterms are adjacent on the K-Map Combinational logic .Three Variable Maps A three-variable K-map: x=0 x=1 yz=00 m0 m4 yz=01 m1 m5 yz=11 m3 m7 yz=10 m2 m6 yz=10 Where each minterm corresponds to the product terms: yz=00 yz=01 yz=11 x=0 x y z x=1 xyz xyz xyz xyz xyz xyz xyz Note that if the binary value for an index differs in one bit position.

Part 1 z 64 . and • Reading off product terms from the map. Alternate labelings are useful: y y y 3 7 2 6 x yz 00 01 11 10 0 0 1 5 3 7 2 6 x x 0 4 1 5 x 1 4 z z z Combinational logic .Alternative Map Labeling Map use largely involves: • Entering values into the map.

5) 0 1 5 3 1 2 1 x 41 Example: 1 7 6 z 0 4 1 3 G(a.4. most significant and z. b.Example Functions By convention.Part 1 65 .3. c) = Σm(3. y. we represent the minterms of F by a "1" in the map and leave the minterms of F blank y Example: F(x.4. least significant) on the map boundaries y 1 7 1 2 6 1 5 1 z Combinational logic .6.7) Learn the locations of the 8 indices based on the variable x order shown (x. z) = Σm(2.

Combining Squares By combining squares. Combinational logic .Part 1 66 . thereby reducing the other two cost criteria On a 3-variable K-Map: • One square represents a minterm with three variables • Two adjacent squares represent a product term with two variables • Four “adjacent” terms represent a product term with one variable • Eight “adjacent” terms is the function of all ones (no variables) = 1. we reduce number of literals in a product term. reducing the literal cost.

6.7) 0 1 5 3 y 1 7 1 2 x 4 1 6 1 z Applying the Minimization Theorem three times: Thus the four terms that form a 2 × 2 square correspond to the term "y".Example: Combining Squares Example: Let F = Σm(2. F( x.Part 1 67 . z ) = x y z + x y z + x y z + x y z = yz + y z =y Combinational logic . y .3.

Rectangles can contain non-adjacent cells as illustrated by the “pairwise adjacent” ring above. of 4 cells represent 4 minterms that form a “pairwise adjacent” ring. Rectangles of 2 cells represent 2 adjacent minterms. Combinational logic .Part 1 68 .Three-Variable Maps Reduced literal product terms for SOP standard forms correspond to rectangles on K-maps containing cell counts that are powers of 2.

Three-Variable Maps Example Shapes of 2-cell Rectangles: y 0 1 5 3 7 2 6 x 4 z Read off the product terms for the rectangles shown Combinational logic .Part 1 69 .

Three-Variable Maps Example Shapes of 4-cell Rectangles: y 0 1 5 3 7 2 6 x 4 z Read off the product terms for the rectangles shown Combinational logic .Part 1 70 .

3. Terms are selected to cover the “1s”in the map.5. z) = . y.Three Variable Maps K-Maps can be used to simplify Boolean functions by systematic methods. Example: Simplify F(x. y.Part 1 71 F(x. z) = Σm(1.2.7) z y 1 1 1 xy x 1 1 z z+xy Combinational logic .

7) Combinational logic . Y. Z) = Σm(0.4.2.1.Three-Variable Map Simplification Use a K-map to find an optimum SOP equation for F(X.6.Part 1 72 .

Four Variable Maps Map and location of minterms: Y 0 1 5 13 9 Z 3 7 15 11 2 6 14 10 X 4 Variable Order W 12 8 Combinational logic .Part 1 73 .

(i. • Sixteen 1s = zero variables (i. • Four 1s = 2 variables • Eight 1s = 1 variable. Minterm) • Two 1s = 3 variables.e.Four Variable Terms Four variable maps can have rectangles corresponding to: • A single 1 = 4 variables.e. Constant "1") Combinational logic .Part 1 74 .

Four-Variable Maps Example Shapes of Rectangles: Y 0 1 5 13 9 Z 3 7 15 11 2 6 14 10 X 4 12 W 8 Combinational logic .Part 1 75 .

Four-Variable Maps Example Shapes of Rectangles: Y 0 1 5 13 9 3 7 15 11 2 6 14 10 X 4 12 W 8 Z Combinational logic .Part 1 76 .

Y. 2.8.4.13.15) Combinational logic .6. Z) = Σm(0.Four-Variable Map Simplification F(W.10. X.5.Part 1 77 .7.

Part 1 78 .7.5.15) Combinational logic .4. X.14.9. Y.13.Four-Variable Map Simplification F(W. Z) = Σm(3.

A prime implicant is called an Essential Prime Implicant if it is the only prime implicant that covers (includes) one or more minterms.Systematic Simplification A Prime Implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map into a rectangle with the number of squares a power of 2. A set of prime implicants "covers all minterms" if.Part 1 79 . for each minterm of the function. Combinational logic . at least one prime implicant in the set of prime implicants includes the minterm. Prime Implicants and Essential Prime Implicants can be determined by inspection of a K-Map.

Example of Prime Implicants Find ALL Prime Implicants BD 1 BD A 1 1 1 1 D AD CD C 1 1 B 1 A ESSENTIAL Prime Implicants C BD 1 BD 1 1 1 1 1 D 1 1 1 B 1 1 1 AB 1 1 BC Minterms covered by single prime implicant Combinational logic .Part 1 80 .

3.12.10.11.Part 1 81 .8. C.2.15) Combinational logic .Prime Implicant Practice Find all prime implicants for: F(A.9. B.13.14. D) = Σm(0.

Another Example G(A. D) = Σm(0.3.Part 1 82 .14.12. B.13. C.2.4.15) • Hint: There are seven prime implicants! Find all prime implicants for: Combinational logic .7.

” Combinational logic . The six codes. Example 1: A logic function having the binary codes for the BCD digits as its inputs.Don't Cares in K-Maps Sometimes a function table or map contains entries for which it is known: • the input values for the minterm will never occur. the cost of the logic circuit may be lowered. so the output values for these codes are “x” to represent “don’t cares.Part 1 83 . Only the codes for 0 through 9 are used. or • The output value for the minterm is not used In these cases. the output value need not be defined Instead. the output value is defined as a “don't care” By placing “don't cares” ( an “x” entry) in the function table or map. 1010 through 1111 never occur.

otherwise ignoring it. Thus. Z must be specified for AB + C = 1. B. Z is a don’t care.Part 1 84 . and is a don’t care for : AB + C = (A + B)C = AC + BC = 1 Ultimately. Z is specified only for those combinations. The circuit that receives the output Z observes it only for combinations of A. an “x” may take on value “0” in an SOP solution and value “1” in a POS solution. or vice-versa. and for all other combinations of A. and C. and • Y which takes on values 0 or 1. Specifically. and C such A = 1 and B = 1 or C = 0. Any minterm with value “x” need not be covered by a prime implicant. B. and a single output Z. and C which take on all possible combinations. each don’t care “x” entry may take on either a 0 or 1 value in resulting solutions For example. B. Combinational logic .Don't Cares in K-Maps Example 2: A circuit that represents a very common situation that occurs in computer design has two distinct sets of input variables: • A.

z) = w x z + w x y + w x y G = 12 Combinational logic .y. x.Part 1 85 . y.Example: BCD “5 or More” The map below gives a function F1(w." X X13 X X 12 15 14 1 8 1 9 X X10 11 z F2(w.x.x. With the don't cares used for the 6 non-BCD combinations: y F1 (w.z) = w + x z + x y G = 7 x 00 01 03 02 04 15 17 16 w This is much lower in cost than F2 where the “don't cares” were treated as "0s.y.z) which is defined as "5 or more" over BCD inputs.

C.12.14.3.15) • Hint: Use F and complement it to get the result. Combinational logic .Part 1 86 . D) = Σm(1.13.Product of Sums Example Find the optimum POS solution: F(A.9.11. B.

More on Optimization • Obtaining a good simplified solution: Use the Selection Rule Combinational logic . Include all essential prime implicants in the solution Select a minimum cost set of non-essential prime implicants to cover all minterms not yet covered: • Obtaining an optimum solution: See Reading Supplement .Optimization Algorithm Find all prime implicants.Part 1 87 .

make sure that each prime implicant selected includes at least one minterm not included in any other prime implicant selected.Part 1 88 . In particular. in the final solution. Combinational logic .Prime Implicant Selection Rule Minimize the overlap among prime implicants as much as possible.

Selection Rule Example Simplify F(A. C. D) given on the KSelected Essential map. C C 1 1 A 1 1 1 1 D 1 1 1 B A 1 1 1 1 1 1 D Minterms covered by essential prime implicants Combinational logic . B.Part 1 89 1 1 1 B .

Part 1 90 Selected Essential C 1 x x 1 B 1 x . D) given on the K-map. B.Selection Rule Example with Don't Cares Simplify F(A. C 1 1 A x x 1 D 1 x x x 1 B A 1 x x 1 D Minterms covered by essential prime implicants Combinational logic . C.

Solution: Suboptimum algorithms not requiring any of the above in the general case Combinational logic .Practical Optimization Problem: Automated optimization algorithms: • require minterms as starting point. • require determination of all prime implicants. and/or • require a selection process with a potentially very large number of candidate solutions to be found.Part 1 91 .

Example: Seven Segment Display Combinational logic .Part 1 92 .