Review: Standard forms of expressions

Similar documents
S1 Teknik Telekomunikasi Fakultas Teknik Elektro FEH2H3 2016/2017

Standard Forms of Expression. Minterms and Maxterms

Basic circuit analysis and design. Circuit analysis. Write algebraic expressions or make a truth table

Chapter 2 Combinational Logic Circuits

Simplification of Boolean Functions

Digital Logic Lecture 7 Gate Level Minimization

A B AB CD Objectives:

Circuit analysis summary

CprE 281: Digital Logic

Boolean algebra. June 17, Howard Huang 1

Gate Level Minimization Map Method

IT 201 Digital System Design Module II Notes

Experiment 3: Logic Simplification

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 04. Boolean Expression Simplification and Implementation

ENGIN 112 Intro to Electrical and Computer Engineering

Chapter 3 Simplification of Boolean functions

Karnaugh Maps. Ioan Despi. University of New England. September 13, 2013

Philadelphia University Faculty of Information Technology Department of Computer Science. Computer Logic Design. By Dareen Hamoudeh.

Combinational Logic Circuits

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

Unit-IV Boolean Algebra

Chapter 2 Combinational

Spring 2010 CPE231 Digital Logic Section 1 Quiz 1-A. Convert the following numbers from the given base to the other three bases listed in the table:

Lecture 4: Implementation AND, OR, NOT Gates and Complement

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Chapter 2. Boolean Expressions:

CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey

Gate Level Minimization

Menu. Algebraic Simplification - Boolean Algebra EEL3701 EEL3701. MSOP, MPOS, Simplification

A graphical method of simplifying logic

Module -7. Karnaugh Maps

Chapter 3. Gate-Level Minimization. Outlines

Contents. Chapter 3 Combinational Circuits Page 1 of 34

Simplification of Boolean Functions

CMPE223/CMSE222 Digital Logic

UNIT-4 BOOLEAN LOGIC. NOT Operator Operates on single variable. It gives the complement value of variable.

LOGIC CIRCUITS. Kirti P_Didital Design 1

LSN 4 Boolean Algebra & Logic Simplification. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

Outcomes. Unit 9. Logic Function Synthesis KARNAUGH MAPS. Implementing Combinational Functions with Karnaugh Maps

X Y Z F=X+Y+Z

ECE380 Digital Logic

Gate-Level Minimization

ELCT201: DIGITAL LOGIC DESIGN

5. Minimizing Circuits

4 KARNAUGH MAP MINIMIZATION

Lecture 5. Chapter 2: Sections 4-7

Assignment (3-6) Boolean Algebra and Logic Simplification - General Questions

Experiment 4 Boolean Functions Implementation

Computer Organization

Literal Cost F = BD + A B C + A C D F = BD + A B C + A BD + AB C F = (A + B)(A + D)(B + C + D )( B + C + D) L = 10

Digital Logic Design. Outline

Karnaugh Maps. Kiril Solovey. Tel-Aviv University, Israel. April 8, Kiril Solovey (TAU) Karnaugh Maps April 8, / 22

Gate-Level Minimization

Gate-Level Minimization

Gate-Level Minimization. BME208 Logic Circuits Yalçın İŞLER

3.3 Hardware Karnaugh Maps

Chapter 2: Combinational Systems

Chapter 3. Boolean Algebra and Digital Logic

