Karnaugh Maps for Combinatorial Logic CS 64: Computer Organization and Design Logic Lecture #12

Similar documents
Combinatorial Logic Design Multiplexers and ALUs CS 64: Computer Organization and Design Logic Lecture #13

Introduction to Karnaugh Maps

Digital Logic Design. Combinational Logic

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

Minimization techniques

ENGG 1203 Tutorial - 2 Recall Lab 2 - e.g. 4 input XOR. Parity checking (for interest) Recall : Simplification methods. Recall : Time Delay

Simplifying Logic Circuits with Karnaugh Maps

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

MC9211 Computer Organization

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Logic Simplification. Boolean Simplification Example. Applying Boolean Identities F = A B C + A B C + A BC + ABC. Karnaugh Maps 2/10/2009 COMP370 1

CHAPTER III BOOLEAN ALGEBRA

CPE100: Digital Logic Design I

CHAPTER III BOOLEAN ALGEBRA

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Digital Logic (2) Boolean Algebra

Unit 2 Session - 6 Combinational Logic Circuits

Advanced Boolean Logic and Applications to Control Systems

Combinational Digital Design. Laboratory Manual. Experiment #6. Simplification using Karnaugh Map

Logic Design I (17.341) Fall Lecture Outline

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

Lecture 7: Karnaugh Map, Don t Cares

Systems I: Computer Organization and Architecture

ELC224C. Karnaugh Maps

Combinational Logic. Course Instructor Mohammed Abdul kader

CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha. BCD Codes

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

Cs302 Quiz for MID TERM Exam Solved

DIGITAL ELECTRONICS & it0203 Semester 3

SAMPLE ANSWERS MARKER COPY

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

1 Boolean Algebra Simplification

Boolean Algebra, Gates and Circuits

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

ECE 2300 Digital Logic & Computer Organization

Gate-Level Minimization

Digital Circuit And Logic Design I. Lecture 4

Karnaugh Map & Boolean Expression Simplification

Finite State Machines CS 64: Computer Organization and Design Logic Lecture #15 Fall 2018

Chapter-2 BOOLEAN ALGEBRA

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

ENG2410 Digital Design Combinational Logic Circuits

CSE 140: Components and Design Techniques for Digital Systems

Introduction to Digital Logic Missouri S&T University CPE 2210 Karnaugh Maps

CS/EE 181a 2010/11 Lecture 4

Lecture 4: Four Input K-Maps

CHAPTER1: Digital Logic Circuits Combination Circuits

Week-I. Combinational Logic & Circuits

Karnaugh Maps Objectives


Logic Gates - Introduction

Slides for Lecture 16

Midterm1 Review. Jan 24 Armita

Solutions to Assignment No 5 Digital Techniques Fall 2007

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

UNIT 5 KARNAUGH MAPS Spring 2011

Logic Design. Chapter 2: Introduction to Logic Circuits

CS/COE0447: Computer Organization and Assembly Language

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Standard Expression Forms

Philadelphia University Student Name: Student Number:

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #2 Nov 22, 2006

Combinational Logic Design/Circuits

EEE130 Digital Electronics I Lecture #4

CprE 281: Digital Logic

Philadelphia University Student Name: Student Number:

Sample Marking Scheme

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

Digital Logic Appendix A

Chap 2. Combinational Logic Circuits

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

mith College Computer Science CSC270 Spring 16 Circuits and Systems Lecture Notes Week 2 Dominique Thiébaut

Chapter 2 Combinational Logic Circuits

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Chapter 7 Logic Circuits

Optimizations and Tradeoffs. Combinational Logic Optimization

Written exam for IE1204/5 Digital Design with solutions Thursday 29/

MODULAR CIRCUITS CHAPTER 7

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Logic and Boolean algebra

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

LOGIC GATES. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

Combinational Logic. By : Ali Mustafa

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Computer Science Final Examination Friday December 14 th 2001

