2. References
• David L. Tarnoff, Tarnoff-Tenesse (2011),"Computer
Organization and Design Fundamentals", State
University.
• D. A. Patterson and J. L. Hennessy (2017), "Computer
Organization and Design", RISC-V Edition, Elsevier.
• W. Stallings (2016), "Computer Organization and
Architecture", 10th Edition, Global Edition, England.
2
3. Course content
• Chapter 1 : Number Systems
• Chapter 2 : Logic Gates and Boolean Algebra
• Chapter3 : Combinational Logic
• Chapter 4 : Computer System Organization
• Chapter 5 : Registers and Microprocessor
3
5. Karnaugh Maps (K-Maps)
• Simplification of Boolean functions leads to simpler (and usually faster)
digital circuits.
• Algebraic procedures:
Difficult to apply.
Difficult to tell when you have arrived at a minimum solution.
• K-map is a graphical way of visualizing and then simplifying Boolean
expressions.
• A Karnaugh map provides a pictorial method of grouping together
expressions with common factors and therefore eliminating unwanted
variables.
• A Kmap is a matrix consisting of rows and columns that represent the output
values of a Boolean function.
6. Karnaugh Maps (K-Maps)
The output values placed in each cell are derived from the
minterms of a Boolean function.
We have a cell for each line for the truth table of a function.
Truth
table
7. Example
• The truth table for the function F(x,y) = xy is shown at the left
along with its corresponding Kmap (at the right).
m0
m1
m2
m3
m0
m1
m2
m3
8. Kmap Simplification rules
• Groupings can contain only 1s; no 0s.
8
•Groups may be horizontal or vertical, but not diagonal..
•Groups must contain 1, 2, 4, 8, or in general 2n cells.
9. Kmap Simplification rules
• The groups must be made as large as possible.
•Groups can overlap and wrap around the sides of the Kmap.
10. Kmap Simplification rules
•Groups may wrap around the table.
•The leftmost cell in a row may be grouped with the rightmost cell
•The top cell in a column may be grouped with the bottom cell.
11. Kmap Simplification for Two Variables
• Example1:
• Simplify the following Boolean function F(x,y)=x’y + x’y’
12. Kmap Simplification for Two Variables
• Solution
• Truth table F(x,y)=x’y + x’y’
X Y F(x,y)
0 0 1
0 1 1
1 0 0
1 1 0
Y
X
0 1
0 1 1
1 0 0
• The product of literals that remains unchanged in a single group
makes the term of the expression.
• In this example, Group corresponds to the area where X = 0 remains
unchanged.
• Solution : F(X,Y)=X’
13. Kmap Simplification for Two Variables
• Example 2:
• Simplify the following Boolean function F(x,y)=xy + x’y
14. Kmap Simplification for Two Variables
• Solution
• Truth table F(x,y)=xy + xy’
X Y F(x,y)
0 0 0
0 1 1
1 0 0
1 1 1
Y
X 0 1
0 0 1
1 0 1
• In this example, Group corresponds to the area where Y =
1 remains unchanged.
• Solution : F(X,Y)=Y
15. Kmap Simplification for Two Variables
• Example 3:
• Simplify the following Boolean function F(x,y)=x'y' + xy' + xy
16. Kmap Simplification for Two Variables
• Solution
• Truth table F(x,y)=x'y' + xy' + xy
X Y F(x,y)
0 0 1
0 1 0
1 0 1
1 1 1
Y
X 0 1
0 1 0
1 1 1
• Group1 G1 corresponds to the area where Y = 0 remains
unchanged.
• Group2 G2 corresponds to the area where X = 1 remains
unchanged.
• Solution : F(X,Y)=X+Y’
G1
G2
17. Kmap Simplification for Two Variables
• Example 4:
• Simplify the following Boolean function F(x,y)=xy + x'y + xy' + x'y'
18. Y
X 0 1
0 1 1
1 1 1
Kmap Simplification for Two Variables
• Solution
• Truth table F(x,y)=xy + x'y + xy' +
x'y'
X Y F(x,y)
0 0 1
0 1 1
1 0 1
1 1 1
• Solution : F(X,Y)=1
19. Kmap Simplification for Three Variables
• The first row of the Kmap contains all minterms where x has
a value of zero.
• The first column contains all minterms where y and z both
have a value of zero.
19
X Y Z F(X,Y,Z)
0 0 0 m0
0 0 1 m1
0 1 0 m2
0 1 1 m3
1 0 0 m4
1 0 1 m5
1 1 0 m6
1 1 1 m7
YZ
X
00 01 11 10
0 m0 m1 m3 m2
1 m4 m5 m7 m6
0 1 3 2
4 5 7 6
P.S
• Cell 0 and Cell 2 are adjacent
• Cell 4 and Cell 6 are adjacent
20. Kmap Simplification for Three Variables
• Example1:
• Simplify the following Boolean function F(x,y,z) = ∑(3,4,6,7)
21. Kmap Simplification for Three Variables
• Solution
• Truth table function F(x,y,z) = ∑(3,4,6,7)
• G1 corresponds to the area where Y = 1 and Z=1 remain unchanged.
• G2 corresponds to the area where X=1 and Z = 0 remain
unchanged.
• Solution : F(X,Y, Z)=YZ+XZ’
YZ
X
00 01 11 10
0 0 0 1 0
1 1 0 1 1
0 1 3 2
4 5 7 6
G1
G2
Group G1 is composed by cell 3 and cell 7
Group G2 is composed by cell 4 and cell 6
22. Kmap Simplification for Three Variables
• Example2:
• Simplify the following Boolean function F(x,y,z) = ∑(0,1,2,4,5,6)
23. Kmap Simplification for Three Variables
• Solution
• Truth table function F(x,y,z) = ∑(0,1,2,4,5,6)
• G1 corresponds to the area where Y = 0 remains unchanged.
• G2 corresponds to the area where Z = 0 remains unchanged.
• Solution : F(X,Y, Z)=Y’+Z’
YZ
X 00 01 11 10
0 1 1 0 1
1 1 1 0 1
0 1 3 2
4 5 7 6
Group G1 is composed by cells 0,1,4 and 5
Group G2 is composed by cells 0,4, 2 and 6
G2
24. Kmap Simplification for Three Variables
• Given the Boolean function
▫ F(A,B,C) = A'C + A'B + AB'C + BC
• Express it in sum of minterms
• Find the minimal sum of products expression
25. Kmap Simplification for Three Variables
• Given the Boolean function
▫ F(A,B,C) = A'C + A'B + AB'C + BC
• Express it in sum of minterms
• F(A,B,C)=A'C + A'B + AB'C + BC
• =A’C(B+B’)+A’B(C+C’)+AB’C+BC(A’+A)
• =A’BC+A’CB’+A’BC+A’BC’+AB’C+A’BC+ABC
• =A’BC+A’B’C+A’BC’+AB’C+ABC
26. Kmap Simplification for Three Variables
• Solution
▫ F(A,B, C) = A'C + A'B + AB'C + BC = ∑(1,2,3,5, 7)
• G1 corresponds to the area where C = 1 remains unchanged.
• G2 corresponds to the area where A = 0 and B=1 remain
unchanged.
• Solution : F(A,B, C)=A’B+C
BC
A 00 01 11 10
0 0 1 1 1
1 0 1 1 0
0 1 3 2
4 5 7 6
Group G1 is composed by cells 1,3,5 and 7
Group G2 is composed by cells 3 and 2
28. Kmap Simplification for four Variables
• Example1:
• Simplify the following Boolean function
• F(w,x,y,z) = ∑(0,1,2,4,5,6,8,9,12,13,14)
29. Kmap Simplification for four Variables
• F(w,x,y,z) = ∑(0,1,2,4,5,6,8,9,12,13,14)
• Solution
• F(w,x,y,z) =Y’+W’Z’+XZ’
30. Kmap Simplification for four Variables
• Example2:
• Simplify the following Boolean function
• F(w,x,y,z) = ∑(0,2,3,5,7,8,9,10,11,13,15)
31. Don’t Care Conditions
• Real circuits don’t always need to have an output defined for
every possible input.
• If a circuit is designed so that a particular set of inputs can
never happen, we call this set of inputs a don’t care condition.
• They are very helpful to us in Kmap circuit simplification.
31
32. Don’t Care Conditions
• In a Kmap, a don’t care condition is identified by an X in the
cell of the minterm(s) for the don’t care inputs, as shown
below.
• In performing the simplification, we are free to include or
ignore the X’s when creating our groups.
32
33. 3A.6 Don’t Care Conditions
• In one grouping in the Kmap below, we have the
function:
33
35. Don’t Care Conditions
• The truth table of:
differs from the truth table of:
• However, the values for which they differ, are the
inputs for which we have don’t care conditions.
35