Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 72

These slides incorporate figures from Digital Design

Principles and Practices, third edition, by John F.


Wakerly, Copyright 2000, and are used by permission.
NO permission is given to re-use or publish these
figures, in either original or modified form, in printed,
electronic or any other format.
Slide Set 4
Combinational Logic
Combinational logic
--- outputs logical functions of inputs
--- new outputs appear shortly after changed inputs
(propagation delay)
--- no feedback loops
--- no clock

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

• also known as “switching algebra”


– deals with boolean values -- 0, 1
• Positive-logic convention
– analog voltages LOW, HIGH --> 0, 1
– negative logic (reverse assignments) seldom used
• Signal values denoted by variables
(X, Y, FRED, etc.)
Boolean operators
• Complement: X′ (opposite of X)
• AND: X⋅ Y binary operators, described
functionally by truth table.
• OR: X+Y

• Axiomatic definition: A1-A5, A1′ -A5′


Axiomatic definition:

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

(a) Keep axioms handy 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

(b) Elaborate cases:


if X = 0, have
X+0=0+0=0=X
if X = 1, have
X+0=1+0=1=X
More Theorems

Can prove by exhaustion....but have more cases


For distributive laws,
T8 looks like ordinary algebra
T8’ also true (swap operators, factor, swap back)
T9, T10 for logic minimization - drop irrelevant terms
T9, T10, T11 for logic minimization - drop superfluous terms
T9 (Covering): X + X•Y = X and X•(X+Y)=X
Proof: X + X•Y = X•1 + X•Y = X•(1+Y) = X•1 = X
X•(X+Y) = (X+0)•(X+Y) = X+(0•Y) = X+0 = X

T10 (Combining): X•Y + X•Y’ = X and (X + Y) • (X + Y’) = X


Proof: X•Y + X•Y’ = X•(Y + Y’) = X•1 = X
(X + Y)•(X + Y’) = X + (Y•Y’) = X + 0 = X

T11 (Consensus): X•Y+X’•Z+Y•Z = X•Y+X’•Z and (X+Y)•(X’+Z)•(Y+Z)= (X+Y)•(X’+Z)


Proof: If Y•Z = 0
X•Y+X’•Z+Y•Z = X•Y+X’•Z+ 0 = X•Y+X’•Z
else
Y=Z=1
left side: X•Y+X’•Z+YZ = something + YZ = something + 1 =1
right side: X•Y+X’•Z = X + X’ = 1
So, in either case, X•Y+X’•Z+YZ = X•Y+X’•Z

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

• Prove via induction


• Most important: DeMorgan theorems
DeMorgan Symbol Equivalence

Bubble-pushing...
Likewise for OR
Alternate Gate Symbols
X + Y = [( X + Y ) ']' = [ X 'gY ']'
Alternate Gate Symbols
Logic representations:

(a) truth table (b) boolean equation


from 1-rows in truth table:

F = X’Y’Z’ + X’YZ + XY’Z’ + XYZ’ + XYZ

F = Y’Z’ + XY + YZ

from 0-rows in truth table:

F = (X + Y + Z’)(X + Y’ + Z)(X’ + Y + Z’)

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))

sum-of-products --- logical sum of product terms (e.g. X'Y + Y'Z)

product-of-sums --- logical product of sum terms (e.g. (X + Y')(Y + Z))

normal term --- sum term or product term


in which no variable appears more than once
(e.g. X'YZ but not X'YZX or X'YZX'
(X + Y + Z') but not (X + Y + Z' + X))

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:

F = X’Y’Z’ + X’YZ + XY’Z’ + XYZ’ + XYZ


= Σ (0, 3, 4, 6, 7)

F = (X + Y + Z’)(X + Y’ + Z)(X’ + Y + Z’)


= Π (1, 2, 5)

Note equivalences:
Σ (0, 3, 4, 6, 7) = Π (1, 2, 5)

[Σ (0, 3, 4, 6, 7)]’ = Σ (1, 2, 5) = Π (0, 3, 4, 6, 7)

[Π (1, 2, 5)]’ = Π (0, 3, 4, 6, 7) = Σ (1, 2, 5)


Combinational analysis

... derives truth table


Signal expressions

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

circuit does not determine equation


Also, equation does not determine circuit:

Two-level AND-OR Two-level NAND-NAND

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:

Derive truth table or expand:

A = P + E • EX’ • (W • D • G)’ = P + E • EX’ • (W’ + D’ + G’)


= P + E • EX’ • W’ + E • EX’ • D’ + E • EX’ • G’
A = P + E • EX’ • W’ + E • EX’ • D’ + E • EX’ • G’
NANDs, NORs have fewer transistors than ANDs, ORs
AND-OR converts readily to NAND-NAND
Complication if some inputs go directly to second stage:
OR-AND to NOR-NOR
Bubble-pushing produces non-standard gate
Solution: inverters
Bubble-pushing produces non-standard gate
Solution: inverters
Bubble-pushing produces non-standard gate
Solution: inverters
Synthesis approaches illustrated to this point:
Truth table derivation of minterms

Ad hoc construction of logic equation

Need systematic approach


that minimizes hardware

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

Need computer program....


Quine-McCluskey algorithm
typedef unsigned short WORD; /* assume 16-bit registers */
struct cube {
WORD t; /* marks uncomplemented variables */
WORD f; /* marks complemented variables */
}
typedef struct cube CUBE;

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

Cubes (last four bits):

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

√ 1111 1101 0111


0000 0000 0000
Continue to form 2-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 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

0101 01-1 -1-1


1001 -101
1-01
0111 -111
1101 11-1

1111
Manual algorithm: F = Σ (2, 5, 7, 9, 13, 15) (variables WXYZ)
WY’Z
0010

0101 x 01-1 x -1-1


1001 x -101 x
1-01 XZ
0111 x -111 x
1101 x 11-1 x
WX
1111 x 00 01 11 10
00

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 minterms (cells): 2, 5, 7, 9, 15


essential prime implicants: 0010, 1-01, -1-1 (all)

F = 0010 + 1-01 + -1-1 = W’X’YZ’ + WY’Z + XZ


Not all prime implicants are necessarily essential

distinguished cells
essential implicants

remainder C eclipses B and D

Minimal form: A + E + C
Not all prime implicants are necessarily essential

distinguished cells
essential implicants

remainder C eclipses B and D

Minimal form: A + E + C
Not all prime implicants are necessarily essential

distinguished cells
essential implicants

remainder C eclipses B and D

Minimal form: A + E + C
Static hazard: X = Y = 1, Z falls from 1 to 0

XZ’ Z’
Z’

XZ’

Reconstruct Karnaugh map:


F = XZ’ + YZ = XYZ’ + XY’Z’ + XYZ + X’YZ

Consensus term
Solution: add consensus term

XZ’ Z’
Z’

XZ’

XZ’

Z’

Consensus term

You might also like