SOP Bit Representation

advertisement
MVI Function Review
• Input X is p-valued variable. Each Input can have Value in Set {0, 1,
2, ..., pi-1}
•
F :{0,1,..., pi 1}  {0,1, X }
literal over X corresponds to subset of values of S  {0, 1, ... , p-1}
denoted by XS or X{j} where j is the logic value
• Empty Literal: X{}
• Full Literal has Values S={0, 1, 2, …, p-1}
X{0,1,…,p-1} Equivalent to Don’t Care
SOP Bit Representation
X1
X2 X3
01 – 012 – 0123
11 – 100 – 1000
11 – 010 – 0101
11 – 001 – 0010
01 – 110 – 0001
c = X1S1 X2S2
. . .
XnSn , Si  Pi
Cube in an n-dimensional hyper-cube
Cofactor
for MV
Restriction (Cofactor) Operation
in MV cube calculus
Restriction of Two-Valued Output Function F obtained by restricting Domain
to D, denoted by F(|D)
For SOP, the restriction is defined as follows:
Let F be a SOP, and c = X1S1 X2S2 . . . XnSn be a product. Then, the restriction
F(|c) of F to c is obtained as follows:
(1) For each product term in F, make a logical product with c. Delete the
zero terms.
(2) Let d = X1T1 X2T2 . . . XnTn be a product obtained in (1). Replace d with
X1(T1 S1) X2(T2 S2) . . . Xn(Tn Sn)
Procedure for Finding F(|c)
F=
11 – 100 – 1000
11 – 010 – 0101
11 – 001 – 0010
01 – 110 – 0001
c = (01-101-1111)
Step 1: Bit-wise AND each product term in F with c
F c =
01 – 100 – 1000
01 – 001 – 0010
01 – 100 – 0001
Step 2: Bit-wise OR each product term in F  c with c
F(|c) =
11 – 110 – 1000
11 – 011 – 0010
11 – 110 – 0001
Students: check this in
maps and equations
Cofactor Concept
By Shannon’s Expansion
f (x1, x2 , . . , xn ) = x1 f (0, x2 , . . , xn ) + x1 f (1, x2 , . . , xn )
F(|c0)
F(|c1)
Where c0 and c1 are cubes with x1 =0 and x1 =1,
x y z
respectively.
01 – 01 – 11
Example: f = xy + yz + zx
F = 11 – 01 – 01
f (0,y,z)
f (1,y,z)
c0= (10-11-11)
c1= (01-11-11)
F c0 = [10- 01- 01]
01 – 01 – 11
F(|c0) = [11- 01- 01] F c1= 01 – 01 – 01
01 – 11 – 01
01 – 11 – 01
F(|c1) =
11 – 01 – 11
11 – 01 – 01
11 – 11 – 01
Students: check this in
maps and equations
Tautology
for MV
Tautology for MV
When the logical expression F is equal to logical 1
for all the input combinations, F is a tautology.
Tautology Decision Problem - determining if logical
expression is or is not a tautology
Example:
F1 =
No
Yes
01 – 100 – 1100
11 – 111 – 0010
Can confirm
with K-Maps
Y
0
1
2
0
1
2
F2 =
Z
0 1 2 3
X=0
X=1
11 – 110 – 1110
11 – 110 – 0001
11 – 001 – 1111
Inclusion Relation for MV
Let F and G be logic functions. For all the
minterms c such that F(c) = 1 , if G(c) = 1, then F 
G , and G contains F. If F contains a product c then
c is an implicant of F.
Example:
F=
c1= (01- 100 - 1001)
F(|c1) =
11 – 111 – 1110
11 – 111 – 0111
F(|c1)  1, c1  F
11 – 100 – 1000
11 – 010 – 0101
11 – 001 – 0010
01 – 110 – 0001
c2= (11- 010 - 1101)
F(|c2) =
11 – 111 – 0111
01 – 111 – 0011
F(|c2)  1, c2  F
Equivalence Relation
Let
f
p
F=
i=1
g
q
j
and G =
j=1
j
then
F  G  F(|gj) 1 (j = 1, . . , q) and G(|fj) 1 (i = 1, . . , p)
Example: F = xy + y and G = x + xy
F(|x)  1, F(|xy)  1, G(|xy)  1, and G(|y)  1,
Thus F  G
Divide and
Conquer
Method
Divide and Conquer Method
Let F be a SOP and ci (i = 1, 2,. . , k) be the cubes satisfying
the following conditions:
F=
 c  1 and c  c
k
i
i
j
= 0 (i  j ).
i=1
Then, can partition SOP into k SOPs
 c  F(|c )
