Download presentation
Presentation is loading. Please wait.
Published byConstance Richardson Modified over 6 years ago
1
Karnaugh Maps References: Lecture 4 from last semester
Chapt. 1 in Computer Systems (Carpinelli)
2
Expressing truth tables
Every truth table can be expressed in terms of the basic Boolean operators AND, OR and NOT operators. The circuits corresponding to those truth tables can be build using AND, OR and NOT gates, which can be made out of transistors. The input in each line of a truth table can be expressed in terms of AND’s and NOT’s
3
Line by Line Inputs Expression A B A´B´ 1 A´B AB´ AB
(Not A) AND (NOT B) A´B´ A´B´ is true for the first line and false for the rest 1 (Not A) AND B A´B A´B is true for the second line and false for the rest A AND (NOT B) AB´ AB´ is true for the third line and false for the rest A AND B AB A´B´ is true for the fourth line and false for the rest This is not yet a truth table. It has no outputs.
4
Algebra Gate A’ means NOT A
5
Algebra Gates AB means A AND B
6
Algebra Gates A+B means A OR B
7
It’s true; it’s true To express a truth table, take the input lines that correspond to true (high, 1) outputs. Write the expressions for each of those input lines (as shown on the previous slide). Then feed all of those expressions into an OR gate.
8
A Trivial Example A B C Out 1 A’BC’ A’BC ABC’ ABC
9
Simplifying a trivial example
A´BC´ + A´BC + ABC´ + ABC A´B (C´ + C) + AB (C´ + C) A´B + AB (A´ + A) B B C+C’ means C OR (NOT C) In other words, we don’t care about C
10
Majority Rules Example
B C Majority 1
11
Row Expressions A B C Row expressions A’B’C’ 1 A’B’C A’BC’ A’BC AB’C’
A’B’C’ 1 A’B’C A’BC’ A’BC AB’C’ AB’C ABC’ ABC
12
Majority rules without simplification
A´BC + AB´C + ABC´ + ABC NOTs OR ANDs
13
Boolean algebra is different from regular algebra
AB + AB = AB (A AND B) OR (A AND B) OR should give one a choice but in this case there’s no choice
14
Majority Rules Simplification
A´BC + AB´C + ABC´ + ABC A´BC+AB´C+ABC´+ABC+ABC+ABC A´BC+ABC+AB´C+ABC+ABC´+ABC (A´+A)BC+A(B´+B)C+AB(C´+C) BC+AC+AB
15
Majority rules without simplification
16
Majority Rules Comparison
17
Simplifying made easy Simplifying Boolean expressions is not always easy So we introduce next a method (a Karnaugh or K map) that is supposed to make simplification more visual The first step is to rearrange the inputs in what is called “gray code” order
18
Gray code In addition to binary numbers, there is another way of representing numbers using 1’s and 0’s. It is not useful for doing arithmetic, but has other purposes. In gray code the numbers are ordered such that consecutive numbers differ by one bit only.
19
Gray code (Cont.) 1 Each row different by one bit only
20
Constructing Gray code
1
21
Reflect lower bits and 0’s then 1’s in front
1 Add 0’s Reflect lower bits through red line Add 1’s
22
Reflect lower bits and 0’s then 1’s in front (again)
1 Add 0’s Reflect lower bits through red line Add 1’s
23
An important property In gray-code order, two consecutive rows of a truth table differ by one bit only. Thus if a truth table is put in gray code order and if two consecutive rows contain a 1, then a simplification of the Boolean expression is possible.
24
Trivial Example in Gray code
B C Out 1
25
Improving Some combinations that differ only by a single bit are not in consecutive rows. Thus we might miss such a simplification. So we put some of the inputs in as columns.
26
Two rows that differ by one bit but are not consecutive
Out 1
27
A row-column version A B\C 1 Place the C inputs across the top.
All inputs are filled in with light blue. In this version, more inputs differing by one bit only are in adjacent positions. A B\C 1
28
Karnaugh-map This way of arranging truth tables combined with the rules for simplifying Boolean expressions goes by the name Karnaugh map or K map.
29
The rules Put the truth table into a form with inputs in gray code order. Then one identifies output “blocks” (as large as possible). A block must be a rectangle containing 1’s and only 1’s. The simplification rules require that the number of 1’s in a block should be a power of 2 (1, 2, 4, 8, …). However, a given output 1 can belong to more than one block.
30
Wrapping There are still cases in which inputs differing by only one bit are not adjacent (eg. the first and last row). Imagine that the rows wrap around, so for instance, a block can include the top and bottom rows (without intermediate rows) Similarly for columns.
31
W X Y Z Output 1 Karnaugh Example
32
Karnaugh Example (Unsimplified Boolean algebra expression)
WXY’Z W’XY’Z + WX’Y’Z’ + W’X’Y’Z’ + WXYZ’ WXY’Z’ + W’XY’Z’ + W’XYZ’
33
Example in Karnaugh (identifying block in gray code truth table)
Z 1 W X\Y W’X’Y’Z’ W’XY’Z’ W’XY’Z W’XYZ’ WXY’Z’ WXY’Z WXYZ’ WX’Y’Z’
34
Result Y’Z’ + XY’ + X Z’ A block of size two eliminates one Boolean variable; a block of four eliminates two Boolean variables; and so on. To find the expression for a block, identify the inputs for that block that don’t change, AND them together, that’s your expression for the block. Obtain an expression for each block and OR them together. Every 1 must belong to at least one block (even if it is a block onto itself).
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.