Karnaugh Mapping
- Karnaugh mapping is an easy-to-use graphical method of simplifying Boolean expressions.
- Consider the following truth table and its corresponding Karnaugh map (K-Map)

- The K-Map consists of one square for each possible minterm in a function.
- Therefore, a two-variable map has squares, a three-variable map has squares, and a four-variable map has squares.
Warning
An important rule for constructing a K-Map: each row and column in the K-map should be arranged as a Gray code sequence!
Basic Structure of K-Maps

Minimum SOP Expression using K-Map
- Start with a truth table or a Boolean expression in SOP form.
- Convert into a Karnaugh map.
- Form groups around adjacent 1’s according to K-map rules
- Simplify each group by removing literals appear in both complemented and uncomplemented forms
- OR the remaining terms back together
Rules for Grouping in K-Maps
- The number of 1’s in each group must be a power of two (i.e. 1, 2, 4, 8, 16, etc. squares).
- Only side-adjacent 1’s can be grouped together into squares or rectangles (i.e. no diagonals).
- Enlarge each group as much as possible while reducing the total number of groups.
- Partial overlapping of groups is permitted, but no group should be entirely inside another group(s).
- All 1’s have to be included in at least one group.
Don’t ignore any 1’s, even if by itself. - K-map can be considered as wrapped in a cylinder (i.e. top and bottom, left and right edges are connected).
Example of Five-Variable K-Map
#NotOnTheExam
- It is also possible to a five-variable (or more) problem.In this case, the Karnaugh map would consist of multiple layers of four-variable K-maps stacked on top of each other.
- The same rules for grouping adjacent squares and determining minimum SOP expression are applied, with additional consideration that of multi-layer groups.

Minimum POS Expression using K-Map
- Construct a Karnaugh map of the complement of the function
- Find the minimum SOP expression (using K-map) of the complement of the function
- Apply the involution law and De Morgan’s Theorem to the complement of the function to obtain the POS form of the original function.
อันนี้ทำคล้าย ๆ เดิม ก็ใส่ 1 ในช่องที่ปกติใส่ 0 อะ แล้วก็ใช้ K-Map grouping ให้ถูกต้อง แล้วออกมาจะได้เป็น ก็อย่าลืมว่าต้องเปลี่ยนเป็น ธรรมดาก่อน ใช้ Involution & De Morgan’s ตามนั้น
**ออกสอบแน่ ๆ อย่าลืมล่ะ

K-Maps with Don’t Care Conditions
- In some systems, the value of the output is specified for only some of the input conditions. For the remaining input combinations, it does not matter what the output is (i.e. we don’t care!).
- In a truth table, don’t care conditions are indicated by an .

- When we design such a system, we can make the output either 0 or 1 for each minterm corresponding to a don’t care condition.
- This allows us to choose the implementation that is least costly (i.e. simplest).
Make Sense มาก ๆ ถ้ามี Output นึงเป็นผลลัพท์ที่เราไม่ได้สนใจว่าจะเป็นไร จะเป็น 0 จะเป็น 1 เราก็ไม่ได้สนใจ แล้วจะไปให้ค่าทำไม ก็ใส่ (Don’t care) ไปเลย! เวลาเรา Build circuit ก็จะได้เสียเงินน้อยลง ไม่ต้องไปคำนึงถึงทุก Output!
Important
Can you make that group larger by using don’t cares?
We can choose whether or not to include the don’t care squares in our groups, as long as each group is as large as possible and the number of groups is as few as possible.
- Don’t care จะอยู่ที่เดิมนะ ไม่ว่าจะทำ SOP/POS Form