Karnaugh Maps (K-Maps)

Slides:



Advertisements
Similar presentations
Digital Logic Design Gate-Level Minimization
Advertisements

Prof. Sin-Min Lee Department of Computer Science
ECE 238L Computer Logic Design Spring 2010
Gate-level Minimization
Boolean Algebra and Combinational Logic
ECE 301 – Digital Electronics Karnaugh Maps (Lecture #7) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design,
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Karnaugh Maps for Simplification
Computer Engineering (Logic Circuits) (Karnaugh Map)
Introduction Gate-level minimization refers to the design task of finding an optimal gate-level implementation of Boolean functions describing a digital.
Chapter 2: Combinatorial Logic Circuits Illustration Pg. 32 Logic Circuit Diagrams - Circuit Optimization -2,3,4 level maps 48 elements Optimized to 25.
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)
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
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)
Department of Computer Engineering
Gate-Level Minimization Chapter 3. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Karnaugh Maps References:
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
CS231 Boolean Algebra1 K-map Summary K-maps are an alternative to algebra for simplifying expressions. – The result is a minimal sum of products, which.
Chapter 3 Gate-Level Minimization
PRASAD A. PAWASKAR SPN. NO DETE 2 SEMESTER lec1-11.
Gate-Level Minimization
Gate-level Minimization
Computer Engineering (Logic Circuits) (Karnaugh Map)
Chapter3: Gate-Level Minimization Part 1 Origionally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
LOGIC GATES & BOOLEAN ALGEBRA
COE 202: Digital Logic Design Combinational Logic Part 4
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.
June 17, 2002Basic circuit analysis and design1 Example K-map simplification Let’s consider simplifying f(x,y,z) = xy + y’z + xz. First, you should convert.
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
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.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CS151 Introduction to Digital Design Chapter Map Simplification.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
CS231 Boolean Algebra1 The dual idea: products of sums Just to keep you on your toes... A product of sums (POS) expression contains: – Only AND (product)
EE2420 – Digital Logic Summer II 2013 Hassan Salamy Ingram School of Engineering Texas State University Set 5: Karnaugh Maps.
Karnaugh Map (K-Map) By Dr. M. Khamis Mrs. Dua’a Al Sinari.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 7 – Karnaugh Maps.
Dr. Nermin Hamza. x · y = y · x x + y = y + x x · (y · z) = (x · y) · z x + (y + z) = (x + y) + z x · (y + z) = (x · y) + (x · z) x + (y · z) = (x + y)
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
Computer Organisation
Prof. Sin-Min Lee Department of Computer Science
Circuit analysis summary
Lecture 3 Gunjeet Kaur Dronacharya Group of Institutions
Karnaugh Maps References: Lecture 4 from last semester
17-Nov-18 Logic Algebra 1 Combinational logic.
BASIC & COMBINATIONAL LOGIC CIRCUIT
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
MINTERMS and MAXTERMS Week 3
COE 202: Digital Logic Design Combinational Logic Part 3
Dr. Clincy Professor of CS
From now on: Combinatorial Circuits:
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
Circuit Simplification and
Presentation transcript:

Karnaugh Maps (K-Maps) for Simplification Part I 2-3 variable K-Maps Odd/Even Parity

Karnaugh Maps Boolean algebra helps us simplify expressions and circuits Try and error May not reach the simplest form Needs experience Karnaugh Map: A graphical technique for simplifying a Boolean expression into either form: minimal sum of products (MSoP) minimal product of sums (MPoS) Goal of the simplification. There are minimal number of product/sum terms Each term has a minimal number of literals Circuit-wise, this leads to a minimal two-level implementation

K-Maps: Re-arranging the Truth Table A two-variable function has four possible minterms. We can re-arrange these minterms into a Karnaugh map Now we can easily see which minterms contain common literals Minterms on the left and right sides contain y’ and y respectively Minterms in the top and bottom rows contain x’ and x respectively

Karnaugh Map Simplifications Imagine a two-variable function, its sum of minterms = m0, m1 : x’y’ + x’y Both of these minterms appear in the top row of a Karnaugh map, which means that they both contain the literal x’ What happens if you simplify this expression using Boolean algebra? x’y’ + x’y = x’(y’ + y) [ Distributive ] = x’  1 [ y + y’ = 1 ] = x’ [ x  1 = x ]

More Two-Variable Examples Another example expression is x’y + xy Both minterms appear in the right side, where y is uncomplemented Thus, we can reduce x’y + xy to just y How about x’y’ + x’y + xy? We have x’y’ + x’y in the top row, corresponding to x’ There’s also x’y + xy in the right side, corresponding to y This whole expression can be reduced to x’ + y

A+B Example 1 B 1 1 A 2-variable K-maps are trivial But, it can be used to introduce the methods you need to learn. The map for a 2-input OR gate looks like this: B 1 A 1 B 1 1 1 A B Y 1 A A+B

A Three-Variable Karnaugh Map For a three-variable expression with inputs x, y, z, the arrangement of minterms is more tricky: Another way to label the K-map (use whichever you like):