Combinational Circuits Digital Logic (Materials taken primarily from:

2.6 BOOLEAN FUNCTIONS

Digital Design. Chapter 4. Principles Of. Simplification of Boolean Functions

Arithmetic-logic units


BOOLEAN ALGEBRA. Logic circuit: 1. From logic circuit to Boolean expression. Derive the Boolean expression for the following circuits.

ENGIN 112. Intro to Electrical and Computer Engineering

QUESTION BANK FOR TEST

To write Boolean functions in their standard Min and Max terms format. To simplify Boolean expressions using Karnaugh Map.

UNIT II. Circuit minimization

University of Technology

MODULE 5 - COMBINATIONAL LOGIC

Introduction to Boolean logic and Logical Gates

Combinational Logic Circuits Part III -Theoretical Foundations

Chapter 6. Logic Design Optimization Chapter 6

Combinational Logic Circuits

211: Computer Architecture Summer 2016

2.1 Binary Logic and Gates

CS February 17

Digital Logic Design (3)

Points Addressed in this Lecture. Standard form of Boolean Expressions. Lecture 4: Logic Simplication & Karnaugh Map

Code No: R Set No. 1

Permutation Matrices. Permutation Matrices. Permutation Matrices. Permutation Matrices. Isomorphisms of Graphs. 19 Nov 2015

Code No: 07A3EC03 Set No. 1

Chapter 2 Combinational Logic Circuits

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic

ENGINEERS ACADEMY. 7. Given Boolean theorem. (a) A B A C B C A B A C. (b) AB AC BC AB BC. (c) AB AC BC A B A C B C.

DKT 122/3 DIGITAL SYSTEM 1

ELCT201: DIGITAL LOGIC DESIGN

Presented By :- Alok Kumar Lecturer in ECE C.R.Polytechnic, Rohtak

Computer Science. Unit-4: Introduction to Boolean Algebra

EEE130 Digital Electronics I Lecture #4_1

2/8/2017. SOP Form Gives Good Performance. ECE 120: Introduction to Computing. K-Maps Can Identify Single-Gate Functions

Boolean Analysis of Logic Circuits

CS470: Computer Architecture. AMD Quad Core

(Refer Slide Time 5:19)

Optimized Implementation of Logic Functions

UNIT 2 BOOLEAN ALGEBRA

Slide Set 5. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Announcements. Chapter 2 - Part 1 1

SEE1223: Digital Electronics

Code No: R Set No. 1

Transcription:

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 be combined to form complex expressions, which can also be directly translated into a hardware circuit. Boolean algebra helps us simplify expressions and circuits. Today we ll look at a graphical technique for simplifying an expression into a minimal sum of products (MSP) form: There are a minimal number of product terms in the expression. Each term has a minimal number of literals. Circuit-wise, this leads to a minimal two-level implementation. 1

Review: Standard forms of expressions We can write expressions in many ways, but some ways are more useful than others A sum of products (SOP) expression contains: Only OR (sum) operations at the outermost level Each term that is summed must be a product of literals f(x,y,z) = y + x yz + xz The advantage is that any sum of products expression can be implemented using a two-level circuit literals and their complements at the 0th level AND gates at the first level a single OR gate at the second level This diagram uses some shorthands NOT gates are implicit literals are reused this is not okay in LogicWorks! 2

Terminology: Minterms A minterm is a special product of literals, in which each input variable appears exactly once. A function with n variables has 2 n minterms (since each variable can appear complemented or not) A three-variable function, such as f(x,y,z), has 2 3 = 8 minterms: x y z x y z x yz x yz xy z xy z xyz xyz Each minterm is true for exactly one combination of inputs: Minterm Is true when Shorthand x y z x=0, y=0, z=0 m 0 x y z x=0, y=0, z=1 m 1 x yz x=0, y=1, z=0 m 2 x yz x=0, y=1, z=1 m 3 xy z x=1, y=0, z=0 m 4 xy z x=1, y=0, z=1 m 5 xyz x=1, y=1, z=0 m 6 xyz x=1, y=1, z=1 m 7 3

Terminology: Sum of minterms form Every function can be written as a sum of minterms, which is a special kind of sum of products form The sum of minterms form for any function is unique If you have a truth table for a function, you can write a sum of minterms expression just by picking out the rows of the table where the function output is 1. x y z f(x,y,z) f (x,y,z) 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 f = x y z + x y z + x yz + x yz + xyz = m 0 + m 1 + m 2 + m 3 + m 6 = m(0,1,2,3,6) f = xy z + xy z + xyz = m 4 + m 5 + m 7 = m(4,5,7) f contains all the minterms not in f 4

Re-arranging the truth table A two-variable function has four possible minterms. We can re-arrange these minterms into a Karnaugh map. x y minterm 0 0 x y 0 1 x y 1 0 xy 1 1 xy X 0 1 0 x y x y 1 xy xy 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. X 0 1 0 x y x y 1 xy xy X x y x y X xy xy 5

Karnaugh map simplifications Imagine a two-variable sum of minterms: 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. x y x y X xy xy 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 ] 6

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. x y x y X xy xy 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. x y x y X xy xy 7

