Professional Documents
Culture Documents
Combinational Logic
Combinational Logic
Sequential logic
--- outputs logical functions of inputs and previous
history of circuit (memory)
--- after changed inputs, new outputs appear in
the next clock cycle
--- frequent feedback loops
For analysis and synthesis...
primary tool is Boolean algebra
X ≠1⇒ X = 0 X ≠ 0 ⇒ X =1
X = 0 ⇒ X '=1 X =1⇒ X '= 0
0•0 = 0 1+1 = 1
1•1 = 1 0+0 = 0
0 •1 = 1• 0 = 0 0 +1 = 1+ 0 = 1
Axiomatic definition: Dual statements:
X ≠1⇒ X = 0 X ≠ 0 ⇒ X =1
X = 0 ⇒ X '=1 X =1⇒ X '= 0
0•0 = 0 1+1 = 1
1•1 = 1 0+0 = 0
0 •1 = 1• 0 = 0 0 +1 = 1+ 0 = 1
More definitions
• Literal: a variable or its complement
– X, X′ , FRED′ , CS_L
• Expression: literals combined by
AND, OR, parentheses, complementation
– X+Y
–P ⋅ Q ⋅ R
–A + B ⋅ C
– ((FRED ⋅ Z′ ) + CS_L ⋅ A ⋅ B′ ⋅ C + Q5) ⋅ RESET′
• Equation: Variable = expression
– P = ((FRED ⋅ Z′ ) + CS_L ⋅ A ⋅ B′ ⋅ C + Q5) ⋅
RESET′
Theorems
Proofs by exhaustion:
Let variables assume all possible values and show
• Proofs by perfect induction
validity of result in all cases
Example: Show X + 0 = X
If Y+Z = 1
(X+Y)•(X’+Z)•(Y+Z)= (X+Y)•(X’+Z)•1= (X+Y)•(X’+Z)
else
Y=Z=0
left side: (X+Y)•(X’+Z)•(Y+Z)= something • (Y + Z) = something • 0 = 0
right side: (X+Y)•(X’+Z) = (X+0)•(X’+0) = X•X’ = 0
So, in either case, (X+Y)•(X’+Z)•(Y+Z)= (X+Y)•(X’+Z)
Duality
• De Morgan’s Theorems:
(X + Y)’ = X’ • Y’
(X • Y)’ = X’ + Y’
• Dual: Swap 0 & 1, AND & OR, but leave variables unchanged
– Result: Theorems still true
• Why?
– f(X, Y) = g(X, Y)
– complement[f(X, Y)] = complement[g(X, Y)]
– dual[f(X’, Y’)] = dual[g(X’, Y’)]
– but X’, Y’ just dummy variables, replace with originals
• Counterexample?
X + X ⋅ Y = X (T9) X + (X ⋅ Y) = X (T9)
X ⋅ X + Y = X (dual) X ⋅ (X + Y) = X (dual)
X + Y = X (T3′ ) (X ⋅ X) + (X ⋅ Y) = X (T8)
!! error ? X + (X ⋅ Y) = X (T3′ )
parentheses,
operator precedence
N-variable Theorems
Bubble-pushing...
Likewise for OR
Alternate Gate Symbols
X + Y = [( X + Y ) ']' = [ X 'gY ']'
Alternate Gate Symbols
Logic representations:
F = Y’Z’ + XY + YZ
F = (X + Y’ + Z)(Y + Z’)
Definitions:
Literal --- a variable or complemented variable (e.g., X or X')
product term --- single literal or logical product of literals (e.g., X or X'Y)
sum term --- single literal or logical sum of literals (e.g. X' or (X' + Y))
minterm --- normal product term containing all variables (e.g. XYZ')
maxterm --- normal sum term containing all variables (e.g. (X + Y + Z'))
canonical sum --- sum of minterms from truth table rows producing a 1
canonical product --- product of maxterms from truth table rows producing a 0
Truth table vs. minterms & maxterms
Shortcut notation:
Note equivalences:
Σ (0, 3, 4, 6, 7) = Π (1, 2, 5)
Multiply out:
F = ((X + Y′ ) ⋅ Z) + (X′ ⋅ Y ⋅ Z′ )
= (X ⋅ Z) + (Y′ ⋅ Z) + (X′ ⋅ Y ⋅ Z′ )
New circuit, same function
Any number of manipulations can yield equivalent circuits
e.g.
F = ((X + Y’)Z) + X’YZ’
Note: [X’YZ’]Z = 0
(X + Y’)X’YZ’ = 0
(X’YZ’)(X’YZ’) = X’YZ’
So, F = [(X + Y’) + X’YZ’][Z + X’YZ’]
=(X + Y’ + X’)(X + Y’ + Y)(X + Y’ + Z’)(Z + X’)(Z + Y)(Z + Z’)
=(1)(1)(X + Y’ + Z’)(X’ + Z)(Y + Z)(1)
= (X + Y’ + Z’)(X’ + Z)(Y + Z)
Circuit:
Push bubbles to obtain cancellations
Push bubbles to obtain cancellations
Conclude:
given circuit ==> many equivalent equations
Three-level equivalent
Combinational analysis
given circuit, determine function
Combinational synthesis
given function, determine circuit
Prime number detector: F = Σ (1, 2, 3, 5, 7, 11, 13)
AND-OR design
N 3 N 3 ' N 0 N 0 '
Alarm:
Karnaugh maps
Quine-McCluskey algorithm
Prime number detector: F = Σ (1, 2, 3, 5, 7, 11, 13)
N3 N2
00 01 11 10 0001
00 00-1
0011
0--1
01 x x x
N1 N0 0101
01-1
11 x x x 0111
10 x
Karnaugh maps: 2, 3, and 4 variable
Example:
F = X’YZ’ + XZ + Y’Z
Prime implicants
Another example: (maximal clusters)
Prime number detector
Prime number detector
Another example:
distinguished cell: covered by only one prime implicant
essential prime implicant: contains distinguished cell
Another example:
primes, distinguished cells, essentials
Selecting essentials leaves an uncovered cell
cover with simpler implicant: W’Z
Eclipsing (in reduced map)
P eclipses Q if P covers all of Q’s ones
if P is no more expensive (same or fewer literals),
then choose P over Q
Alas, no essential prime implicants
branching: choose a cell and examine all implicants
that cover that cell
Don’t cares....
Multiple functions
can use separate Karnaugh maps
...or can manage to find common terms...
For more than 6 input variables,
Karnaugh maps are difficult to manipulate
CUBE P1, x, y, z;
X 15 X 12 X 10 X 9 X 4 X 1 X 0
Example in four variables
Equation:
w x’ y z’ + w’ x’ y z’ = x’ y z’
Karnaugh map:
wx
00 01 11 10
yz 00
01
11
10 1 1
1010 ⊕ 0010 = 1000 ==> single one in common position ==> combinable
0101 ⊕ 1101 = 1000
1010 & 0010 = 0010 ==> w now missing, new cube corresponds to z’ y z’
0101 & 1101 = 0101
Start with minterms (0-cubes)
Combine when possible to form (1-cubes)....
Example: w’xy’z + wxy’z + w’xyz + wxyz = xz
wx
00 01 11 10
yz 00
01 1 1
0101 ⊕ 1101 = 1000
11 1 1
1010 ⊕ 0010 = 1000
10
0101 & 1101 = 0101
Cubes: 0101 1101 0111 1111
1010 & 0010 = 0010
1010 0010 1000 0000
0101
1010
1101
0010
0111
1000
1111
0000
Start with minterms (0-cubes)
Combine when possible to form (1-cubes)....
Example: w’xy’z + wxy’z + w’xyz + wxyz = xz
wx
00 01 11 10
yz 00
01 1 1
0101 ⊕ 1101 = 1000
11 1 1
1010 ⊕ 0010 = 1000
10
√
0101 & 1101 = 0101
Cubes: 0101 1101 0111 1111
1010 & 0010 = 0010
1010 0010 1000 0000
0101
1010 wx
00 01 11 10
√ 1101 0101 yz 00
0010 0010 01 1 1
11 1 1
0111 10
1000
1111
0000
Start with minterms (0-cubes)
Combine when possible to form (1-cubes)....
Example: w’xy’z + wxy’z + w’xyz + wxyz = xz
wx
00 01 11 10
yz 00
01 1 1
11 1 1
10
√ √ √
Cubes: 0101 1101 0111 1111
1010 0010 1000 0000
0101
1010 wx
00 01 11 10
√ 1101 0101 yz 00
0010 0010 01 1 1
11 1 1
√ 0111 0101 10
1000 1000
wx
00 01 11 10
yz 00
01 1 1
11 1 1
10
√ √
Cubes: 0101 0101 1101 0111
0010 1000 0000 0000
0101
0010
0101
1000
√ 1101 0101
0000 0000
√ 0111 0101
0000 0000
Quine-McCluskey Algorithm:
Read in all minterms (0-cubes);
mark all 0-cubes “uncovered”;
for (m = 0; m < Nvar; m++)
for (j = 0; j < Ncubes[m]; j++)
for (k = j + 1; k < Ncubes[m]; k++)
if (combinable(cube[m][j], cube[m][k])) {
mark cube[m][j] and cube[m][k] “covered”
temp = combined cube;
if (temp not already at level m + 1) {
add temp to level m + 1;
mark temp “uncovered”
}
}
Manual algorithm: F = Σ (2, 5, 7, 9, 13, 15) (variables WXYZ)
uncovered terms
0010
1111
Manual algorithm: F = Σ (2, 5, 7, 9, 13, 15) (variables WXYZ)
WY’Z
0010
YZ 01 1 1 1
W’X’YZ’ 11 1 1
10 1
Minterms
Prime 2 5 7 9 13 15
Implicants
0010 x
1-01 x x
-1-1 x x x x
distinguished cells
essential implicants
Minimal form: A + E + C
Not all prime implicants are necessarily essential
distinguished cells
essential implicants
Minimal form: A + E + C
Not all prime implicants are necessarily essential
distinguished cells
essential implicants
Minimal form: A + E + C
Static hazard: X = Y = 1, Z falls from 1 to 0
XZ’ Z’
Z’
XZ’
Consensus term
Solution: add consensus term
XZ’ Z’
Z’
XZ’
XZ’
Z’
Consensus term