Why the funny ordering? With this ordering, any group of 2, 4 or 8 adjacent squares on the map contains common literals that can be factored out “Adjacency” includes wrapping around the left and right sides: We’ll use this property of adjacent squares to do our simplifications. F = x’y’z + x’yz = x’z(y’ + y) = x’z  1 = x’z F = x’y’z’ + xy’z’ + x’yz’ + xyz’ = z’(x’y’ + xy’ + x’y + xy) = z’(y’(x’ + x) + y(x’ + x)) = z’(y’+y) = z’

K-maps From Truth Tables We can fill in the K-map directly from a truth table The output in row i of the table goes into square mi of the K-map Remember that the rightmost columns of the K-map are “switched”

Reading the MSoP from the K-map You can find the minimal SoP expression as follows: Each rectangle corresponds to one product term The product is determined by finding the common literals in that rectangle xy y’z F(x,y,z)= y’z + xy

Grouping the Minterms Together The most difficult step is grouping together all the 1s in the K-map Make biggest rectangles around groups of one, two, four or eight 1s Why biggest??? (Bonus) All of the 1s in the map should be included in at least one rectangle Do not include any of the 0s Each group corresponds to one product term

For the Simplest Result Make as few rectangles as possible, to minimize the number of products in the final expression. Make each rectangle as large as possible, to minimize the number of literals in each term. Rectangles can be overlapped, if that makes them larger.

Filling the K-Map You should convert (unsimplify) the SoP expression into a sum of minterms form, Through boolean algebra (not recommended) Through truth table (takes time) Through K-map directly

Example: Fill K-Map through Boolean Unsimplification You can also convert the expression to a sum of minterms with Boolean algebra Apply the distributive law in reverse to add in missing variables. Very few people actually do this, but it’s occasionally useful. In both cases, we’re actually “unsimplifying” our example expression The resulting expression is larger than the original one! But having all the individual minterms makes it easy to combine them together with the K-map xy + y’z + xz = (xy  1) + (y’z  1) + (xz  1) = (xy  (z’ + z)) + (y’z  (x’ + x)) + (xz  (y’ + y)) = (xyz’ + xyz) + (x’y’z + xy’z) + (xy’z + xyz) = xyz’ + xyz + x’y’z + xy’z = m1 + m5 + m6 + m7

Example: Fill K-Map through Truth Table Let’s consider simplifying f(x,y,z) = xy + y’z + xz Here is the truth table and sum of minterms for our example: -y’z xy- x-z f(x,y,z) = x’y’z + xy’z + xyz’ + xyz = m1 + m5 + m6 + m7

Example: Fill K-Map Directly f(x,y,z) = xy + y’z + xz f(x,y,z) = xy + y’z 1 1

Practice 1: m1 + m3 + m5 + m6 Here is the filled in K-map, with all groups shown The magenta and green groups overlap, which makes each of them as large as possible Minterm m6 is in a group all by its lonesome The final MSoP here is x’z + y’z + xyz’

K-maps can be tricky! There may not necessarily be a unique MSP. The K-map below yields two valid and equivalent MSPs, because there are two possible ways to include minterm m7 Remember that overlapping groups is possible, as shown above y’z + yz’ + xy y’z + yz’ + xz

Review: Minimization of SoP with K-maps Draw a K-map Fill 1’s into the K-map (minterms) Combine maximum number of 1’s in groups, with rules: Only adjacent (Vertical/Horizontal) squares/Rectangles can be combined All 1’s must be covered Covering rectangles must be of size 1,2,4,8, … 2n Check if all groups are really needed. Generate the Minimal SoP MSoP expression

Odd K-Map Cases: How to Simplify? /\/ \/\ Grouping of single 1’s No Simplification is possible!

Different symbols for XNOR More Gates: XOR vs. XNOR Exclusive OR (XOR) outputs 1 if: Inputs are different Number of 1’s is odd X Y Z=XY 1 X Y Z F = X’Y + XY’ = X  Y X Y Z=(XY)’ 1 Exclusive NOR (XNOR) Outputs 1 if: Inputs are same Number of 1’s is even F = XY + X’Y’ = (X  Y)’ = X  Y = X Y Different symbols for XNOR X Y Z

XOR XNOR More Gates: XOR vs. XNOR X  0 = X X  0 = X’ X  Y’ = X’  Y = (X  Y)’ = X  Y X  Y = X’  Y’ (same with XNOR) X  Y = Y  X (commutative, same with XNOR) X  (Y  Z) = (X  Y)  Z (associative, same with XNOR)

Odd Detector Function = Even Parity Function The Exclusive OR function acts as an ODD detector function or as an even parity function. It equals 1 only if the number of 1’s in the input is odd. A B C F 1 A B C

Even Detector Function = Odd Parity Function The Exclusive NOR function acts as an EVEN detector function or as an ODD parity function. It equals 1 only if the number of 1’s in the input is even. Obtained by placing an inverter (NOT) in front of the odd function A B C F 1 A B C