k
F=
i
i
i=1
Operations can be done on each F(|ci) independently and
then combined to get result on F
This was already illustrated graphically to
check SAT, TAUTOLOGY and other
similar
Divide and Conquer Method
Let t(F) be the number of products in an SOP F.
We can use Divide and Conquer Theorem to
minimize
k
 t(F(|ci) )
i=1
and thus the number of products.
Partition Example:
k = 2, c1 = XjSA , c2 = XjSB
SA  SB = Pj and SA  SB = 
Divide and Conquer Method
Using Divide and Conquer we use the recursive
application of the restriction operation to attempt
to get columns of all 0’s or 1’s (they can be
ignored). A column with both 0 and 1 is active.
Selection Method:
1.
Chose all the variables with the maximum
number of active columns 1
2.
Among the variables chosen in step 1, choose
variables where the total sum of 0’s in the array is
maximum
3.
For all variables in step 2, find a column that has
the maximum number of 0’s and from among them
choose the one with the minimum number of 0’s
Divide and Conquer Method
Example:
F=
X1
X2
X3
11 – 100 – 1000
11 – 010 – 0100
11 – 001 – 0010
01 – 110 – 0001
We split with respect
to some values, like
cutting a KMAP in our
previous examples
X2 and X3 have the largest number of active columns.
Choose X3 and let SA = {0,1} and SB = {2,3}
c1= (11- 111 - 1100)
F(|c1) =
11 – 100 – 1011
11 – 010 – 0111
c2= (11- 111 - 0011)
F(|c2) =
11 – 001 – 1110
01 – 110 – 1101
Complementation
of SOPS
Complementation of SOPS
Let
 c  1 and c  c
k
F=
i
i
j
i=1
Then, the complement of F is
 c  F(|c )
k
F=
i=1
i
i
= 0 (i  j ).
Algorithm for Complementation
of SOPS
1. F consist of one product c
F = X1S1 X2S2
. . .
XnSn
Then
F = X1S1 + X1S1  X2S2 + .
S
S
S
S
. . + X1 1  X2 2 . . . Xn-1 n-1  Xn n
2. F consist of more than one product
Expand F into F = c1  F(|c1) + c2  F(|c2) , where
c1 = XjSA , c2 = XjS , SA  SB = Pj and SA  SB = 
F = c1  F(|c1) + c2  F(|c2)
Complementation of SOPS
Example
F=
X1
X2
X3
11 – 100 – 1000
11 – 010 – 0100
11 – 001 – 0011
01 – 110 – 0001
1. Expand F w.r.t. X3 and let SA = {0,1} and SB = {2,3}
c1= (11- 111 - 1100)
F1= F(|c1) =
11 – 100 – 1011
11 – 010 – 0111
c2= (11- 111 - 0011)
F2= F(|c2) =
11 – 001 – 1111
01 – 110 – 1101
Complementation of SOPS
Example (Continued)
F1= F(|c1) =
11 – 100 – 1011
11 – 010 – 0111
2. Next, expand F1 variable X2 , F1 = c3  F1 (|c3) + c4  F1 (|c4)
c3= (11- 100 - 1111)
F3= F(|c3) =
11 – 111 – 1011
c4= (11- 011 - 1111)
F4= F(|c4) =
11 – 110 – 0111
Complementation of SOPS
Example (Continued)
F2= F(|c2) =
11 – 001 – 1111
01 – 110 – 1101
3. Next, expand F2 variable X2 , F2 = c5  F2 (|c5) + c6  F2 (|c6)
c5= (11- 110 - 1111)
F5= F(|c5) =
01 – 111 – 1101
c6= (11- 001 - 1111)
F6= F(|c6) =
11 – 111 – 1111
Complementation of SOPS
Example (Continued)
F3= 11 – 111 – 1011
F4= 11 – 110 – 0111
F5= 01 – 111 – 1101
F6= 11 – 111 – 1111
4. F3 through F6 are single products so we apply
alg. Step 1.
F3= 11 – 111 – 0100
F4=
11 – 001 – 1111
11 – 110 – 1000
F5=
10 – 111 – 1111
01 – 111 - 0010
F6= 0
Complementation of SOPS
Example (Completed)
5. Combining all the products gives:
F = c1F1 + c2F2 = c1(c3F3 + c4F4 ) + c2 (c5F5 + c6F6 )
= c1c3F3 + c1c4F4 + c2 c5F5 + c2 c6F6
F=
11 – 100 – 0100
11 – 001 – 1100
11 – 010 – 1000
10 – 110 – 0011
01 – 110 - 0010
Problems to remember and solve
1.
2.
3.
4.
5.
6.
7.
Multi-output Multi-valued prime implicants
Covering for MV functions.
Cofactors of MV functions.
Visualization of MV functions
Complementation of MV functions.
Decision trees and Decision Diagrams for MV functions
Cube Calculus operations and Algorithms for MV functions.
Download