Eact and heuristic minimization of Boolean functions Quine a McCluskey Method a) Generation of all prime implicants b) Selection of a minimum subset of prime implicants, which will represent the original function (cover) Espresso Method Combines many of the best heuristic algorithms Uses iterative improvement strategy Z
Algorithms used in ESRESSO F,D Complement Epand he algorithms are fully detailed in: Essential primes rredundant-cover Reduce Last-gasp F M Z ESRESSO is available as a public domain software 2
Modified Epansion Method Joins ideas of Quine McCluskey as well as Espresso method: a) Generation of prime implicants (from Espresso) b) Selection of prime implicants (from Quine McCluskey) he method has been implemented in program ANDOR which is available on www.zpt.tele.pw.edu.pl Navigate to SOFARE and then to ANDOR Z 3
Basic notions A cube is a row vector, which entries take values,,. he entry in the cube is referred to as input don t care. K ( ), means the set of binary vectors (minterms): A cube represents product of literals: K 3 Z 4
Notations For boolean function f, we define: the on-set f ON, the set of input values such that f(), the off-set f OFF, the set of input values such that f(), and the don t care-set f DC, the set of input values such that f(). he on-set f ON,off-setf OFF, and don t care-set f DC are also denoted as F, R, and D, respectively. hen f (F, R) Z 5
6 Z Eample (EXL) k 5 k 4 k 3 k 2 k f 7 6 5 4 3 2 F R
Epand Epand Ekspansja is the procedure which epands a cube k F, into a prime implicant, in such a way that the prime cube d be as large as possible i.e. with the largest number of entries equal to. he EXAND strategy is guided by a blocking matri, B. Z 7
Blocking matri he blocking matri B(k,R) is a binary matri determined by the cube k to be epanded and by R, the cover of the off-set. he elements of B(k,R) [b ij ], are defined as follows: b ij, if k j and r ij or k j and r ij ; b ij, otherwise. he blocking matri for a given k F arises from matri R by complementation the columns of R, which entries are indicated by entries equal to in the cube k. Z 8
9 Z Creating a blocking matri F R B Having matrices F and R we create blocking matri determined by the cube k (the first row of F : As k (), to create B it is enough to invert the second, fifth and the seventh column of matri R. hus B(k,R):
Column cover he set L (L {,...,n}) columns of B is said a column cover if for each row i there eists column j L, such that b ij. Each row must have a in at least one of the columns which correspond to minimal column cover. he set L is a minimum column cover of B, if there does not eist the set L (forming the column cover) such, that L L. Column cover is a general notion with wide applications in many other problems. Z
Z Finding a minimal column cover L {2,3,6} the minimal column cover. 7 6 5 4 3 2 B L {4,7} the minimal column cover. L {2,3} no, L {2,6} no, L {3,6} no. Loking at the matri B we can guess some covers
Finding a minimal column cover B 2 3 4 5 6 7 {L 6, L 7 } {L 3, L 4 } {L 2, L 4 } {L 2, L 3, L 7 } (L 6 + L 7 ) (L 3 + L 4 ) (L 2 + L 4 ) (L 2 + L 3 + L 7 ) (L 4 + L 2 )(L 4 + L 3 )( L 7 + L 6 )(L 7 + L 2 + L 3 ) (L 4 + L 2 L 3 )(L 7 + L 6 (L 2 + L 3 )) (L 4 + L 2 L 3 )(L 7 + L 2 L 6 + L 3 L 6 ) L 4 L 7 + L 2 L 4 L 6 + L 3 L 4 L 6 + L 2 L 3 L 7 + L 2 L 3 L 6 + L 2 L 3 L 6 Z 2
Generation of prime implicants he blocking matri B(k,R) allows finding epanded cube denoted k + (L,k) as follows: all entries of k belonging to L are not subject of changing, whereas entries beyond the set L take the value. k + j ( L, k) k j, if he epanded cube k is an implicant of function f (F,R). j L, otherwise. f L is a minimum column-cover of B(k,R), then k + (L,k) is a largest prime implicant of f (F,R) containing k., Z 3
4 Z Given k 2 () and matri B 7 6 5 4 3 2 set L {4,7} is a minimum column cover of B, so 4 7 6 3 2 hereas for L {2,3,6} (another column cover), k + (L,k) ( ) k 2 () thus an implicant of F is k + (L, k 2 ) ( ), Generation of prime implicants - eample
Set of prime implicants Epanding the input minterms one after the other we obtain the following set of prime implicants: k k 2 2 3 4 2 4 2 7 3 6 6 5 6 5 6 7 7 3 6 k 3 k 4 the same as 3 k 5 Z Having a list of prime implicants F we can apply the net step i.e. selection of a minimal subset of them to cover all the s of the function. 5
but before an auiliary notion Cube c covers cube d (c d) if for each i such that c i or c i, the corresponding d i c i. ( ) ( ) ( ) ( ) Z 6
rime implicant table Recall the set of primary minterms 2 3 k 7 k 2 k 3 k 4 k 5 4 5 6 2 26 3 4 7 ( ) ( ) k ( ) k k, k 5,k, k 2 3 4 k 2 k k k 3 k 4 k 5 Z 7
rime implicant table 2 3 2 4 6 7 ( ) k ( ) k,k 5 ( ) k,k 2 3,k 4 Each entry is a bit that is if the prime implicant for that column covers the minterm for that row, otherwise the entry is. 2 3 k 7 k 2 k 3 k 4 k 5 4 5 6 Z 8
Selection of prime implicants Column cover 2 3 4 5 6 7 k k 2 k 3 k 4 k 5 Other description:, 2 3, 4 3, 5, 6, 7 3 2, 7 2 2 6 3 4 7, 2 2, 7 Minimal cover: 2, 3 Minimal epression: 47 + 26 Z 9
ANDOR he method has been implemented in program ANDOR which is available on www.zpt.tele.pw.edu.pl Navigate to SOFARE and then to ANDOR Z 2