Minterms
010101)3,2,1( xxxxxxmf ++== ∑William Sandqvist [email protected]
111101110000
3210
01 fxx
OR A minterm is a product of all variables and it describes the combination of ”1” and ”0” that toghether makes the term to adopt the value 1.
SoP-form with three minterms.
Minimization with Boolean algebra
010101)3,2,1( xxxxxxmf ++== ∑
William Sandqvist [email protected]
111101110000
3210
01 fxx
OR
Simplification with boolean algebra 10
1110
01101
0101
101
00101
)(
)1(
...)1(
)(
xxxxxx
xxxxx
xxxx
xxx
xxxxx
+==++=
=++=
=++=
=++=
=++=
As expected!
Maxterm
William Sandqvist [email protected]
111101110000
3210
01 fxx
OR A maxterm är en sum-factor of all variables and it describes the combination of ”1” and ”0” that toghether makes the sum to adopt the value 0.
10)0( xxMf +== ∏This time we got the simple expression direct with the maxterm!
Venn-diagram OR
In a Venn diagram, one can see that a function can be expressed in a variety of ways, but it is not easy to see what is optimal. Another question is also how to draw Venn diagrams for more than three variables??
William Sandqvist [email protected]
All minterms
OR, some of the minterms
Graphical minimization method
William Sandqvist [email protected]
111101110000
3210
01 fxx
OR 0 1 1 1
x0 x1
0
1
0 1
m0 m1
m2 m3
x0 x1
0
1
0 1
1001
010132
)( xxxx
xxxxmm
=+=
=+=+
0110
010131
)( xxxx
xxxxmm
=+=
=+=+
01 xxf +=
Graphical minimization method
William Sandqvist [email protected]
111101110000
3210
01 fxx
OR 0 1 1 1
x0 x1
0
1
0 1
01 xxf +=
Make ”groups” two ones that are "neighbors" (vertically or horizontally) the minterms could then be reduced to "what they have in common".
1x0x
Gate functions Graphical form
William Sandqvist [email protected]
0 0 0 1
0 1 1 1
0 1 1 0
1 1 1 0
1 0 0 0
1 0 0 1
AND OR XOR
NAND NOR XNOR
x0 x1
0
1
0 1 x0 x1
0
1
0 1 x0 x1
0
1
0 1
x0 x1
0
1
0 1 x0 x1
0
1
0 1 x0 x1
0
1
0 1
01 xx +01 xx ⋅ 0101 xxxx +
{ } 0101 xxdMxx +⋅{ } 0101 xxdMxx ⋅+ 0101 xxxx +
3D boolean numberspace
William Sandqvist [email protected]
The corners are coded with Gray-code. Between neighbor corners only one variable differs.
Ex. 3.4 Cube representation
William Sandqvist [email protected]
012012012012012
012 )6,4,3,2,0(),,(
xxxxxxxxxxxxxxx
mxxxf
++++=
== ∑
This is the way to represent a function of three variables, on a 3D cube with Gray-coded corners.
Ex. 3.4 minimization with cube
William Sandqvist [email protected]
A surface is represented by a variable, a side of a product term with two variables, and a corner a minterm with three variables. Cube methods can be generalized to "Hyper Cubes" with any number of variables.
012 xxx
0x
12xx
Hypercubes
William Sandqvist [email protected]
A corner is a 0-dimension subspace, A side is a 1-dimension subspace, A surface is a 2-dimension subspace, A cube is a 3-dimension subspace …
There are minimization methods for hypercubes and they can apply for any number of variables! The methods based on hypercubes are suited to computer algorithms.
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
William Sandqvist [email protected]
And so on …
Graycode is a mirrored binarycode
One can easily construct a Gray code with an arbitrary number of bits needed for numbering the "corners" in "hypercubes" with!
How do you draw a 3D-cube?
William Sandqvist [email protected]
You draw two 2D-cubes ( = squares), and then connects their corners.
William Sandqvist [email protected]
How do you draw a 3D-cube? You draw two 2D-cubes ( = squares), and then connects their corners.
How do You draw a 4D-cube?
William Sandqvist [email protected]
You draw two 3D-cubes (=cubes), and then connects their corners.
William Sandqvist [email protected]
How do You draw a 4D-cube? You draw two 3D-cubes (=cubes), and then connects their corners.
3D-cube ⇒ 2D-map
William Sandqvist [email protected]
00
a b c
a 0 1
b c 01 11 10
Gray-code → mirror
b = 0
b = 1
000 001
100 101
011 010
111 110
Karnaugh-map
William Sandqvist [email protected]
Graphical method for minimization with "paper and pencil" minor Boolean functions? (For up to six variables)
Maurice Karnaugh
( The Map for Synthesis of Combinational Logic Circuits, AIEE, Nov. 1953 )
William Sandqvist [email protected]
A function of four variables a b c d. Truth Table with 11 ”1” and 5 ”0”. The function can be expressed in SoP-form with 11 minterms or in PoS-form with 5 maxterms.
William Sandqvist [email protected]
4D-cube ⇒ 2D-map The Karnaugh map is the truth table lined up in a different way.
The frames are ordered in such way that only one bit changes between two vertical frames or horisontal frames. This order is called Gray-code.
William Sandqvist [email protected]
Two "neighbors" The frames "5" and "13" are "neighbors" in the Karnaugh map ( but they are distant from each other in the truthtable ). They correspond to two minterms with four variables, and the figure shows how, with Boolean algebra, they can be reduced to one term with three variables.
What the two frames have in common is that b = 1, c = 0 and d = 1; and the reduced term expresses just that.
Everywhere in the Karnaugh map where one can find two ones that are "neighbors" (vertically or horizontally) the minterms could be reduced to "what they have in common". This is called a grouping.
dcb
William Sandqvist [email protected]
Four "neighbors" Frames "1" "3" "5" "7" is a group of four frames with "1" that are "neighbors" to each other. Here too, the four minterms could be reduced to a term that expresses what is common for the frames, namely that a = 0 and d = 1. Everywhere in Karnaugh map where one can find such groups of four ones such simplifications can be done, grouping of four.
da
William Sandqvist [email protected]
Eight "neighbors"
All groups of 2, 4, 8, (... 2 N ie. powers of 2) frames containing ones can be reduced to a term, with what they have in common, grouping of n.
a
William Sandqvist [email protected]
Karnaugh - toros
The Karnaugh map should be drawn on a torus (a donut). When we reach an edge, the graph continnues from the opposite side! Frame 0 is the "neighbor" with frame 2, but also the "neighbor" with frame 8 which is "neighbor" to frame 10.
db
4
12
5
13
7
15
The optimal groupings? One is looking for the bigest grouping as possible. In the example, there is a grouping with eight ones (frames 0, 1, 3, 2, 4, 5, 7, 6). Corners (0, 2, 8, 10) is a group of four ones. Two of the frames (0.10) has already been included in the first group, but it does not matter if a minterm is included multiple times. All ones in the logic function must either be in a grouping, or be included as a minterm. The "1" in frame 13 may form a group with "1" in frame 5, unfortunately there are no bigger grouping for this "1".
William Sandqvist [email protected]
dcbdbadcbaf ++=),,,(
William Sandqvist [email protected]
Grouping of "0"
The Karnaugh map is also useful for groupings of 0's. The groupings may include the same number of frames as the case of groupings of 1's. In this example, 0: s are grouped together in pairs with their "neighbors". Maxterms are simplified to what is in common for the frames.
))()((),,,( dbadcadbadcbaf ++++++=
William Sandqvist [email protected]
Maps for other number of variables
Karnaugh maps with three and two variables are also useful.
The Karnaugh map can conveniently be used for functions of up to four variables, and with a little practice up to six variables.
6
Minimization Example
William Sandqvist [email protected]
000 100
010 110
101
011 111
a
b
c 1 1
1 1 1
00 01
0
1
11 10 bc
a 001
)7,5,3,2,0(),,( ∑= mcbaf
0 1 3 2
4 5 7 6 0
2
5
3 7
Implicants
William Sandqvist [email protected]
000 100
010 110
101
011 111
a
b
c 1 1
1 1 1
00 01
0
1
11 10 bc
a
Circle the adjacent min-terms
001
)7,5,3,2,0(),,( ∑= mcbaf
Little implicant terminology
William Sandqvist [email protected]
• Implicant – a group of min-terms • Prime-implicant – a group of minterms that cant be made bigger. • Essential prime-implicant – must be included in order to cover the function. • Redundant prime-implicant – must not be included, the function can be covered by other implicants.
Implicants
William Sandqvist [email protected]
000 100
010 110
101
011 111
a
b
c
1 1
1 1 1
00 01
0
1
11 10 bc
a
Redundant implicants - not both are necessary (one of them must be in- cluded) to cover the function.
001
)7,5,3,2,0(),,( ∑= mcbafacbacaf
acbccaf
++=
++=
Minimal Sum-Product Implementation
William Sandqvist [email protected]
a b c
f
1 1
1 1 1
00 01
0
1
11 10 bc
a
)7,5,3,2,0(),,( ∑= mcbaf
acbccaf ++=
Programmable Logic Array (PLA)
William Sandqvist [email protected]
Programmable AND and OR - matrix. The programming consists of "burning fuses" to the connections you do not want. (now an obsolete technology)
Programmable Logic Array (PLA)
William Sandqvist [email protected]
The Gate-matrix has so many inputs that one use to drav the circuit in a simplified way.
Programmable Logic Array (PLA)
OR plane
AND plane
William Sandqvist [email protected]
PLA. Both AND- and OR-matrix are programable
( a flexibility that costs )
1x 2x 3x
1f 2f
1P
2P
3P
4P
Simplified drawing
Programmable Array Logic (PAL)
William Sandqvist [email protected]
1x 2x 3x
1P
2P
3P
4P
1f
2f
PAL. Only the AND-matrix is programable.
(an economic compromise)
PAL, what functions hides behind the crosses?
William Sandqvist [email protected]
1x 2x 3x
1P
2P
3P
4P
1f
2f
?
?
Sub-cube with four varibles
William Sandqvist [email protected]
1
1 1 1 1
1 1
00 01 11 10
00
01
11
10
x1x0
x3x2
We always group a full sub-cube when possibly!!!
3xf =
1
William Sandqvist [email protected]
1 1
00 01 11 10
00
01
11
10
x1x0
x3x2
0xf =
1 1 1
1 1 1
Sub-cube with four varibles
We always group a full sub-cube when possibly!!!
XOR can be helpful
William Sandqvist [email protected]
1 1 1 1 1 1
1 1
00 01 11 10
00
01
11
10
x1x0
x3x2 If two groups of four minterms can not form a group of eight, the XOR / XNOR function may be helpful.
020202 xxxxxxf ⊕=+=
This is under the assumption that there exists an efficient implementation of the XOR function.
4D the order of the Minterms ...
William Sandqvist [email protected]
0 5
3 2 7
00 01
00
01
11
10
11 10
1 4 6
MSB LSB
12 9
15 14 11
13 8 10
)14,7,3,0(),,,( 0123 ∑= mxxxxf
x1x0
x3x2
5D five variables
1
00 01 11 10
00
01
11
10
x1x0
x3x2
1
00 01 11 10
00
01
11
10
x1x0
x3x2
x4 0 1
William Sandqvist [email protected]
Same in both diagrams, independent of x4. 0123 xxxx
04 =x 14 =x
Mirroring with 5 variables
William Sandqvist [email protected]
1
110 111 101 100
1
000 001 011 010
00
01
11
10
x4x1x0
x3x2
0123 xxxx
Mirror!
And with an other order …
William Sandqvist [email protected]
110 111 101 100
1
000 001 011 010
00
01
11
10
x2x1x0
x4x3
1
0123 xxxx
Karnaugh-map with 6 variables
William Sandqvist [email protected]
x4
0 1
1
00 01 11 10
00
01
11
10
1
00 01 11 10
00
01
11
10
1
00 01 11 10
00
01
11
10
1
00 01 11 10
00
01
11
10
x3x2
x1x0
x3x2
x1x0
x3x2
x1x0
x3x2
x1x0
0
x5
1
0123 xxxx
Independent of x5 and x4.
04 =x 14 =x
05 =x
15 =x
Mirroring with 6 variables
William Sandqvist [email protected]
1
110 111 101 100
1
000 001 011 010 000
001
011
010
110
111
101
100
x4x1x0
x5x3x2
1
1
0123 xxxx
Note!
William Sandqvist [email protected]
1
110 111 101 100
1
000 001 011 010 000
001
011
010
110
111
101
100
x2x1x0
x5x4x3
1
1
0123 xxxx
And with an other order …
Groupings of 0’s
William Sandqvist [email protected]
Group the zeroes if they are fewer than the ones!
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1
00 01 11 10
00
01
11
10
x1x0
x3x2
1
{ } )( 0123
0123
xxxxdM
xxxxff
+++==
===
”0” as minterm – totaly wrong!
invert, then its correct! 0123 xxxxf =
Don’t care
William Sandqvist [email protected]
• Often you can simplify the specification of the logical function because we know that certain combinations can never occur • For these combinations, we use a value of "do not care" • There are different symbols for "do not care" in use ’d’, ’D’, ’-’, ’Φ’, ’x’
Incompletely specified functions
William Sandqvist [email protected]
x 1 x 0 x 3 x 2
0
00 01 11 10
0 0 1
1 1 0 1
d d d d
0 0 0 1
00
01
11
10
x 2 x 1
x 1 x 0
(a) SOP implementation
Two implementations of the function f ( x3,…, x0) = Σ m(2, 4, 5, 6, 10) + D(12, 13, 14, 15).
0
00 01 11 10
0 0 1
1 1 0 1
d d d d
0 0 0 1
00
01
11
10 x 2 x 1 + ( )
x 1 x 0 + ( )
(b) POS implementation
x 1 x 0 x 3 x 2
Another notation (-) …
William Sandqvist [email protected]
x 1 x 0 x 3 x 2
0
00 01 11 10
0 0 1
1 1 0 1
- - - -
0 0 0 1
00
01
11
10
x 2 x 1
x 1 x 0
(a) SOP implementation
0
00 01 11 10
0 0 1
1 1 0 1
- - - -
0 0 0 1
00
01
11
10 x 2 x 1 + ( )
x 1 x 0 + ( )
(b) POS implementation
x 1 x 0 x 3 x 2
Two implementations of the function f ( x3,…, x0) = Σ m(2, 4, 5, 6, 10) + D(12, 13, 14, 15).
Funktions with multiple outputs
William Sandqvist [email protected]
Different outputs can share prime-implicants!!!
0301 xxff +=
Do You need mere levels than two?
William Sandqvist [email protected]
One can realize any combinational circuits with two levels(AND-OR, OR-AND)
– The assumption then is that all inputs are also available in inverted form? (as in PAL, PLA)
Why multi-level logic?
William Sandqvist [email protected]
• The number of inputs in a circuit could be limited
• High fan-in leads to long delays
• It may be more cost effective to use an implementation with more levels
Two strategies for multi-level logic
William Sandqvist [email protected]
1 Factoring 2 Functional decomposition
Factoring
William Sandqvist [email protected]
f = x1x 2x3x 4 x5x6 + x1x2x 3x 4 x 5x6
We have only AND gates with a maximum of 4 inputs?
Factor the expression
)( 532532641 xxxxxxxxxf +⋅=
641 xxx
Factoring
William Sandqvist [email protected]
)( 532532641 xxxxxxxxxf +⋅=
x 6
x 4
x 1
x 5
x 2
x 3
x 2
x 3
x 5
Functional decomposition
William Sandqvist [email protected]
• You can often reduce the complexity of a logic function by reusing functions multiple times • To implement this it means to reuse a "circuit" at several points in the construction
Functional decomposition
William Sandqvist [email protected]
f = x 1x2x3 + x1x 2x3 + x1x2x4 + x 1x 2x4
Functions can be seen as composed of sub-functions.
Functional decomposition
William Sandqvist [email protected]
f = x 1x2x3 + x1x 2x3 + x1x2x4 + x 1x 2x4
= (x 1x2 + x1x 2)x3 + (x1x2 + x 1x 2)x4XOR XNOR
f = gx3 + g x4
= g = g
Can You think up this? …
Factor x3 respective x4
( XOR och XNOR )
William Sandqvist [email protected]
0 1 1 0
1 0 0 1
XOR XNOR x2 x1
0
1
0 1 x2
x1
0
1
0 1
2121 xxxx + 2121 xxxx +
XNORXOR =
With an efficient implementation of the XOR gate (with few transistors) you can see solutions in Karnaugh map even when it is not possible to make any groups!
Functional decomposition
William Sandqvist [email protected]
1 x 2
x 3 x 4
f
g
h
x
x 1
x 2
x 3
x 4
f g Implementation
2121 xxxxg +=
f = gx3 + g x4
Algorithms for minimization
William Sandqvist [email protected]
• Karnaugh minimization gives a good insight into how to minimize logic functions
• But to minimize complex functions using computer there are better algorithms
• Chapter 4.9 and 4.10 in Brown / Vranesic provides an introduction to the minimization algorithms (for the interested student)
Summary
William Sandqvist [email protected]
• Karnaugh map is a good tool for minimizing logic functions with few variables
• There are algorithms for both two-level and multi-level minimization