Spiral 1 / Unit 5. Karnaugh Maps

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

CHAPTER 5 KARNAUGH MAPS

Why digital? Overview. Number Systems. Binary to Decimal conversion

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

CSE 140 Midterm I - Solution

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

CHAPTER 7. Solutions for Exercises

Transcription:

Karnaugh Maps for Combinatorial Logic CS 64: Computer Organization and Design Logic Lecture #2 Ziad Matni Dept. of Computer Science, UCSB

Administrative Re: Midterm Exam #2 On Thursday! Everything from lectures 7 thru 2 5/5/8 Matni, CS64, Sp8 2

Lecture Outline Logic Functions and their Simplifications: Truth Table Use vs. Karnaugh Maps 5/5/8 Matni, CS64, Wi8 3

Scaling Up Simplification When we get to more than 3 variables, it becomes challenging to use truth tables We can instead use Karnaugh Maps to make it immediately apparent as to what can be simplified 5/5/8 Matni, CS64, Wi8 4

Example of a K-Map 0 2 3 A B f(a,b) 0 0 a 0 b 0 c d A B f(a,b) 0 0 0 0 0 5/5/8 Matni, CS64, Wi8 5

K-Maps with 3 or 4 Variables Note the adjacent placement of: 00 0 0 It s NOT: 00 0 0 5/5/8 Matni, CS64, Wi8 6

Rules for Using K-Maps for Simplification. Group together adjacent cells containing 2. Groups should not include anything containing 0 3. Groups may be horizontal or vertical, but not diagonal 5/5/8 Matni, CS64, Wi8 7

Rules for Using K-Maps for Simplification 4. Groups must contain, 2, 4, 8, or in general 2 n cells. 5/5/8 Matni, CS64, Wi8 8

Rules for Using K-Maps for Simplification 5. Each group must be as large as possible (Otherwise we re not being as minimal as we can be, even though we re not breaking any Boolean rules) 5/5/8 Matni, CS64, Wi8 9

Rules for Using K-Maps for Simplification 6. Each cell containing a must be at least in one group 5/5/8 Matni, CS64, Wi8 0

Rules for Using K-Maps for Simplification 7. Groups may overlap esp. to maximize group size 5/5/8 Matni, CS64, Wi8

Rules for Using K-Maps for Simplification 8. Groups may wrap around the table. The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be grouped with the bottom cell. 5/5/8 Matni, CS64, Wi8 2

Example 2 vars F(X,Y) = XY + Y = Y (X + ) X Y Y = column 0 = Y 0 Verifying results! F(X,Y) = Y 5/5/8 Matni, CS64, Wi8 3

