Karnaugh Maps References:

Slides:



Advertisements
Similar presentations
Prof. Sin-Min Lee Department of Computer Science
Advertisements

ECE 238L Computer Logic Design Spring 2010
ECE 301 – Digital Electronics Karnaugh Maps (Lecture #7) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design,
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
How to build a digital gate. CMOS NAND Gate Several realization of NOT 1. This is how a NOT operation is often represented schematically. 2. Sometimes.
Digital Fundamentals Floyd Chapter 4 Tenth Edition
Karnaugh Maps for Simplification
4/11/03 Minute Paper How does MS window work? Like how do we have the screen on the computer. Is it just a bunch of Binary #’s representing colors? When.
Logic gate level Part 3: minimizing circuits. Improving circuit efficiency Efficiency of combinatorial circuit depends on number & arrangement of its.
Digital Fundamentals with PLD Programming Floyd Chapter 4
IKI a-Simplification of Boolean Functions Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture.
PHY 201 (Blum)1 Karnaugh Maps References: Chapters 4 and 5 in Digital Principles (Tokheim) Chapter 3 in Introduction to Digital Systems (Palmer and Perlman)
Boolean Algebra and Logic Simplification
PHY 201 (Blum)1 Some basic electronics and truth tables Some material on truth tables can be found in Chapters 3 through 5 of Digital Principles (Tokheim)
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
PHY 201 (Blum)1 Some basic electronics and truth tables Some material based on Chapters 3 through 5 of Digital Principles (Tokheim)
1 Digital Logic Design Week 5 Simplifying logic expressions.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CS1Q Computer Systems Lecture 7
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
PHY 202 (Blum)1 Combinations of Resistors Series, Parallel.
Some basic electronics and truth tables Some material on truth tables can be found in Chapter 3 of Digital Principles (Tokheim)
XOR Operator A short digression… … to introduce another Boolean operation: exclusive- OR (XOR) ABA + B XOR.
KFUPM COE 202: Digital Logic Design Combinational Logic Part 1 Courtesy of Dr. Ahmad Almulhem.
Karnaugh Maps (K-Maps)
Transistors, Logic Gates and Karnaugh Maps References: Lecture 4 from last.
CS231 Boolean Algebra1 Summary so far So far: – A bunch of Boolean algebra trickery for simplifying expressions and circuits – The algebra guarantees us.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Floyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd Chapter 4 © 2008 Pearson Education.
Chapter 3 Special Section Focus on Karnaugh Maps.
Karnaugh Map and Circuit Design.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
THE K-MAP.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC:K-Map. K-Map (1)  Karnaugh Map provides a systematic method for simplifying Boolean expressions and may produce.
CS231 Boolean Algebra1 Circuit analysis summary After finding the circuit inputs and outputs, you can come up with either an expression or a truth table.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CE1110: Digital Logic Design Gate Level Minimization Karnaugh Maps (K-Maps)
CHAPTER 3 Simplification of Boolean Functions
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Boolean Algebra and Combinational Logic
Circuit analysis summary
Lecture 3 Gunjeet Kaur Dronacharya Group of Institutions
Digital Logic and Design
Karnaugh Maps (K-Maps)
Karnaugh Maps References:
Karnaugh Maps References: Lecture 4 from last semester
Some basic electronics and truth tables
BASIC & COMBINATIONAL LOGIC CIRCUIT
ECE 331 – Digital System Design
ECB2212-Digital Electronics K-Map
Digital Fundamentals Floyd Chapter 4 Tenth Edition
Overview Part 2 – Circuit Optimization
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
Karnaugh maps Last time we saw applications of Boolean logic to circuit design. The basic Boolean operations are AND, OR and NOT. These operations can.
Basic circuit analysis and design
Principles & Applications
Laws & Rules of Boolean Algebra
Circuit Simplification and
Computer Architecture
Presentation transcript:

Karnaugh Maps References: Chapters 4 and 5 in Digital Principles (Tokheim) Chapter 3 in Introduction to Digital Systems (Palmer and Perlman) PHY 201 (Blum)

Review: Expressing truth tables Every truth table can be expressed in terms of the basic Boolean operators AND, OR and NOT operators. E.g. using sum of products or product of sums. The circuits corresponding to those truth tables can be build using AND, OR and NOT gates, which can be made out of transistors. In the sum of products approach, the input in each line of a truth table can be expressed in terms of AND’s and NOT’s (though we will only need the rows that have 1 as an output). PHY 201 (Blum)

Algebra  Gate A’ means NOT A Red probe indicator high input high low low output PHY 201 (Blum)

Algebra  Gates AB means A AND B PHY 201 (Blum)

Algebra  Gates A+B means A OR B PHY 201 (Blum)

Review: 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. PHY 201 (Blum)

Writing the expression To express a truth table as a sum of products (minterm expression), 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). This step will involve NOTs and ANDs Then feed all of those expressions into an OR gate. PHY 201 (Blum)

Example 1 A B C Out 1 PHY 201 (Blum)

Example 1 (Cont.) A’B’C’ + A’BC’ + AB’C + ABC The expression one arrives at in this way is known as the sum of products. You take the product (the AND operation) first to represent a given line. Then you sum (the OR operation) together those expressions. It’s also called the minterm expression. PHY 201 (Blum)

Simplifying Boolean algebra expressions Recall that (A’B’C + A’BC’ + A’BC + AB’C’ + AB’C + ABC’ + ABC) and (A+B+C) correspond to the same truth table. Before building a circuit that realizes a Boolean expression, we would like to simplify that expression as much as possible. Fewer gates means Fewer transistors Less space required Less power required (less heat generated) More money made PHY 201 (Blum)

