06 Karnaugh
06 Karnaugh
Logistics
TA Office Hour today 3:30 in EEB 003
Monday holiday
Last lecture
NAND and NOR and pushing bubbles
Logic simplification: Visualization techniques
Boolean cubes
Today’s lecture
Logic simplification: Visualization techniques
Karnaugh maps (K-maps)
K-maps with “don’t cares”
CSE370, Lecture 6 1
The “WHY” slide
A B C D (A'+A)BC
0 0 0 0 111
0 0 1 0
0 1 0 0
0 1 1 1 A(B+B')(C+C ‘)
B 101
Cin
1 0 0 1
1 0 1 1 000 A
1 1 0 1
1 1 1 1
D = BC+A
CSE370, Lecture 6 3
Karnaugh maps (K-map)
CSE370, Lecture 6 4
K-map minimization example: 2
variables
A B F
A
0 0 0 1 B 0 1
1 0 1 0 0 1 1 F = B'
0 2
2 1 0 1
1 0 0
3 1 1 0 1 3
CSE370, Lecture 6 5
2, 3, and 4 dimensional K-maps
AB A
A A CD 00 01 11 10
A AB
0 1 00
B C 00 01 11 10 0 4 12 8
0 0 01
0 2 0 2 6 4 1 5 13 9 D
B 1 1
C 1 11
3 1 3 7 5 3 7 15 11
C
B 10
2 6 14 10
CSE370, Lecture 6 6
Adjacencies
Wrap–around at edges
First column to last column
Top row to bottom row
AB A 011 111
C 00 01 11 10
010
0 000 010 110 100
0 2 6 4 001
B C 101
C 1 001 011 111 101
1 3 7 5
000 A 100
B
CSE370, Lecture 6 7
K-map minimization example: 3
variables
ind the least number of subcubes, each as large as possible, that cover the ON-s
Make sure subcubes contain 1, 2, 4, or 8 items (remember the Boolean cube)
A B Cin Cout
0 0 0 0 A
0 0 1 0 AB
0 1 0 0 Cin 00 01 11 10
0 1 1 1 0 0 0 1 0 Cout = AB + BCin + ACin
0 2 6 4
1 0 0 0 1 0 1 1 1
1 0 1 1 1 3 7 5
1 1 0 1 B
1 1 1 1 111
B
Cin
101
000 A
CSE370, Lecture 6 8
One more example: 3 variables
ind the least number of subcubes, each as large as possible, that cover the ON-s
Make sure subcubes contain 1, 2, 4, or 8 items (remember the Boolean cube)
A B C D
0 0 0 0 A
0 0 1 0 AB
0 1 0 0 C 00 01 11 10
0 1 1 1 0 0 0 1 1 D = A + BC
0 2 6 4
1 0 0 1 1
1 0 1 1 1
0 3
1 7
1 5
1
1 1 0 1 B 111
1 1 1 1
B 101
Cin
000 A
CSE370, Lecture 6 9
K-map minimization example:
minterms
AB A
C 00 01 11 10
F(A,B,C) = m(0,4,5,7) 0 1 0 0 1
0 2 6 4
= B'C'+AC
1 0 0 1 1
1 3 7 5
CSE370, Lecture 6 10
K-map minimization example:
complement
AB A
F(A,B,C) = m(0,4,5,7)
C 00 01 11 10 = B'C'+AC
0 1 0 0 1
0 2 6 4
1 0 0 1 1 F'(A,B,C) = m(1,2,3,6)
1 3 7 5
= A’C + BC’
B
CSE370, Lecture 6 11
K-map minimization example: 4
variables
Minimize F(A,B,C,D) =
m(0,2,3,5,6,7,8,10,11,14,15)
Answer: F = C+A'BD+B'D'
AB A
CD 00 01 11 10 0111 1111
00 1 0 0 1
0 4 12 8
01 0 1 0 0
1 5 13 9 D C D
A
11 1 1 1 1 1000
C 3 7 15 11 0000 B
10 1 1 1 1
2 6 14 10
B
nd the least number of subcubes, each as large as possible, that cover the ON-se
CSE370, Lecture 6 12
K-map minimization examples: on
whiteboard
F(A,B,C,D) =
F(A,B,C) = m(0,3,6,7) m(0,3,7,8,11,15)
F(A,B,C,D) =
F(A,B,C) =
F’(A,B,C,D) =
F'(A,B,C) =
AB
CD 00 01 11 10
00
AB 01
C 00 01 11 10
0 11
1 10
CSE370, Lecture 6 13
How about Karnaugh Maps, 6 dimensions?
CD
K-maps become CD
EF 00 01 11 10
3D for 5 & 6 EF 00 01 11 10
variables 00 1 0 0 0
00 0 0 0 0
01 0 0 1 1
01 0 0 1 1
AB = 00 AB = 01
11 1 0 1 1
11 0 0 1 1
10 1 0 0 0
10 0 0 0 0
CD CD
EF 00 01 11 10 EF 00 01 11 10
00 0 0 0 0 00 0 0 0 0
OUTPUT =
A’BC’D’F’ + 01 0 0 1 1 01 0 0 1 1
AB = 11 AB = 10
CF + BC’D’E 11 1 0 1 1 11 0 0 1 1
10 1 0 0 0 10 0 0 0 0
CSE370, Lecture 6 14
Incompletely specified functions: Don’t
cares
Functions of n inputs have 2n possible
configurations
Some combinations may be unused
Call unused combinations “don’t cares”
Exploit don’t cares during logic minimization
Don’t care no output
Example: A BCD increment-by-1
Function F computes the next number in a BCD
sequence
If the input is 00102, the output is 00112
BCD encodes decimal digits 0–9 as 00002–10012
Don’t care about binary numbers 10102–11112
CSE370, Lecture 6 15
Truth table for a BCD increment-by-1
INPUTS OUTPUTS
A B C D W X Y Z off-set for W: m0–m6, m9
0 0 0 0 0 0 0 1
0 0 0 1 0 0 1 0
0 0 1 0 0 0 1 1
0 0 1 1 0 1 0 0
0 1 0 0 0 1 0 1
0 1 0 1 0 1 1 0 on-set for W: m7 and m8
0 1 1 0 0 1 1 1
0 1 1 1 1 0 0 0
1 0 0 0 1 0 0 1
1 0 0 1 0 0 0 0
1 0 1 0 X X X X
1 0 1 1 X X X X Don't care set for W:
1 1 0 0 X X X X We don't care
1 1 0 1 X X X X about the output values
1 1 1 0 X X X X
1 1 1 1 X X X X
CSE370, Lecture 6 16
Notation
CSE370, Lecture 6 17
Example: with don’t cares
A
AB
CD 00 01 11 10
00 0 0 X 0 Assign X == "1"
allows a 2-cube rather than a 1-cube
01 1 1 X 1
D
11 1 1 0 0
C
10 0 X 0 0
B
CSE370, Lecture 6 18