Example 2 3 vars F(X,Y,Z) = XZ + Z(X'+ XY) = XZ + ZX + ZXY Z XY X = Y = 00 0 0 = Z (X + X + XY) 0 = Z ( + XY) = Z Verifying results! F(X,Y,Z) = Z 5/5/8 Matni, CS64, Wi8 4

Example 3 3 vars!a!b!c +!A!BC +!ABC +!AB!C + A!B!C + AB!C C AB 00 0 0 0 F(X,Y,Z) =!C +!A 5/5/8 Matni, CS64, Wi8 5

Example 4 4 vars F(A,X,Y,Z) = AX + Z(X+A +Y) = AX + ZX+ ZA + ZY AZ XY Y = X = 00 0 0 00 F(A,X,Y,Z) = ZA + AX + ZY Z = A = 0 0 5/5/8 Matni, CS64, Wi8 6

Example 4 4 vars F(A,B,C,D) = ABCD + ABC D + CD + A B + C D AB CD 00 00 0 0 A = B = F(A,B,C,D) = A B + D + ABC D = C = 0 0 5/5/8 Matni, CS64, Wi8 7

K-Map Rules Summary. Groups can contain only s 2. Only s in adjacent groups are allowed 3. Groups may ONLY be horizontal or vertical (no diagonals) 4. The number of s in a group must be a power of two (, 2, 4, 8...) 5. Groups must be as large AND as few in no.s as legally possible 6. All s must belong to a group, even if it s a group of one element 7. Overlapping groups are permitted 8. Wrapping around the map is permitted 5/5/8 Matni, CS64, Wi8 8

Exploiting Don t Cares An output variable that s designated don t care (symbol = X) means that it could be a 0 or a (i.e. we don t care which) That is, it is unspecified, usually because of invalid inputs 5/5/8 Matni, CS64, Wi8 9

Example of a Don t Care Situation Consider coding all decimal digits (say, for a digital clock app): 0 thru 9 --- requires how many bits? 4 bits But! 4 bits convey more numbers than that! Don t forget A thru F! Not all binary values map to decimal 5/5/8 Matni, CS64, Wi8 20

Example Continued 5/5/8 Matni, CS64, Wi8 2

Don t Care: So What? Recall that in a K-map, we can only group s Because the value of a don t care is irrelevant, we can treat it as a if it is convenient to do so (or a 0 if that would be more convenient) 5/5/8 Matni, CS64, Wi8 22

Example A circuit that calculates if the 4-bit binary coded single digit decimal input % 2 == 0 So, although 4-bits will give me numbers from 0 to 5, I don t care about the ones that yield 0 to 5. I3 I2 I I0 5/5/8 Matni, CS64, Wi8 23 R 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X 0 X 0 0 X 0 X 0 X X

Example as a K-Map 5/5/8 Matni, CS64, Wi8 24

If We Don t Exploit Don t Cares R =!I!I 0!I 3 + I I 0!I 3 +!I 0!I!I 2 5/5/8 Matni, CS64, Wi8 25

If We DO Exploit Don t Cares R =!I!I 0 + I I 0 5/5/8 Matni, CS64, Wi8 26

Combinatorial Logic Designs When you combine multiple logic blocks together to form a more complex logic function/circuit C AB What is the output? A.B + C What is its K-Map? 0 00 0 0 What is its truth table? A B C F 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5/5/8 Matni, CS64, Sp8 27

Exercise Given the following truth table, draw the resulting logic circuit STEP : Draw the K-Map and simplify the function STEP 2: Construct the circuit from the now simplified function A B C D F 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5/5/8 Matni, CS64, Sp8 28

A B C D F 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 D = C = Exercise Step Get the simplified function AB CD 00 0 0 B = 00 0 0 5/5/8 Matni, CS64, Sp8 29 A = F(A,B,C) = B.C.D + A.C

Exercise Step 2 Draw the logic circuit diagram F(A,B,C) = B.C.D + A.C A C C F B D 5/5/8 Matni, CS64, Sp8 30

Exercise 2 Given the following truth table, draw the resulting logic circuit A B C F 0 0 0 0 0 C AB 00 0 0 F(A,B,C) = B + A.C 0 0 0 0 0 B A F 0 0 0 C 0 0 0 5/5/8 Matni, CS64, Sp8 3

Exercise 3 Given the following schematic of a circuit, (a) write the function and (b) fill out the truth table: A B A C X = A.B + (A.C) (note that also means: X = A.B + A + C ) 5/5/8 Matni, CS64, Sp8 32 A.B (A.C) X A B C X 0 0 0 0 0 0 0 0 0 0 0 0 0

Exercise 3 Given the following schematic of a circuit, (a) write the function and (b) fill out the truth table: A B A C X = A.B + (A.C) (note that also means: X = A.B + A + C ) 5/5/8 Matni, CS64, Sp8 33 A.B (A.C) X A B C X 0 0 0 0 0 0 0 0 0 0 0 0 0

YOUR TO-DOs Study for the Midterm on Thursday! Finish Lab #6 by Friday! Next Time: Sequential Logic 5/5/8 Matni, CS64, Sp8 34

5/5/8 Matni, CS64, Sp8 35