A three-variable Karnaugh map For a three-variable expression with inputs x, y, z, the arrangement of minterms is more tricky: 00 01 11 10 0 x y z x y z x yz x yz X 1 xy z xy z xyz xyz 00 01 11 10 0 m 0 m 1 m 3 m 2 X 1 m4 m 5 m 7 m 6 Another way to label the K-map (use whichever you like): x y z x y z x yz x yz X xy z xy z xyz xyz m 0 m 1 m 3 m 2 X m 4 m 5 m 7 m 6 8

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. x y z x y z x yz x yz X xy z xy z xyz xyz x y z + x yz = x z(y + y) = x z 1 = x z Adjacency includes wrapping around the left and right sides: x y z x y z x yz x yz X xy z xy z xyz xyz 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 We ll use this property of adjacent squares to do our simplifications. 9

Example K-map simplification Let s consider simplifying f(x,y,z) = xy + y z + xz. First, you should convert the expression into a sum of minterms form, if it s not already. The easiest way to do this is to make a truth table for the function, and then read off the minterms. ou can either write out the literals or use the minterm shorthand. Here is the truth table and sum of minterms for our example: x y z f(x,y,z) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 f(x,y,z) = x y z + xy z + xyz + xyz = m 1 + m 5 + m 6 + m 7 10

Unsimplifying expressions ou 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. 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 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. 11

Making the example K-map Next up is drawing and filling in the K-map. Put 1s in the map for each minterm, and 0s in the other squares. ou can use either the minterm products or the shorthand to show you where the 1s and 0s belong. In our example, we can write f(x,y,z) in two equivalent ways. f(x,y,z) = x y z + xy z + xyz + xyz x y z x y z x yz x yz X xy z xy z xyz xyz f(x,y,z) = m 1 + m 5 + m 6 + m 7 m 0 m 1 m 3 m 2 X m 4 m 5 m 7 m 6 In either case, the resulting K-map is shown below. 0 1 0 0 X 0 1 1 1 12

K-maps from truth tables ou can also fill in the K-map directly from a truth table. The output in row i of the table goes into square m i of the K-map. Remember that the rightmost columns of the K-map are switched. x y z f(x,y,z) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 m 0 m 1 m 3 m 2 X m 4 m 5 m 7 m 6 0 1 0 0 X 0 1 1 1 13

Grouping the minterms together The most difficult step is grouping together all the 1s in the K-map. Make rectangles around groups of one, two, four or eight 1s. 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. It s all right for rectangles to overlap, if that makes them larger. 0 1 0 0 X 0 1 1 1 14

Reading the MSP from the K-map Finally, you can find the MSP. Each rectangle corresponds to one product term. The product is determined by finding the common literals in that rectangle. 0 1 0 0 X 0 1 1 1 x y z x y z x yz x yz X xy z xy z xyz xyz For our example, we find that xy + y z + xz = y z + xy. (This is one of the additional algebraic laws from last time.) 15

Practice K-map 1 Simplify the sum of minterms m 1 + m 3 + m 5 + m 6. X m 0 m 1 m 3 m 2 X m 4 m 5 m 7 m 6 16

Solutions for practice K-map 1 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 m 6 is in a group all by its lonesome. 0 1 1 0 X 0 1 0 1 The final MSP here is x z + y z + xyz. 17

Four-variable K-maps We can do four-variable expressions too! The minterms in the third and fourth columns, and in the third and fourth rows, are switched around. Again, this ensures that adjacent squares have common literals. w x y z w x y z w x yz w x yz w xy z w xy z w xyz w xyz W wxy z wxy z wxyz wxyz wx y z wx y z wx yz wx yz X m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 m 12 m 13 m 15 m 14 X W m8 m 9 m 11 m 10 Grouping minterms is similar to the three-variable case, but: ou can have rectangular groups of 1, 2, 4, 8 or 16 minterms. ou can wrap around all four sides. 18

Example: Simplify m 0 +m 2 +m 5 +m 8 +m 10 +m 13 The expression is already a sum of minterms, so here s the K-map: 1 0 0 1 0 1 0 0 0 1 0 0 X W 1 0 0 1 m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 m 12 m 13 m 15 m 14 X W m8 m 9 m 11 m 10 We can make the following groups, resulting in the MSP x z + xy z. 1 0 0 1 0 1 0 0 0 1 0 0 X W 1 0 0 1 w x y z w x y z w x yz w x yz w xy z w xy z w xyz w xyz W wxy z wxy z wxyz wxyz wx y z wx y z wx yz wx yz X 19

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 m 7. 0 1 0 1 X 0 1 1 1 0 1 0 1 X 0 1 1 1 y z + yz + xy 0 1 0 1 X 0 1 1 1 y z + yz + xz Remember that overlapping groups is possible, as shown above. 20