A few fundamental theorems A + 0 = A A·1 = A A·0= 0 A + A = A A·A = A A + A’ = 1 A·A’ = 0 PHY 201 (Blum)

A Trivial Simplification Example B C Out Expressions 1 A’ B C’ A’ B C A B C’ A B C PHY 201 (Blum)

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 PHY 201 (Blum)

How simplification occurs Note that simplification occurs when two terms differ by only one factor. For example, the terms A´BC´ and A´BC have A’B in common and differ only in the C factor. A’BC’ + A’BC  A’B(C’+C)  A’B If the two terms differ by more than one factor, there is no simplification For example, the terms A’BC’ and A’B’C have A’ in common and differ in the B and C factors A’BC’ + A’B’C  A’(BC’ + B’C)  no simplification PHY 201 (Blum)

Majority Rules Example B C Majority 1 PHY 201 (Blum)

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 PHY 201 (Blum)

Majority rules (sum of products) without simplification A´BC + AB´C + ABC´ + ABC NOTs OR ANDs PHY 201 (Blum)

Majority Rules: Boolean Algebra Simplification A´BC + AB´C + ABC´ + ABC The term A’BC can be combined with ABC since they differ by one and only one term Same for AB’C and ABC Same for ABC’ and ABC In logic, ABC = ABC + 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 PHY 201 (Blum)

Majority rules after simplification PHY 201 (Blum)

Majority Rules Comparison Gates: 3 NOTs, 4 3-input ANDs, 1 4-input OR Gates: 0 NOTs, 3 2-input ANDs, 1 3-input OR PHY 201 (Blum)

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 into what is called “Gray code” order. Here, Gray is a guy not a color. PHY 201 (Blum)

Frank Gray in Wikipedia PHY 201 (Blum)

PHY 201 (Blum)

Gray code In addition to binary numbers, there is another way of representing numbers using 1’s and 0’s. Put another way, there is another useful ordering of the combinations of 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. PHY 201 (Blum)

Gray code (Cont.) 1 Each row different by one bit only PHY 201 (Blum)

Constructing Gray code (a.k.a. reflected binary code) 1 PHY 201 (Blum)

Reflect lower bits and add 0’s in front of the original rows and 1’s in front of the new rows 1 Add 0’s Reflect lower bits through red line Add 1’s PHY 201 (Blum)

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 PHY 201 (Blum)

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. A term like X + X’ can be factored out. PHY 201 (Blum)

Trivial Example in Gray code B C Out 1 Note: Gray code ordered inputs PHY 201 (Blum)

Improving Some combinations that differ only by a single bit are not in consecutive rows. Thus there may be a simplification associated with such a combination and we might miss it. So we put some of the inputs in as columns. PHY 201 (Blum)

Two rows that differ by one bit but are not consecutive Out 1 PHY 201 (Blum)

A row-column version A B\C 1 Place the C inputs across the top. This output corresponds to the input A=0, B=1 and C=0 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 PHY 201 (Blum)

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. Named for Maurice Karnaugh. PHY 201 (Blum)

Maurice Karnaugh PHY 201 (Blum)

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. PHY 201 (Blum)

Wrapping There are still cases in which inputs differing by only one bit are not adjacent (e.g. 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. PHY 201 (Blum)

W X Y Z Output 1 PHY 201 (Blum) Karnaugh Example

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’ PHY 201 (Blum)

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’ PHY 201 (Blum)

For Yellow Group: W and X inputs change; Y and Z inputs don’t change from zeros. Group represented by Y’Z’ 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’ PHY 201 (Blum)

For Red Group: W and Z inputs change; X input does not change from 1; Y input does not change from 0. Group represented by XY’ 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’ PHY 201 (Blum)

For Green group: W and Y inputs change; X input does not change from 1; Z input does not change from 0. Group represented by XZ’ 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’ PHY 201 (Blum)

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). PHY 201 (Blum)

From Binary order to Gray code order PHY 201 (Blum)

From Binary order to Gray code order PHY 201 (Blum)

Online References http://www.facstaff.bucknell.edu/mastascu/eLessonsHTML/Logic/Logic3.html http://www.cs.usm.maine.edu/~welty/karnaugh.htm http://en.wikipedia.org/wiki/Frank_Gray_(researcher) http://en.wikipedia.org/wiki/Maurice_Karnaugh PHY 201 (Blum)

Combinations of Resistors Series, Parallel PHY 202 (Blum)

Analyzing a combination of resistors circuit Look for resistors which are in series (the same current passing through one must pass through the other) and replace them with the equivalent resistance (Req = R1 + R2). Look for resistors which are in parallel (both the tops and bottoms are connected by wire and only wire) and replace them with the equivalent resistance (1/Req = 1/R1 + 1/R2). Repeat as much as possible. PHY 202 (Blum)

Look for series combinations Req=3k Req=3.6 k PHY 202 (Blum)

Look for parallel combinations Req = 1.8947 k Req = 1.1244 k PHY 202 (Blum)

Look for series combinations Req = 6.0191 k PHY 202 (Blum)

Look for parallel combinations Req = 2.1314 k PHY 202 (Blum)

Look for series combinations Req = 5.1314 k PHY 202 (Blum)

Equivalent Resistance I = V/R = (5 V)/(5.1314 k) = 0.9744 mA PHY 202 (Blum)

Backwards 1 V= (3)(.9744) = 2.9232 V= (2.1314)(.9744) = 2.0768 PHY 202 (Blum)

Backwards 2 V = 2.0768=I (3.3) I=0.629mA V = 2.0768=I (6.0191) PHY 202 (Blum)

Backwards 3 V=(.345)(3)=1.035 V=(.345)(1.1244)=0.388 V=(.345)(1.8947) =0.654 V=(.345)(1.1244)=0.388 PHY 202 (Blum)