Download presentation
Presentation is loading. Please wait.
Published byDavid Burns Modified over 7 years ago
1
Binary Logic and Gates Binary logic deals with binary variables (i.e. can have two values, “0” and “1”) Binary variables can undergo three basic logical operators AND, OR and NOT: AND is denoted by a dot (·) OR is denoted by a plus (+). NOT is denoted by an overbar ( ¯ ), a single quote mark (') after the variable.
2
Basic Gates
3
Combined Gates
4
Operator Definitions and 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: 1 Z = X·Y Y X AND OR X Y Z = X+Y 1 1 X NOT Z =
5
Boolean Operator Precedence
The order of evaluation in a Boolean expression is: 1. Parentheses 2. NOT 3. AND 4. OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D)
6
2-2 Boolean Algebra George Boole, Mathematician (self-taught),
Professor of Mathematics of then Queen's College, Cork in Ireland) (Encycl. Brittannica online:
7
Existence complements
2-2 Boolean Algebra Boolean algebra deals with binary variables and a set of three basic logic operations: AND (.), OR (+) and NOT ( ) that satisfy basic identities Basic identities 1. X + 0 = 2. X . 1 = Existence 0 and 1 or operations with 0 and 1 3. X + 1 = 1 4. X . 0 = Idempotence 5. 6. X . X X = X + X 7. 8. = X . X 1 X + X Existence complements Involution 9. X = X Dual Replace “+” by “.”, “.” by +, “0” by “1” and “1’’ by”0”
8
Boolean Algebra Boolean Theorems of multiple variables 10. X + Y Y + X
= Commutative 11. XY YX = 12. (X + Y) Z + X + (Y Z) = 13. (XY) Z X(Y Z ) = Associative 14. X (Y+ Z) XY XZ + = 15. X + YZ (X + Y) (X + Z) = Distributive DeMorgan’s 17. X . Y X + Y = 16. X + Y X . Y =
9
Example: Boolean Algebraic Proof
A + A·B = A (Absorption Theorem) Proof Steps Justification (identity or theorem) A + A·B = A · 1 + A · B (Operation with 1) = A · ( 1 + B) (Distributive Law) = A · 1 (Operation with 1) = A
11
Combinational Circuit
The combinational circuit consist of logic gates whose outputs at any time is determined directly from the present combination of input without any regard to the previous input. An alternate term is combinatorial
12
Combinational Circuit
Combinational circuit has m inputs and n outputs. Such a circuit can always be constructed as n separate combinatorial circuits, each with exactly one output. Sharing of signals can significantly reduce the number of gates required to build a circuit.
13
Combinational Circuit
When we build a combinatorial circuit from some kind of specification, we always try to make it as good as possible. The only problem is that the definition of "as good as possible" may vary greatly. to minimize the number of gates (or the number of transistors, really). to short a delay (the time it takes a signal to traverse the circuit) as possible to lower power consumption as possible.
14
Combinational Circuit
To specify combinational circuit and define what it does, we can use Truth table: complete enumeration of all possible combinations of input values, each one with its associated output value. Logical expression: an expression uses the two constants 0 and 1 variables such as x, y, and z (sometimes with suffixes) as names of inputs and outputs the operators + , * a horizontal bar (which stands for not).
15
Combinational Circuit
When used to describe an existing circuit, output values are (of course) either 0 or 1. Suppose for instance that we wish to make a truth table for the following circuit:
16
Combinational Circuit
To establish a truth table for the circuit is we compute the output value for the circuit for each possible combination of input values. We obtain the following truth table:
17
Combinational Circuit
Specifying Circuits to build When used as a specification for a circuit, a table may have some output values that are not specified, perhaps because the corresponding combination of input values can never occur in the particular application. We can indicate such unspecified output values with a dash -.
18
Combinational Circuit
19
Combinational Circuit
Circuit minimization is a difficult problem from complexity point of view. Computer programs that try to optimize circuit design apply a number of heuristics to improve speed. In this course, we are not concerned with optimality. We are therefore only going to discuss a simple method that works for all possible combinatorial circuits (but that can waste large numbers of gates). A separate single-output circuit is built for each output of the combinatorial circuit.
20
Combinational Circuit
Circuit minimization is a difficult problem from complexity point of view. Computer programs that try to optimize circuit design apply a number of heuristics to improve speed. In this course, we are not concerned with optimality. We are therefore only going to discuss a simple method that works for all possible combinatorial circuits (but that can waste large numbers of gates). A separate single-output circuit is built for each output of the combinatorial circuit.
21
Combinational Circuit
Our simple method starts with the truth table (or rather one of the acceptable truth tables, in case we have a choice). Our circuit is going to be a two-layer circuit.
22
Combinational Circuit
The first layer of the circuit will have at most 2n nand-gates, each with n inputs (where n is the number of inputs of the combinatorial circuit). The second layer will have a single nand-gate with as many inputs as there are gates in the first layer. For each line of the truth table with an output value of 1, we put down a nand-gate with n inputs. For each input entry in the table with a 1 in it, we connect an input of the nand-gate to the corresponding input. For each entry in the table with a 0 in it, we connect an input of the nand-gate to the corresponding input inverted.
23
Combinational Circuit
The output of each nand-gate of the fist layer is then connected to an input of the giant nand-gate of the second layer. And that's it. As an example of our general method, consider the following truth table (where a - indicates that we don't care what value is chosen):
24
Combinational Circuit
The first step is to arbitrarily choose values for the undefined outputs. With out simple method, the best solution is to choose a 0 for each such undefined output. We get this table:
25
Combinational Circuit
Now, we have to build two separate single-output circuits, one for the a column and one for the b column. For the first column, we get three 3-input nand-gates in the first layer, and a 3-input nand-gate in the second layer. We get three nand-gates since there are three rows in the a column with a value of 1. Each one has 3-inputs since there are three inputs, x, y, and z of the circuit. We get a 3-input nand-gate in the second layer since there are three nand-gates in the first layer.
26
Combinational Circuit
27
Combinational Circuit
For the second column, we get two 3-input nand-gates in the first layer, and a 2-input nand-gate in the second layer. We get two nand-gates since there are two rows in the b column with a value of 1. Each one has 3-inputs since again there are three inputs, x, y, and z of the circuit. We get a 2-input nand-gate in the second layer since there are two nand-gates in the first layer.
28
Combinational Circuit
29
Combinational Circuit
30
Combinational Circuit
31
Combinational Circuit
32
Boolean Functions A Boolean function: Operations of binary variables can be described by mean of appropriate mathematical function called Boolean function. A Boolean function define a mapping from a set of binary input values into a set of output values. A Boolean function is formed with: Binary variables Binary operators OR and AND Unary operator NOT Parentheses
33
Boolean Functions For example, a Boolean function f(x1,x2, x3,……,xn) =y defines a mapping from an arbitrary combination of binary input values (x1,x2, x3,……,xn) into a binary value y. A binary function with n input variable can operate on 2n distinct values.
34
Boolean Functions Any such function can be described by using a truth table consisting of 2n rows and n columns. The content of this table are the values produced by that function when applied to all the possible combination of the n input variable.
35
Boolean Functions The function f, representing x.y, that is f(x,y)=xy. Which mean that f=1 if x=1 and y=1 and f=0 otherwise. For each rows of the table, there is a value of the function equal to 1 or 0. The function f is equal to the sum of all rows that gives a value of 1.
36
Boolean Functions The truth table of 2n entries F1= x y z'
1 F1= x y z' F2 = x + y'z F3 = x' y' z + x' y z + x y' F4 = x y' + x' z
37
Boolean Functions A Boolean function may be transformed from an algebraic expression into a logic diagram composed of AND, OR and NOT gate. When a Boolean function is implemented with logic gates, each literal in the function designates an input to a gate and each term is implemented with a logic gate. e.g.
38
Boolean Functions Other Examples F2 = x + y'z
F3 = x' y' z + x' y z + x y' F4 = x y' + x' z
39
Complement of a Function
The complement of a function F is F' and is obtained from an interchange of 0’s to 1’s and 1’s to 0’s in the value of F. The complement of a function may be derived algebraically trough De Morgan’s theorem
40
Complement of a Function
An interchange of 0's for 1's and 1's for 0's in the value of F Generalizations: a function is obtained by interchanging AND and OR operators and complementing each literal. (A+B+C+D F)' = A'B'C'D'... F' (ABCD ... F)' = A'+ B'+C'+D' ... +F'
41
Examples Example: F1= x'yz' + x'y'z
F1' = (x'yz' + x'y'z)' = (x'yz')‘.(x'y'z)' = (x+y'+z) (x+y+z') F2' = [x(y'z'+yz)]' = x' + (y'z'+yz)' = x' + (y'z')' (yz)‘ = x' + (y+z) (y'+z') = x' + yz‘+y'z
42
Canonical Form (Minterm and Maxterm)
A binary variable may appear either in it normal form or i n it complement form . Consider two binary variables x and y combined with AND operation. Since each variable may appears in either form there are four possible combinations: x′y′, x′y, xy′,xy. Each of the term represent one distinct area in the Venn diagram and is called minterm or a standard product. With n variable, 2n minterms can be formed.
43
Canonical Form (Minterm and Maxterm)
In a similar fashion, n variables forming an OR term provide 2n possible combinations called maxterms or standard sum. Each maxterm is obtained from an OR term of the n variables, with each variable being primed if the corresponding bit is 1 and un-primed if the corresponding bit i s 0. Note that each maxterm is the complement of its corresponding minterm and vice versa.
44
Minterms and Maxterms
45
Minterms and Maxterms A Boolean function may be expressed algebraically from a given truth table by forming a minterm for each combination of variable that produce a 1 and taken the OR of those terms. Similarly, the same function can be obtained by forming the maxterm for each combination of variable that produces 0 and then taken the AND of those term.
46
Minterms and Maxterms f1 = x'y'z + xy'z' + xyz = m1 + m4 +m7 (Minterms) f2 = x'yz+ xy'z + xyz'+xyz = m3 + m5 +m6 + m7 (Minterms)
47
Minterms and Maxterms It is sometime convenient to express the boolean function when it is in sum of minterms, in the following notation: F(X,Y,Z)=∑(1,4,5,6,7) The summation symbol ∑ stands for the ORing of the terms; the number following it are the minterms of the function. The letters in the parenthesis following F form list of the variables in the order taken when the minterm is converted to an AND term. So, F(X,Y,Z)=∑(1,4,5,6,7)= X’Y’Z+XY’Z’+XY’Z+XYZ’+XYZ
48
Minterms and Maxterms Any Boolean function can be expressed as
A sum of minterms (“sum” meaning the ORing of terms). A product of maxterms (“product” meaning the ANDing of terms). Both boolean functions are said to be in Canonical form.
49
Minterms and Maxterms Sometime it is convenient to express a Boolean function in its sum of minterm. If it is not in that case, the expression is expanded into the sum of AND term and if there is any missing variable, it is ANDed with an expression such as x+ x‘ where x is one of the missing variable.
50
Sum of Minterms Sum of minterms: there are 2n minterms and 22n combinations of function with n Boolean variables. Example: express F = A+B'Cas a sum of minterms. F = A+B'C = A (B+B') + B'C = AB +AB' + B'C = AB(C+C') + AB'(C+C') + (A+A')B'C = ABC+ABC'+AB'C+AB'C'+A'B'C F = A'B'C +AB'C' +AB'C+ABC'+ ABC = m1 + m4 +m5 + m6 + m7 F(A, B, C) = S(1, 4, 5, 6, 7)
51
Sum of Minterms or, built the truth table first
F(A, B, C) = S(1, 4, 5, 6, 7)
52
Minterms and Maxterms To express a Boolean function as a product of maxterms, it must first be brought into a form of OR terms. This can be done by using distributive law x+xz=(x+y)(x+z). Then if there is any missing variable, say x in each OR term is Orded with xx′.
53
Product of Maxterms Product of maxterms: using distributive law to expand. x + yz = (x + y)(x + z) = (x+y+zz')(x+z+yy') = (x+y+z)(x+y+z')(x+y'+z) Example: express F = xy + x'z as a product of maxterms.
54
Product of Maxterms F = xy + x'z = (xy + x')(xy +z) = (x+x')(y+x')(x+z)(y+z) = (x'+y)(x+z)(y+z) Adding missing variable in each term (x'+y) = x' + y + zz' = (x'+y+z)(x'+y+z') (x+z)= x+z+yy' = (x+y+z)(x+y'+z) (y+z)= y+z+xx′ =( x+y+z)( x′+y+z) F = (x+y+z)(x+y'+z)(x'+y+z)(x'+y+z') = M0M2M4M5 F(x, y, z) = P(0, 2, 4, 5)
55
Conversion between Canonical Forms
The complement of a function expressed as the sum of minterms equals the sum of minterms missing from the original function. This is because, the original function is expressed by those minterms that make the function equal to 1, whereas its complement is a 1 for those minterms that make the function equal to 0.
56
Conversion between Canonical Forms
For instance F(A, B, C) = S(1, 4, 5, 6, 7) Thus, F'(A, B, C) = S(0, 2, 3) Now taking the complement of F'(De Morgan’s) F = (m0 + m2 + m3)' = m0‘ + m2‘ + m3‘ = M0 + M2 + M3 F(A, B, C) = P(0, 2, 3) F'(A, B, C) =P (1, 4, 5, 6, 7)
57
Conversion between Canonical Forms
mj' = Mj Sum of minterms = product of maxterms Interchange the symbols S and P and list those numbers missing from the original form S of 1's P of 0's Example F = xy + xz F(x, y, z) = S(1, 3, 6, 7) F(x, y, z) = P (0, 2, 4, 5)
58
Standard Forms Another way to express a Boolean function is in standard form. Here the term that form the function may contains one, two or many number of literals. There are two types of standard form. Sum of products Product of sums
59
Standard Forms (SOP) The sum of product (SOP) is a Boolean expression containing AND terms called product term of one or more literals each. The sum denotes the ORing of these terms F = x + xy' + x'yz F = y' + xy+ x'yz'
60
Standard Forms (POS) The product of sum (POS) is a Boolean expression containing OR terms called SUM terms. Each term may have any number of literals. The product denotes the ANDing of these terms. F = x(y'+z)(x'+y+z')
61
Standard Forms A Boolean function may also be expressed in a non standard form. In that case, distributive law can be used to remove the parenthesis. F=(xy+zw)(x'y'+z'w') = xy(x'y'+z'w')+zw(x'y'+z'w') =Xyx'y +xyz'w' +zwx'y' +zwz'w' =xyz'w'+zwx'y'
62
Algebraic Manipulation
A Boolean equation can be reduced to a minimal number of literal by algebraic manipulation. Unfortunately, there are no specific rules to follow that will guarantee the final answer. The only methods is to use the theorem and postulate of Boolean algebra and any other manipulation that becomes familiar
63
Algebraic Manipulation
Example x(x'+y) = xx' + xy = 0+xy = xy x+x'y = (x+x')(x+y) = 1 (x+y) = x+y (x+y)(x+y') = x+xy+xy'+yy' = x(1+y+y') = x xy + x'z + yz = xy + x'z + yz(x+x') = xy + x'z + yzx + yzx' = xy(1+z) + x'z(1+y) = xy +x'z (x+y)(x'+z)(y+z) = (x+y)(x'+z), by duality
64
Summary Minterms are AND terms with every variable present in either true or complemented form. Maxterms are OR terms with every variable in true or complemented form. Sum of Products (SOP), also called Sum of Minterms (SOM) Product of Sums (POS), also called Product of Maxterms (POM)
65
Summary Any Boolean function that is expressed as a sum of minterms or as a product of maxterms is said to be in its canonical form. A reduced version of canonical form is the standard form in which each term may have any number of variables. It requires fewer operators than canonical forms. The terms aren't required to be minterms or maxterms
66
Summary Standard Forms: Sum-of-products (SOP) has the form:
( _ _ ) + ( _ _ _ ) + ( _ ) Product-of-sums (POS) has the form: ( _ ) * ( _ + _ ) * ( _ + _ + _ ) Canonical Forms: Sum-of-minterms, which is also in SOP form Product-of-maxterms, which is also in POS form
67
Describing Existing Circuits using Logic Expressions
To define what a combinatorial circuit does, we can use a logic expression or an expression for short. Such an expression uses the two constants 0 and 1, variables such as x, y, and z (sometimes with suffixes) as names of inputs and outputs the operators +, . and a horizontal bar or a prime (which stands for not). multiplication is considered to have higher priority than addition. Parentheses are used to modify the priority.
68
Describing Existing Circuits using Logic Expressions
If Boolean functions in either Sum of Product or Product of Sum forms can be implemented using 2 –Level implementations. For SOP forms AND gates will be in the first level and a single OR gate will be in the second level. For POS forms OR gates will be in the first level and a single AND gate will be in the second level. Note that using inverters to complement input variables is not counted as a level.
69
Implementation F1 = y' + xy+ x'yz' F2 = x(y'+z)(x'+y+z')
70
Implementation
71
Implementation
72
Implementation
73
Power of Logic Expression
Can logic expressions describe all possible combinatorial circuits? The answer is yes and here is why: You can trivially convert the truth table for an arbitrary circuit into an expression. The expression will be in the form of a sum of products of variables and there inverses. Each row with output value of 1 of the truth table corresponds to one term in the sum. In such a term, a variable having a 1 in the truth table will be uninverted, and a variable having a 0 in the truth table will be inverted.
74
Power of Logic Expression
For instance: The corresponding expression is: x‘yz'+xy‘z'+xyz Since you can describe any combinatorial circuit with a truth table, and you can describe any truth table with an expression, you can describe any combinatorial circuit with an expression.
75
Simplicity of Logic Expression
There are many logic expressions (and therefore many circuits) that correspond to a certain truth table, and therefore to a certain function computed. For instance, the following two expressions compute the same function: x(y + z) xy + xz
76
Simplicity of Logic Expression
The left one requires two gates, one and-gate and one or-gate. The second expression requires two and-gates and one or-gate. It seems obvious that the first one is preferable to the second one. However, this is not always the case. It is not always true that the number of gates is the only way, nor even the best way, to determine simplicity.
77
Simplicity of Logic Expression
We have, for instance, assumed that gates are ideal. In reality, the signal takes some time to propagate through a gate. We call this time the gate delay. We might be interested in circuits that minimize the total gate delay, in other words, circuits that make the signal traverse the fewest possible gates from input to output. Such circuits are not necessarily the same ones that require the smallest number of gates.
78
Circuit Minimization The complexity of digital logic gates to implement a Boolean function is directly related to the complexity of algebraic expression. Also, an increase in the number of variables results in an increase of complexity. Although the truth table representation of a Boolean function is unique, its algebraic expression may be of many different forms. Boolean functions may be simplified or minimized by algebraic means as described previously
79
Circuit Minimization However, this minimization procedure is not unique because it lacks specific rules to predict the succeeding step in the manipulative process. The map method, first proposed by Veitch and slightly improvised by Karnaugh, provides a simple, straightforward procedure for the simplification of Boolean functions. The method is called Veitch diagram or Karnaugh map, which may be regarded either as a pictorial representation of a truth table or as an extension of the Venn diagram
80
Karnaugh Maps (K-maps)
Source: Maurice Karnaugh (October 4, 1924) is an American physicist, who introduced the Karnaugh map while working at Bell Labs
81
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
82
Two Variable Maps K-map Truth Table of F(x,y) y x y x x y F 0 0 0 m0
0 = y x m 1 = y x x y F m0 m1 m2 m3 x = 0 x = 1 m 2 = y x m 3 = y x y = 0 y = 1 x = 0 x = 1 1 F= m1 +m3 = x’y + xy = (x+x’)y = y
83
Two-Variable Map A two-variable map Four minterms
x' = row 0; x = row 1 y' = column 0; y = column 1 A truth table in square diagram Fig. 3.2(a): xy = m3 Fig. 3.2(b): x+y = x'y+xy' +xy = m1+m2+m3 Figure 3.1 Two-variable Map Figure 3.2 Representation of functions in the map
84
K-Map Function Representation
Example: G(x,y) = xy’ + x’y + xy Simplify using theorems: G = x (y’+y) + x’y = x.1 +x’y = x + x’y = x + y Simplify using K-map: cover adjacent cells G y = 0 y = 1 x = 0 1 x = 1
85
Figure 3.3 Three-variable Map
A three-variable map Eight minterms The Gray code sequence Any two adjacent squares in the map differ by only on variable Primed in one square and unprimed in the other e.g., m5 and m7 can be simplified m5+ m7 = xy'z + xyz = xz (y'+y) = xz Figure 3.3 Three-variable Map
86
Three variable K-map y y z z 1 2 4 3 5 6 7 x
87
A Three-variable Map m0 and m2 (m4 and m6) are adjacent
m0+ m2 = x'y'z' + x'yz' = x'z' (y'+y) = x'z' m4+ m6 = xy'z' + xyz' = xz' (y'+y) = xz'
88
Figure 3.4 Map for Example 3.1, F(x, y, z) = Σ(2, 3, 4, 5) = x'y + xy'
Example 3.1: simplify the Boolean function F(x, y, z) = S(2, 3, 4, 5) F(x, y, z) = S(2, 3, 4, 5) = x'y + xy' Figure 3.4 Map for Example 3.1, F(x, y, z) = Σ(2, 3, 4, 5) = x'y + xy'
89
Figure 3.5 Map for Example 3-2; F(x, y, z) = Σ(3, 4, 6, 7) = yz + xz'
Example 3.2: simplify F(x, y, z) = S(3, 4, 6, 7) F(x, y, z) = S(3, 4, 6, 7) = yz+ xz' Figure 3.5 Map for Example 3-2; F(x, y, z) = Σ(3, 4, 6, 7) = yz + xz'
90
Figure 3.3 Three-variable Map
Four adjacent Squares Consider four adjacent squares 2, 4, and 8 squares m0+m2+m4+m6 = x'y'z'+x'yz'+xy'z'+xyz' = x'z'(y'+y) +xz'(y'+y) = x'z' + xz‘ = z' m1+m3+m5+m7 = x'y'z+x'yz+xy'z+xyz =x'z(y'+y) + xz(y'+y) =x'z + xz = z Figure 3.3 Three-variable Map
91
Example 3.3 F(x, y, z) = S(0, 2, 4, 5, 6) = z'+ xy'
Example 3.3: simplify F(x, y, z) = S(0, 2, 4, 5, 6) F(x, y, z) = S(0, 2, 4, 5, 6) = z'+ xy' Figure 3.6 Map for Example 3-3, F(x, y, z) = Σ(0, 2, 4, 5, 6) = z' +xy'
92
Figure 3.7 Map for Example 3.4, A'C + A'B + AB'C + BC = C + A'B
Example 3.4: let F = A'C + A'B + AB'C + BC Express it in sum of minterms. Find the minimal sum of products expression. Ans: F(A, B, C) = S(1, 2, 3, 5, 7) = C + A'B Figure 3.7 Map for Example 3.4, A'C + A'B + AB'C + BC = C + A'B
93
Example 3.5 Use the K-Map to simplify the following Boolean function x y 1 2 4 3 5 6 7 z y 1 x z F(x, y, z) = ? F = Z + X’Y
94
Four Variable Maps Variables A,B,C and D C B A D 8 9 10 11 12 13 14 15
1 3 2 5 6 4 7 C Notice: only one variable changes for adjacent boxes
95
Figure 3.8 Four-variable Map
The map 16 minterms Combinations of 2, 4, 8, and 16 adjacent squares Figure 3.8 Four-variable Map
96
Four Variable Maps Example F = m (0,2,3,5,6,7,8,10,13,15) 8 9 10 11
12 13 14 15 1 3 2 5 6 4 7 B C D A 1 F= BD + A’C + B’D’
97
Four-Variable Map Simplification
= S F(W, X, Y, Z) (0, 2,4,5,6,7, 8,10,13,15 ) m C A D B 8 9 10 11 12 13 14 15 1 3 2 5 6 4 7 ’ Y Y 1 1 1 1 F= ? 1 1 1 1 1 1 1 1 X X 1 1 1 1 W W 1 1 1 1 Z Z F= XZ + W’X + X’Z’ F= XZ + W’Z’ + X’Z’
98
Example 3.6 Example 3-6: simplify F = ABC + BCD + ABCD + ABC Figure 3.9 Map for Example 3-6; ABC + BCD + ABCD + ABC= BD + BC +ACD
99
Simplifying Sum-of-Product Expressions with a Karnaugh Map
The first step in simplifying a Boolean expression by means of a K-map is to plot all the ones in the function's truth table on the K-map. The next step is to combine adjacent 1s into groups of one, two, four, eight, or sixteen. The groups of minterms should be as large as possible—a single group of four minterms yields a simpler expression than two groups of two minterms.
100
Simplifying Sum-of-Product Expressions with a Karnaugh Map
The final stage in simplifying an expression is reached when each of the groups of minterms (i.e., the product terms) are ORed together to form the simplified sum-of-products expression. The following 4 notes are important in understanding Karnaugh Map.
101
Simplifying Sum-of-Product Expressions with a Karnaugh Map
For a four-variable K-map: 1-variable product term covers 8 squares 2-variable product terms cover 4 squares 3-variable product terms cover 2 squares 4-variable product terms cover 1 squares
102
Simplifying Sum-of-Product Expressions with a Karnaugh Map
A square covered by a 1 may belong to more than one term in the sum-of-products expression. If a 1 on the K-map appears in two groups, it is equivalent to adding the corresponding minterm to the overall expression for the function plotted on the map twice. Repeating a term in an expression does not alter the value of the expression, because one of the axioms of Boolean algebra is X + X = X.
103
Simplifying Sum-of-Product Expressions with a Karnaugh Map
The K-map is not a square or a rectangle as it appears in these diagrams. A K-map is a torus or doughnut shape. That is, the top edge is adjacent to the bottom edge and, the left-hand edge is adjacent to the right-hand edge. Whenever a group of terms extends across the edge of a K-map, we have shaded it to emphasize the wrap-around nature of the map. In order either to read a product term from the map, or to plot a product term on the map, it is necessary to ask the question, what minterms (squares) are covered.
104
Simplifying Sum-of-Product Expressions with a Karnaugh Map
105
Simplifying Sum-of-Product Expressions with a Karnaugh Map
106
Implicant In Boolean logic, an implicant is a "covering" (sum term or product term) of one or more minterms in a sum of products (or maxterms in a product of sums) of a Boolean function. Formally, a product term P in a sum of products is an implicant of the Boolean function F if P implies F. A product term is an implicant of a function if the function has the value 1 for all minterms of the product term. Implicant of F is any single 1 or group of 1's that can be combined together on a Karnaugh map of the function F and represents a product term
107
Prime Implicant A prime implicant of a function is an implicant that cannot be covered by a more general (more reduced - meaning with fewer literals) implicant. W.V. Quine defined a prime implicant of F to be an implicant that is minimal - that is, the removal of any literal from P results in a non-implicant for F. Essential prime implicants are prime implicants that cover an output of the function that no combination of other prime implicants is able to cover.
108
Prime Implicant 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’s Two adjacent 1’s form a prime implicant, provided that they are not within a group of four adjacent squares Four adjacent 1’s form a prime implicant, provided that 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
109
Prime Implicant A single 1 on a map represents a prime implicant if it is not adjacent to any other 1s. Two adjacent 1s form a rectangle representing a prime implicant, provided that they are not within a rectangle of four or more squares containing 1s. Four 1s form a rectangle representing a prime implicant if they are not within a rectangle of eight or more squares containing 1s, and so on. Each essential prime implicant contains at least one square that is not contained in any other prime implicant.
110
Prime Implicant Prime implicants: Essential prime implicants:
Minterms 1 and 3 are included only in the term Minterms 12 and 14 are included Minterms 4, 5, 6, and 7 are each included in two prime implicants one of which is
111
Prime Implicant
112
Prime Implicant
113
Example of Prime Implicants
Find ALL Prime Implicants CD ESSENTIAL Prime Implicants C 1 B D A 1 B C D A D B D B C B Minterms covered by single prime implicant BD BD AD B A
114
Don’t Care Condition
116
Quine-McCluskey The Quine–McCluskey algorithm (or the method of prime implicants) is a method used for minimization of Boolean functions which was developed by W.V. Quine and Edward J. McCluskey. It is functionally identical to Karnaugh mapping, but the tabular form makes it more efficient for use in computer algorithms, and it also gives a deterministic way to check that the minimal form of a Boolean function has been reached. It is sometimes referred to as the tabulation method.
117
Quine-McCluskey The method involves two steps:
Finding all prime implicants of the function. Use those prime implicants in a prime implicant chart to find the essential prime implicants of the function, as well as other prime implicants that are necessary to cover the function.
118
Quine-McCluskey Minimize the following function
The method involves two steps: Finding all prime implicants of the function. Use those prime implicants in a prime implicant chart to find the essential prime implicants of the function, as well as other prime implicants that are necessary to cover the function. Minimize the following function
119
Quine-McCluskey Step 1: finding prime implicant
One can easily form the canonical sum of products expression from this table, simply by summing the minterms (leaving out don't-care terms) where the function evaluates to one:
120
Quine-McCluskey Of course, that's certainly not minimal. So to optimize, all minterms that evaluate to one are first placed in a minterm table. Don't-care terms are also added into this table, so they can be combined with minterms:
121
Quine-McCluskey At this point, one can start combining minterms with other minterms. If two terms vary by only a single digit changing, that digit can be replaced with a dash indicating that the digit doesn't matter. Terms that can't be combined any more are marked with a "*". When going from Size 2 to Size 4, treat '-' as a third bit value. Ex: -110 and -100 or -11- can be combined, but not -110 and (Trick: Match up the '-' first.)
122
Quine-McCluskey Note: In this example, none of the terms in the size 4 implicants table can be combined any further. Be aware that this processing should be continued otherwise (size 8 etc).
123
Quine-McCluskey Step 2: Prime implicant chart
None of the terms can be combined any further than this, so at this point we construct an essential prime implicant table. Along the side goes the prime implicants that have just been generated, and along the top go the minterms specified earlier. The don't care terms are not placed on top - they are omitted from this section because they are not necessary inputs.
124
Quine-McCluskey
125
Quine-McCluskey In the prime implicant table shown above, there are 5 rows, one row for each of the prime implicant and 6 columns, each representing one minterm of the function. X is placed in each row to indicate the minterms contained in the prime implicant of that row. For example, the two X in the first row indicate that minterm 4 and 12 are contained in the prime implicant represented by (-100) i.e. BC′D′
126
Quine-McCluskey The completed prime implicant table is inspected for columns containing only a single X. In this example, there are two minterms whose column have a single X (4 & 15). The minterm 4 is covered by prime implicant BC′D′. that is the selection of prime implicant BC′D′ guarantee that minterm 4 is included in the selection. Similarly, minterm 15 is covered by prime implicant AC. Prime implicants that cover minterms with a single X in their column are called essential prime implicants. Those essential prime implicant must be selected.
127
Quine-McCluskey Now we find out each column whose minterm is covered by the selected essential prime implicant
128
Quine-McCluskey For this example, essential prime implicant BC'D' covers minterm 4 and 12. Essential prime implicant AC covers 10, 11 and 15. An inspection of the implicant table shows that, all the minterms are covered by the essential prime implicant except the minterms 8. The minterms not selected must be included by the selection of one or more prime implicants.
129
Quine-McCluskey From this example, we have only one minterm which is 8. It can be included in the selection either by including the prime implicant AB' or AD'. Since both of them have minterm 8 in their selection. We have thus found the minimum set of prime implicants whose sum gives the required minimized function:
130
Quine-McCluskey Both of those final two equations are functionally equivalent to the original, verbose equation:
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.