Download presentation
Presentation is loading. Please wait.
Published byGladys Booth Modified over 9 years ago
1
ENG241 Digital Design Week #2 Combinational Logic Circuits
2
Resources Chapter #2, Mano Sections 2.1 Logic Gates 2.2 Boolean Algebra 2.3 Min Terms & Max Terms 2.4 Logic Optimization 2
3
Week #2 Topics Binary Logic and Gates Boolean Functions Boolean Algebra (Truth Tables) Basic Identities Standard Forms (Minterms, Maxterms) Circuit Optimization (K-Maps) Map Manipulations (Prime Implicants) 3
4
Binary Logic Binary variables Can be 0 or 1 (T or F, low or high) Variables named with single letters in examples Really use words when designing circuits Basic Functions AND OR NOT 4
5
5 Logic Signals BB inary ‘0’ is represented by a “low” voltage (range of voltages) BB inary ‘1’ is represented by a “high” voltage (range of voltages) TT he “voltage ranges” guard against noise of binary signalsExample
6
NOT Operator Unary Operator Symbol is bar Z = X Truth table -> Inversion 6
7
Inverter Gate 7
8
AND Gate Symbol is dot Z = X.Y Or no symbol Z = XY Truth table -> Z is 1 only if Both X and Y are 1 8 Switches in series => AND
9
9 Switching Circuits (AND Gate) AND AND Gate: Symbol
10
AND Gate: Timing Timing Diagrams 10
11
OR Gate Symbol is + Not addition Z = X + Y Truth table -> Z is 1 if either 1 Switches in parallel => OR 11
12
12 Switching Circuits (OR Gate) OR OR Gate: Symbol
13
OR Gate: Timing Timing Diagrams 13
14
14 Binary Logic Truth Tables, Boolean Expressions, and Logic Gates xyz 000 010 100 111 xyz 000 011 101 111 xz 01 10 ANDORNOT z = x y = x yz = x + yz = x = x’
15
More Inputs Work same way What’s output? 15
16
NAND Gates Very common for discrete logic 16
17
NOR Gates NOT OR Also common X Y Z 0 0 1 10 1 10001000 17
18
Logic Diagram Boolean Expression Logic Diagram 18 What is the Boolean expression?
19
Boolean Expression Logic Diagram Consider function How many gates do we need to implement this function? 19
20
Boolean Operator Precedence The order of evaluation in a Boolean expression is: Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D) 1.Parentheses 2. Not 3. And 4. Or 20
21
Mechanically Go From Truth Table to Function Steps of design: 1. Start with Problem Statement 2. Obtain Truth Table 3. Obtain a algebraic boolean function 4. Draw the circuit diagram
22
Design Steps (Simple Example) Specification: Design a circuit that has 3 inputs x, y, z and a single output F. F is true when the three inputs are the same and false otherwise. 22
23
Design Steps (Simple Example) Step #1, since we have three inputs then the Truth Table has to have 8 entries (2 3 ) XYZF 0001 0010 0100 0110 1000 1010 1100 1111 23
24
Design Steps (Simple Example) Step #2, Pick the entries in the truth table where F is equal 1. Give Expression: XYZF 0001 0010 0100 0110 1000 1010 1100 1111 24
25
Design Steps (Simple Example) Step #3, Draw a logic diagram that represents the boolean functions. XYZF 0001 0010 0100 0110 1000 1010 1100 1111 25
26
Representation: Truth Table 2 n rows where n # of variables 26 Give Boolean Expression? Not Simplified!
27
Boolean Functions: Complexity There can be different representations for a boolean function the simplest (Why?) Usually we want the simplest (Why?) Fewer gates (Less Area, Less Power Consumption, Faster!) We can use identities to reduce complexity of Boolean expressions. 27
28
Boolean Algebra & Identities There is only one way that a Boolean function can be represented in a truth table. However, when the function is in algebraic form, it can be expressed in a variety of ways. Boolean algebra is a useful tool for simplifying digital circuits. Use identities to manipulate functions 28
29
Table of Identities 29
30
Dual of an Expression The dual of an expression is obtained by: 1. Changing AND to OR and OR to AND throughout 2. Changing 1’s to 0’s and 0’s to 1’s For example The dual of X+0 is: X.1, The dual of X.0 is: X+1 30
31
Duals Left and right columns are duals 31
32
Single Variable Identities 32
33
Commutative Order independent 33
34
Associative Independent of order in which we group So can also be written as and 34
35
Distributive Identity 15 is the dual of identity 14. Identity 14 is well known from ordinary algebra! 35
36
DeMorgan’s Theorem Used a lot NOR equals invert AND NAND equals invert OR 36 Proof?
37
Truth Tables for DeMorgan’s 37
38
Useful Theorems ninimizatioMyyyx tionSimplifica yxyxyxyx Consensuszyxzyzyx zyxzyzyx x x x xx xx 38
39
Example 1: Boolean Algebraic Proof A + A · B = A (Absorption Theorem) Proof Steps Justification (identity or theorem) A + A · B =A · 1 + A · B X = X · 1 = A · ( 1 + B) X · Y + X · Z = X · (Y + Z) = A · 1 1 + X = 1 = A X · 1 = X 39
40
Cont.. Boolean Algebraic Proof Cont.. Boolean Algebraic Proof Our primary reason for doing proofs is to learn: Careful and efficient use of the identities and theorems of Boolean algebra, and How to choose the appropriate identity or theorem to apply to make forward progress, irrespective of the application. 40
41
Algebraic Manipulation When a Boolean equation is implemented with logic gates, i. Each term requires a gate, ii. Each variable designates an input to the gate. We define a literal as a single variable within a term that may or may not be complemented. The expression above has THREE terms and EIGHT literals. 41
42
Algebraic Manipulation Consider function How many gates do we need to implement this function? 42
43
Simplify Function Apply End Result? 43
44
Fewer Gates 1.Fewer Gates! 2.Fewer Inputs per gate! 44
45
The Duality Principle Recall how to obtain the dual of an expression! The duality principle states that a Boolean equation remains valid if we take the dual of the expression on both sides of the equal sign. 45
46
1. Complement of a Function XYZFF 000 01 001 10 010 10 011 01 100 01 101 01 110 01 111 01 The complement representation for a function F, (F’), is obtained from an interchange of 1’s to 0’s and 0’s to 1’s for the values of F in the truth table. 46
47
2. Cont..Complement of a Function The complement of a function can be derived algebraically by applying DeMorgan’s theorem. 47
48
3. Cont..Complement of a Function Yet another way of deriving the complement of a function is to: Take the dual of the function equation Complement each literal. 48
49
ENG241 Digital Design Cont..Week #2 Combinational Logic Circuits
50
Resources Chapter #2, Mano Sections 2.3 Standard Forms 2.4 Circuit Optimization (K-Maps) 50
51
Week #2, #3 Topics Standard Forms (Minterms, Maxterms) Circuit Optimization (K-Maps) Map Manipulations (Prime Implicants) 51
52
From Truth Table to Function Consider a truth table Can implement F by taking OR of all terms that are 1 52 MinTerm Product Term
53
Standard Forms Assume we have a circuit with 3 variables X, Y, Z Definitions: Product Term – a subset of the variables appear XY, XZ, XZ’, XYZ Min Term – is a product term in which all variables appear once (XYZ, X’YZ, X’Y’Z’) 53
54
Number of Minterms For n variables, there will be 2 n minterms Like binary numbers from 0 to 2 n -1 54
55
Definition: Minterm Is a Product Term in which ALL variables appear once (complemented or not) 55
56
Sum of Minterms (SOM) OR all of the minterms of truth table row with a 1 In this case m 1 + m 3 + m 4 + m 6 In this case m 0 +m 2 +m 5 +m 7 56 m0m0 m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7
57
Alternative Representation In this case m 1 + m 3 + m 4 + m 6 In this case m 0 +m 2 +m 5 +m 7 57
58
Summary of Properties of Minterms There are 2 n minterms for a Boolean function with n variables Any Boolean function can be expressed as a logical sum of minterms The complement of a function contains those minterms not included in the original function. A function that includes all the 2 n minterms is equal to logic 1. 58
59
Sum of Products (SOP) The sum-of-minterms form is a standard algebraic expression that is obtained directly from a truth table. The expression obtained contains the maximum number of literals in each term. Simplification of the sum-of- minterms expression is called sum- of-products. 59
60
SOM vs. SOP Sum of minterms After Simplification we get the Sum of products 60
61
Sum of Products Implementation Sum of products We refer to this implementation as a two- level circuit 61
62
2-level Implementation Sum of products has 2 levels of gates Is there a 3-level rep of this circuit? 62
63
2-level vs. 3-level Implementation AB + CD + CE can be Also expressed as AB + C(D+E) What’s best? Hard to answer!! More gate delays? But maybe we only have 2-input gates 63
64
Definition: Maxterm Is a Sum Term in which all variables appear once (complemented or not) 64
65
Minterm related to Maxterm Minterm and maxterm with same subscripts are complements Example (Use Demorgans theory) 65
66
Product of Maxterms We can also express F as AND of all rows that should evaluate to 0 66 M0M0 M1M1 M2M2 M3M3 M4M4 M5M5 M6M6 M7M7
67
Two-Level Circuit Optimization The complexity of the digital logic gates that implement a Boolean function is directly related to the algebraic expression from which the function is implemented!! Boolean expressions may be simplified by algebraic manipulation (i.e. identities) but it is awkward and not straight forward! 67
68
Karnaugh Maps Graphical depiction of truth table A box for each minterm So 2 variables, 4 boxes 3 variable, 8 boxes And so on Useful for simplification By inspection Algebraic manipulation harder 68
69
Examples 69 There are implied 0s in other boxes Figure (b) F = m 1 + m 2 + m 3
70
Simplification 70
71
Three-Variable Map Eight minterms Look at encoding of columns and rows 71
72
Simplification Adjacent squares (horizontally or vertically) are minterms that vary by single variable Draw rectangles on map to simplify function Illustration next 72
73
How to obtain a simplified expression? Combine as many 1’s as possible from the map to form rectangle verticallyhorizontallynot diagonally. Only adjacent 1’s can be combined vertically or horizontally but not diagonally. The number of 1’s that can be combined is a power of 2, (2 0 =1, 2 1 =2, 2 2 =4, 2 3 =8), … 73
74
Example XYZF 0000 0010 0101 0111 1001 1011 1100 1110 74
75
Example 75 X YZ 00 11 01 10 0 1 11 1 1
76
Adjacency is Cylindrical Note that wraps from left edge to right edge. 76
77
Another Minimization Example Each of the two adjacent pairs of entries can be simplified by eliminating the changing bit. x is eliminated in column 2 y is eliminated in the other pair. F = y’z + x’z’ 77
78
Covering 4 Squares is 78
79
Another Example In general, as more squares are combined, we obtain a product term with fewer literals. Overlap is allowed. 79
80
4-variable map At limit of K-map 80
81
Also Wraps (toroidal topology) 81
82
Simplifying a 4-Variable Function 111 111 111 11 WX YZ 00 01 11 10 00011110 Y W Z X Z 82
83
Don’t Care So far we have dealt with functions that were always either 0 or 1 Sometimes we have some conditions where we don’t care what result is Example: dealing with BCD Only care about first 10 83
84
Mark With an `X’ In a K-map, mark don’t care with an ‘X’ Simpler implementations Can select an X either as 1 or 0 Example: 84
85
Example or What would we have if Xs were 0? 85
86
Prime Implicants Each element in the K-Map is an implicant. A prime implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map. A single 1 on a map represents a prime implicant if it is not adjacent to any other 1. Two adjacent 1’s form a prime implicant, provided they are not within a group of four adjacent squares. Four adjacent 1’s form a prime implicant if they are not within a group of eight adjacent squares, and so on. If a minterm in a square is covered by only one prime implicant, that prime implicant is said to be essential. They are found with only one prime They are found by looking at each square marked with a 1 and checking the number of prime implicants that cover it. Those with only one prime implicant are essential. 86
87
Implicant/Prime Implicant/Essential Implicant/Prime Implicant/Essential Consider: Each Element of f on is an Implicant Prime Implicants are: abc is a Prime Implicant but NOT an Essential Prime Implicant bcd is an Implicant but NOT a Prime Implicant bd is an Essential Prime Implicant 87
88
Finding Simplified Expressions The procedure for finding simplified expressions is 1. Determine all essential 1. Determine all essential prime implicants. 2. The final expression is formed from the logical sum of: essential prime implicants, I. The essential prime implicants, with II. Other prime implicants II. Other prime implicants needed to cover the remaining minterms There may be more than one simplified expression. 88
89
Prime Implicants: Example Two essential prime implicants (caused by m 0 and m 5 ) This gives us two terms: x’z’ and xz Finding prime implicants for the remainders results in four expressions: F = xz + x’z’ + yz + wz F = xz + x’z’ + yz + wx’ F = xz + x’z’ + x’y + wz F = xz + x’z’ + x’y + wx’ 89
90
Essential Prime Implicants 02467810111213141618192930 (6,7)XX (10,11)XX (12,13)XX (18,19)XX (13,29)XX (14,30)XX (0,2,16,18)XXXX (0,2,4,6,8,10,12,14)XXXXXXXX Prime Implicants Prime Implicants
91
91
92
Consensus Theorem The third term is redundant Can just drop What does it mean? For third term to be true, Y & Z both 1 Then one of the first two terms must be 1! 92
93
Proof of Consensus Theorem 93
94
Three Variable Maps Three variable maps exhibit the following characteristics: 1. One box represents minterm with 3 literals 2. Rectangle of 2 boxes -> 2 literals 3. Rectangle of 4 boxes -> 1 literal 4. Rectangle of 8 boxes -> Logic 1 (on 3-variable map) 94
95
Slight Variation Overlap is OK. No need to use full m 5 -- waste of input 95
96
Another Example FFour adjacent corners can be combined to form the two literal term x’z’. FFour adjacent squares can be combined to form the two literal term x’y. TThe remaining 1 is combined with a single adjacent 1 to obtain the three literal term w’y’z’. FF = x’z’ + x’y + w’y’z’ 96
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.