minimisation enel111. minimisation last lecture sum of products boolean algebra this lecture ...
TRANSCRIPT
Minimisation
ENEL111
Minimisation
Last Lecture Sum of products Boolean algebra
This Lecture Karnaugh maps Some more examples of algebra and truth tables
Karnaugh Maps
K-Maps are a convenient way to simplify Boolean Expressions.
They can be used for up to 4 or 5 variables. They are a visual representation of a truth table. Expression are most commonly expressed in
sum of products form.
Truth table to K-Map
A B P
0 0 1
0 1 1
1 0 0
1 1 1
B
A 0 1
0 1 1
1 1
minterms are represented by a 1 in the corresponding location in the K map.
The expression is:
A.B + A.B + A.B
K-Maps Adjacent 1’s can be “paired off” Any variable which is both a 1 and a zero in this
pairing can be eliminated Pairs may be adjacent horizontally or vertically
B
A 0 1
0 1 1
1 1
a pair
another pair
B is eliminated, leaving A as the term
A is eliminated, leaving B as the termThe expression
becomes A + B
Returning to our car example Two Variable K-Map
A B C P
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
A.B.C + A.B.C + A.B.C
BC
A 00 01 11 10
0 1
1 1 1
One square filled in for each minterm.Notice the code sequence:
00 01 11 10 – a Gray code.
Grouping the Pairs
BC
A 00 01 11 10
0 1
1 1 1
equates to B.C as A is eliminated.
Here, we can “wrap around” and this pair equates to A.C as B is eliminated.
Our truth table simplifies to
A.C + B.C as before.
Groups of 4
BC
A 00 01 11 10
0 1 1
1 1 1
Groups of 4 in a block can be used to eliminate two variables:
The solution is B because it is a 1 over the whole block
(vertical pairs) = BC + BC = B(C + C) = B.
Karnaugh Maps
Three Variable K-Map
Extreme ends of same row considered adjacent
A BC
00 01 11 10
0
1
A.B.C A.B.C A.B.C A.B.C
A.B.C A.B.C A.B.C A.B.C
0010A.B.C
A.B.C
A.B.C
A.B.C
Karnaugh Maps
Three Variable K-Map example
X A.B.C A.B.C A.B.CA.B.C
A BC
00 01 11 10
0
1
X =
The Block of 4, again
A BC
00 01 11 10
0 1 1
1 1 1
X = C
Returning to our car example, once more Two Variable K-Map
A B C P
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
A.B.C + A.B.C + A.B.C
AB
C 00 01 11 10
0 1 1 1
1
There is more than one way to label the axes of the K-Map, some views lead to groupings which are easier to see.
Don’t Care States Sometimes in a truth table it does not
matter if the output is a zero or a one
Traditionally marked with an x.
We can use these as 1’s if it helps.
AB
C00 01 11 10
0 1 1
1 x x 1
A B C P
0 0 0 0
0 0 1 x
0 1 0 1
0 1 1 x
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
Karnaugh Maps
Four Variable K-Map
Four corners adjacent
AB CD
00 01 11 10
00
01
11
10
A.B.C.D A.B.C.D A.B.C.D A.B.C.D
A.B.C.D A.B.C.D A.B.C.D A.B.C.D
A.B.C.D A.B.C.D A.B.C.D A.B.C.D
A.B.C.D A.B.C.D A.B.C.D A.B.C.D
A.B.C.D
A.B.C.D
A.B.C.D
A.B.C.D
Karnaugh Maps
Four Variable K-Map example F A.B.C.DA.B.C.D+A.B.C.DA.B.C.DA.B.C.DA.B.C.DA.B.C.D
AB CD
00 01 11 10
00
01
11
10
F =
AB CD
00 01 11 10
00 1 101 1 111
10 1 1
Karnaugh Maps
Four Variable K-Map solution F A.B.C.DA.B.C.D+A.B.C.DA.B.C.DA.B.C.DA.B.C.DA.B.C.D
F = B.D + A.C
1
Product-of-SumsWe have populated the maps with 1’s using sum-of-products extracted from the truth table.
We can equally well work with the 0’s
AB
C00 01 11 10
0 1 1 1
1 1
A B C P
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
AB
C00 01 11 10
0 0
1 0 0 0
P = (A + B).(A + C)
P = A.B + A.C equivalent
Inverted K Maps
In some cases a better simplification can be obtained if the inverse of the output is considered i.e. group the zeros instead of the ones particularly when the number and patterns of zeros is
simpler than the ones
Karnaugh Maps Example: Z5 of the Seven Segment Display
0 0 0 0 1
0 0 0 1 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
0 1 1 1 0
1 0 0 0 1
X1 X2 X3 X4 Z5
1 0 0 1 0
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X1 1 0 1 X1 1 1 0 X1 1 1 1 X
0
1
2
3
4
5
6
7
8
9
0 0 1 0 1X1X2
X3 X4 00 01 11 10
00
01
11
10
Z5 =
• Better to group 1’s or 0’s?
7-segment display
If there are less 1’s than 0’s it is an easier option:
X
X1X2 X3 X4 00 01 11 10
00 1 0 0 101 0 0 0 111 X X X10 1 0 X X
Changing this to 1 gives us the corner group.
Tutorial - Friday
Print out the CS1 tutorial questions from the website.
Come to see the answers worked through.