Documente Academic
Documente Profesional
Documente Cultură
Overview
Binary logic and Gates Boolean Algebra
Basic Properties Algebraic Manipulation
K-Map Manipulation
Implicants: Prime, Essential Dont Cares
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 2
Binary Logic Deals with binary variables that take 2 discrete values (0 and 1), and with logic operations Three basic logic operations:
AND, OR, NOT
26-Mar10
( +, , )
nVariables nConstants
( 0, 1 ) nGroupings (parenthesis)
26-Mar10
A 0 0 1 1
26-Mar10
B F=A F=A B 0 0 1 0 0 0 1 1
A 0 0 1 1
B F=A F=A+ +B 0 0 1 1 0 1 1 1
NOT
A F=A F=A 0 1 1 0
6
Q: Let a function F() depend on n variables. How many rows are there in the truth table of F() ?
A: 2n rows, since there are 2n possible binary patterns/combinations for the n variables
26-Mar10
Logic Gates
Logic gates are abstractions of electronic circuit components that operate on one or more input signals to produce an output signal.
2-Input AND A B F A B
2-Input OR G
NOT (Inverter) A H
F = A AB
26-Mar10
G = A+B
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
H = A
8
Timing Diagram
t0 t1 t2 t3 t4 t5 t6 Input signals A B F=AB G=A+B H=A
1 0 1 0 1 0 1 0 1 0
Transitions Basic Assumption: Zero time for signals to propagate Through gates
9
26-Mar10
C A B
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 10
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
C 0 1 0 1 0 1 0 1
F 1 1 1 1 0 0 1 0
G 1 1 1 1 0 0 1 0
11
C B A
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
G
12
Boolean Algebra VERY nice machinery used to manipulate (simplify) Boolean functions George Boole (1815-1864): An investigation of the laws of thought Terminology:
Literal: A variable or its complement Product term: literals connected by Sum term: literals connected by +
26-Mar10
13
1. 2. 3. 4.
X+0=X X1 =X X+1 =1 X0 =0
26-Mar10
14
5. 6. 7. 8. 9.
26-Mar10
X+X=X XX =X X + X = 1 X X = 0 (X) = X
15
X+0=X 3. X + 1 = 1 5. X + X = X 7. X + X = 1
2.
X 4. X 6. X 8. X
1 =X 0 =0 X =X X = 0
26-Mar10
17
XY=YX -- Commutative 13. X(YZ) = (XY)Z -- Associative 15. X+(YZ) = (X+Y) (X+Z)
11.
-- Distributive
(X + Y) = X Y
17.
(X Y) = X + Y
-- DeMorgans
26-Mar10
18
Absorption Property (Covering) 1. x + xy = x 2. x(x+y) = x (dual) Proof: x + xy = x1 + xy = x(1+y) = x1 =x QED (2 true by duality)
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 19
Consensus Theorem
1. xy + xz + yz = xy + xz 2. (x+y)(x+z)(y+z) = (x+y)(x+z) -- (dual) Proof: xy + xz + yz = xy + xz + (x+x)yz = xy + xz + xyz + xyz = (xy + xyz) + (xz + xzy) = xy + xz QED (2 true by duality).
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 20
Enumerates all possible combinations of variable values and the corresponding function value Truth tables for some arbitrary functions F1(x,y,z), F2(x,y,z), and F3(x,y,z) are shown to the right.
26-Mar10
26-Mar10
22
Unlike truth tables, expressions representing a Boolean function are NOT unique. Example:
F(x,y,z) = xyz + xyz + xyz G(x,y,z) = xyz + yz
The corresponding truth tables for F() and G() are to the right. They are identical! Thus, F() = G()
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
Algebraic Manipulation Boolean algebra is a useful tool for simplifying digital circuits. Why do it? Simpler can mean cheaper, smaller, faster. Example: Simplify F = xyz + xyz + xz. F = xyz + xyz + xz = xy(z+z) + xz = xy1 + xz = xy + xz
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 24
Algebraic Manipulation (cont.) Example: Prove xyz + xyz + xyz = xz + yz Proof: xyz+ xyz+ xyz = xyz + xyz + xyz + xyz = xz(y+y) + yz(x+x) = xz1 + yz1 = xz + yz QED.
26-Mar10
25
Complement of a Function
The complement of a function is derived by interchanging ( and +), and (1 and 0), and complementing each variable. Otherwise, interchange 1s to 0s in the truth table column showing F. The complement of a function IS NOT THE SAME as the dual of a function.
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 26
Complementation: Example
Find G(x,y,z), the complement of F(x,y,z) = xyz + xyz G = F = (xyz + xyz) = (xyz) (xyz) DeMorgan = (x+y+z) (x+y+z) DeMorgan again
Note: The complement of a function can also be derived by finding the functions dual, and then complementing all of the literals
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 27
Canonical and Standard Forms We need to consider formal techniques for the simplification of Boolean functions.
Minterms and Maxterms Sum-of-Minterms and Product-of-Maxterms Product and Sum terms Sum-of-Products (SOP) and Product-of-Sums (POS)
26-Mar10
28
Definitions
Literal: A variable or its complement Product term: literals connected by Sum term: literals connected by + Minterm: a product term in which all the variables appear exactly once, either complemented or uncomplemented Maxterm: a sum term in which all the variables appear exactly once, either complemented or uncomplemented
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 29
Minterm
Represents exactly one combination in the truth table. Denoted by mj, where j is the decimal equivalent of the minterms corresponding binary combination (bj). A variable in mj is complemented if its value in bj is 0, otherwise is uncomplemented. Example: Assume 3 variables (A,B,C), and j=3. Then, bj = 011 and its corresponding minterm is denoted by mj = ABC
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 30
Maxterm
Represents exactly one combination in the truth table. Denoted by Mj, where j is the decimal equivalent of the maxterms corresponding binary combination (bj). A variable in Mj is complemented if its value in bj is 1, otherwise is uncomplemented. Example: Assume 3 variables (A,B,C), and j=3. Then, bj = 011 and its corresponding maxterm is denoted by Mj = A+B+C
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 31
x Minterms and Maxterms are 0 easy to denote 0 using a truth table. 0 0 Example: Assume 3 1 variables x,y,z 1 (order is fixed) 1 1
26-Mar10
y 0 0 1 1 0 0 1 1
z 0 1 0 1 0 1 0 1
Canonical Forms (Unique) Any Boolean function F( ) can be expressed as a unique sum of minterms and a unique product of maxterms (under a fixed variable ordering). In other words, every function F() has two canonical forms:
Canonical Sum-Of-Products (sum of minterms) Canonical Product-Of-Sums (product of maxterms)
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 33
Canonical Sum-Of-Products: The minterms included are those mj such that F( ) = 1 in row j of the truth table for F( ). Canonical Product-Of-Sums: The maxterms included are those Mj such that F( ) = 0 in row j of the truth table for F( ).
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 34
Example
Truth table for f1(a,b,c) at right The canonical sum-of-products form for f1 is f1(a,b,c) = m1 + m2 + m4 + m6 = abc + abc + abc + abc The canonical product-of-sums form for f1 is f1(a,b,c) = M0 M3 M5 M7 = (a+b+c)(a+b+c) (a+b+c)(a+b+c). Observe that: mj = Mj
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
a 0 0 0 0 1 1 1 1
b 0 0 1 1 0 0 1 1
c 0 1 0 1 0 1 0 1
f1 0 1 1 0 1 0 1 0 35
Shorthand:
and !
f1(a,b,c) = ! m(1,2,4,6), where ! indicates that this is a sum-of-products form, and m(1,2,4,6) indicates that the minterms to be included are m1, m2, m4, and m6. f1(a,b,c) = " M(0,3,5,7), where " indicates that this is a product-of-sums form, and M(0,3,5,7) indicates that the maxterms to be included are M0, M3, M5, and M7. Since mj = Mj for any j, ! m(1,2,4,6) = " M(0,3,5,7) = f1(a,b,c)
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 36
26-Mar10
37
Standard Forms (NOT Unique) Standard forms are like canonical forms, except that not all variables need appear in the individual product (SOP) or sum (POS) terms. Example: f1(a,b,c) = abc + bc + ac is a standard sum-of-products form f1(a,b,c) = (a+b+c)(b+c)(a+c) is a standard product-of-sums form.
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 38
Conversion of SOP from standard to canonical form Expand non-canonical terms by inserting equivalent of 1 in each missing variable x: (x + x) = 1 Remove duplicate minterms f1(a,b,c) = abc + bc + ac = abc + (a+a)bc + a(b+b)c = abc + abc + abc + abc + abc = abc + abc + abc + abc
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 39
Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row in the truth table. Also, one map cell corresponds to a minterm or a maxterm in the boolean expression Multiple-cell areas of the map correspond to standard terms.
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 41
Two-Variable Map
x1 0
2
x2
0
0
1
1 m0
3
x2
x1
0
0
2
1 m0 m2
3
m1 m3
OR
0
1
m2
m1
m3
NOTE: ordering of variables is IMPORTANT for f(x1,x2), x1 is the row, x2 is the column. Cell 0 represents x1x2; Cell 1 represents x1x2; etc. If a minterm is present in the function, then a 1 is placed in the corresponding cell.
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
26-Mar10
42
Two-Variable Map (cont.) Any two adjacent cells in the map differ by ONLY one variable, which appears complemented in one cell and uncomplemented in the other. Example: m0 (=x1x2) is adjacent to m1 (=x1x2) and m2 (=x1x2) but NOT m3 (=x1x2)
26-Mar10
43
f(x1,x2) = x1x2+ x1x2 + x1x2 = m0 + m1 + m2 = x1 + x2 1s placed in K-map for specified minterms m0, m1, m2 Grouping (ORing) of 1s allows simplification What (simpler) function is represented by each dashed rectangle? a1 = m0 + m1 a2 = m0 + m2 Note m0 covered twice
26-Mar10
x1
x2
0
0
1
0
2
1
3
1 0
44
26-Mar10
45
Three-Variable Map
yz x 0 1
0
00 m0 m4
1
01 m1 m5
3
11 m3 m7
2
10 m2 m6
-Note: variable ordering is (x,y,z); yz specifies column, x specifies row. -Each cell is adjacent to three other cells (left or right or top or bottom or edge wrap)
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 46
The types of structures that are either minterms or are generated by repeated application of the minimization theorem on a three variable map are shown at right. Groups of 1, 2, 4, 8 are possible. group of 2 terms
group of 4 terms
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 47
Simplification Enter minterms of the Boolean function into the map, then group terms Example: f(a,b,c) = ac + abc + bc Result: f(a,b,c) = ac+ b
a bc
0 0 1 26-Mar10 00 01
1
00 01
1 1
10
1 1
11
1 1
10
1 1
11
48
More Examples
yz
X 00 01 11 10
f1(x, y, z) = ! m(2,3,5,7)
n
0 1
f1(x, y, z) = xy + xz
1 1
f2(x, y, z) = ! m (0,1,2,3,6)
nf2(x,
y, z) = x+yz
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
1 1
49
26-Mar10
Four-Variable Maps
YZ
WX
00 00 m0 01 m4
01 m1 m5 m13 m9
11 m3 m7 m15 m10
10 m2 m6 m14 m11
11 m12 10 m8
Top cells are adjacent to bottom cells. Left-edge cells are adjacent to right-edge cells. Note variable ordering (WXYZ).
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 50
26-Mar10
51
Example
Simplify the following Boolean function (A,B,C,D) = !m(0,1,2,4,5,7,8,9,10,12,13). First put the function g( ) into the map, and then group as many 1s as possible.
ab cd
00
1 1 1 1
01
1 1 1 1
11
1
10
1
00 01
1 1 1 1 1 1 1
11
10
1
00 01 11 10
g(A,B,C,D) = c+bd+abd
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 52
5-Variable K-Map
DE
BC
16 17 21 2 29 6 25 14 10
A=1
19 23 31 27 18 22 30 26
DE
BC
0 4 12 8 1 5 13 9 20 3 28 7 24 15 11
ABCDE
A=0
ABCDE
26-Mar10
53
Example
Consider function f(a,b,c,d) whose Kmap is shown at right. ab is not a prime implicant because cd ab it is contained in b. 1 acd is not a prime implicant because 1 it is contained in ad. b, ad, and acd are prime implicants. 1 ab 1 acd
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
b ad
1 1 1 1 1 1 1
acd
55
ad
1 1 1 1 1
b
1
1 1
1 1 1
For the previous example, the PIs are b, ad, and acd; all of these are essential.
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
acd
56
Another Example Consider f2(a,b,c,d), whose K-map is shown below. The only essential PI is bd.
ab cd
1 1 1 1 1 1 1 1 1
26-Mar10
57
Systematic Procedure for Simplifying Boolean Functions 1. Generate all PIs of the function. 2. Include all essential PIs. 3. For remaining minterms not included in the essential PIs, select a set of other PIs to cover them, with minimal overlap in the set. 4. The resulting simplified function is the logical OR of the product terms selected above.
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 58
Example
f(a,b,c,d) = cd m(0,1,2,3,4,5,7,14,15). ab 1 Five grouped terms, not all 1 needed. 3 shaded cells covered by only one term 3 EPIs, since each shaded cell is covered by a different term. F(a,b,c,d) = ab + ac + ad + abc
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
1 1
1 1 1
59
Product of Sums Simplification Use sum-of-products simplification on the zeros of the function in the K-map to get F. Find the complement of F, i.e. (F) = F
Recall that the complement of a boolean function can be obtained by (1) taking the dual and (2) complementing each literal. OR, using DeMorgans Theorem.
26-Mar10
60
POS Example
cd ab
1 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0
F(a,b,c,d) = ab + ac + abcd Find dual of F, dual(F) = (a+b)(a+c)(a+b+c+d) Complement of literals in dual(F) to get F F = (a+b)(a+c)(a+b+c+d) (verify that this is the same as in slide 60)
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 61
The function value for such combinations is called a don't care. They are usually denoted with x. Each x may be arbitrarily assigned the value 0 or 1 in an implementation. Dont cares can be used to further simplify a function
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 62
Minimization using Dont Cares Treat don't cares as if they are 1s to generate PIs. Delete PI's that cover only don't care minterms. Treat the covering of remaining don't care minterms as optional in the selection process (i.e. they may be, but need not be, covered).
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5) 63
Example
Simplify the function f(a,b,c,d) whose K-map is shown at the right. f = acd+ab+cd+abc or f = acd+ab+cd+abd The middle two terms are EPIs, while the first and last terms are selected to cover the minterms m1, m4, and m5. (Theres a third solution!)
cd ab 00 01 11 10
00 0 01 1 1 1 0 0 1 1
11 0 0 x x 10 1 1 x x 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 0 x x 0 0 x x 1 1 x x 1 1 x x
64
26-Mar10
Another Example Simplify the function g(a,b,c,d) whose K-map is shown at right. g = ac+ ab or g = ac+bd
cd ab
x 1 1
1 x
0 0 x 1
x 0 x x 0 0 0 x 1
0 x x 1 1 1 x
x 0 x x 0 0 0 x 1
65
0 x x 1 1 1 x
x 0 x x 0
0 x
26-Mar10
Chapter 2-i: Combinational Logic Circuits (2.1-- 2.5)
Algorithmic minimization What do we do for functions with more than 4-5 variables? You can code up a minimiser (ComputerAided Design, CAD)
Quine-McCluskey algorithm Iterated consensus
26-Mar10
66