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

Similar documents
for Digital Systems Simplification of logic functions Tajana Simunic Rosing Sources: TSR, Katz, Boriello & Vahid

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

Boolean cubes EECS150. Mapping truth tables onto cubes. Simplification. The Uniting Theorem. Three variable example

Combinational Logic (mostly review!)

Working with Combinational Logic. Design example: 2x2-bit multiplier

Possible logic functions of two variables

Combinational Logic. Review of Combinational Logic 1

Chapter 2 Combinational logic

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

L2: Combinational Logic Design (Construction and Boolean Algebra)

Unit 2 Session - 6 Combinational Logic Circuits

This form sometimes used in logic circuit, example:

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

L2: Combinational Logic Design (Construction and Boolean Algebra)

CHAPTER III BOOLEAN ALGEBRA

ENG2410 Digital Design Combinational Logic Circuits

211: Computer Architecture Summer 2016

Digital Logic Design. Combinational Logic

EECS Variable Logic Functions

Review for Test 1 : Ch1 5

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

CHAPTER III BOOLEAN ALGEBRA

Lecture A: Logic Design and Gates

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions.

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

ELCT201: DIGITAL LOGIC DESIGN

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

Karnaugh Maps Objectives

MC9211 Computer Organization

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

L2: Combinational Logic Design (Construction and Boolean Algebra)

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

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

Gate-Level Minimization

DIGITAL ELECTRONICS & it0203 Semester 3

Chapter 7 Logic Circuits

MODULAR CIRCUITS CHAPTER 7

CPE100: Digital Logic Design I

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

ELC224C. Karnaugh Maps

1. Name the person who developed Boolean algebra

Midterm1 Review. Jan 24 Armita

Minimization techniques

Combinatorial Logic Design Principles

Optimizations and Tradeoffs. Combinational Logic Optimization

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

Week-I. Combinational Logic & Circuits

L4: Karnaugh diagrams, two-, and multi-level minimization. Elena Dubrova KTH / ICT / ES

Advanced Digital Design with the Verilog HDL, Second Edition Michael D. Ciletti Prentice Hall, Pearson Education, 2011

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

Simplifying Logic Circuits with Karnaugh Maps

Chapter 2 Combinational Logic Circuits

Chap 2. Combinational Logic Circuits

Boolean Algebra and Logic Simplification

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

CHAPTER1: Digital Logic Circuits Combination Circuits

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

UNIT 5 KARNAUGH MAPS Spring 2011

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

CSE 140 Midterm I - Solution

Karnaugh Maps ف ر آ ا د : ا ا ب ا م آ ه ا ن ر ا

Digital Circuit And Logic Design I. Lecture 4

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

Logic Design. Chapter 2: Introduction to Logic Circuits

Working with combinational logic

Digital Logic (2) Boolean Algebra

Cs302 Quiz for MID TERM Exam Solved

Boolean Algebra, Gates and Circuits

CPE100: Digital Logic Design I

Systems I: Computer Organization and Architecture

Number System conversions

Lecture 2 Review on Digital Logic (Part 1)

CHAPTER 12 Boolean Algebra

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

9.1. Unit 9. Implementing Combinational Functions with Karnaugh Maps or Memories

Karnaugh Map & Boolean Expression Simplification

CHAPTER 7. Exercises 17/ / /2 2 0

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

Logic Design I (17.341) Fall Lecture Outline

Karnaugh Maps (K-Maps)

Combinational Logic Design Combinational Functions and Circuits

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

Combinational Logic Fundamentals

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

Combinational Logic. By : Ali Mustafa

Lecture 2. Notes. Notes. Notes. Boolean algebra and optimizing logic functions. BTF Electronics Fundamentals August 2014

Chapter 2. Boolean Algebra and Logic Gates

Digital Logic Circuits - Switching Algebra - Combinational Circuits -

Unit 6. Quine-McClusky Method. Unit 6 1

Administrative Notes. Chapter 2 <9>

CHAPTER 5 KARNAUGH MAPS

EEE130 Digital Electronics I Lecture #4

Combinational Logic Circuits Part II -Theoretical Foundations

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

WEEK 2.1 BOOLEAN ALGEBRA

Standard Expression Forms

CSE 140: Components and Design Techniques for Digital Systems

Transcription:

Review EECS 150 - Components and Design Techniques for Digital Systems Lec 06 Minimizing Boolean Logic 9/16-04 David Culler Electrical Engineering and Computer Sciences University of California, Berkeley http://www.eecs.berkeley.edu/~culler http://www-inst.eecs.berkeley.edu/~cs150 9/16/04 UCB EECS150 D. Culler Fa04 1 Combinational logic Truth Tables vs Boolean Expressions vs Gates Minimal Operators And / Or / Not, NAND, NOR New Friends XOR, EQ, Full Adder Boolean Algebra +, *, ~, assoc, comm, distr.,. Manipulating Expressions and Circuits Proofs: Term rewriting & Exhaustive Enumeration Simplifications De Morgan s Law Duality Canonical and minimal forms Sum of products Product of sums 9/16/04 UCB EECS150 D. Culler Fa04 2 Review: Relationship Among Representations * Theorem: Any Boolean function that can be expressed as a truth table can be written as an expression in Boolean Algebra using AND, OR, NOT. unique? Truth Table not unique Boolean Expression [convenient for manipulation] gate representation (schematic) 9/16/04 UCB EECS150 D. Culler Fa04 3? [close to implementaton] How do we convert from one to the other? Optimizations? not unique Review: Canonical Forms Standard form for a Boolean expression - unique algebraic expression directly from a true table (TT) description. Two Types: * Sum of Products (SOP) * Product of Sums (POS) Sum of Products (disjunctive normal form, minterm expansion). Example: minterms a b c f f a b c 0 0 0 0 1 a b c 0 0 1 0 1 a bc 0 1 0 0 1 a bc 0 1 1 1 0 ab c 1 0 0 1 0 ab c 1 0 1 1 0 abc 1 1 0 1 0 abc 1 1 1 1 0 One product (and) term for each 1 in f: f = a bc + ab c + ab c +abc +abc f = a b c + a b c + a bc 9/16/04 UCB EECS150 D. Culler Fa04 4 Review: Sum of Products (cont.) Canonical Forms are usually not minimal: Our Example: f = a bc + ab c + ab c + abc +abc (xy + xy = x) = a bc + ab + ab = a bc + a (x y + x = y + x) = a + bc f = a b c + a b c + a bc = a b + a bc = a ( b + bc ) = a ( b + c ) = a b + a c 9/16/04 UCB EECS150 D. Culler Fa04 5 Review: Canonical Forms Product of Sums (conjunctive normal form, maxterm expansion). Example: maxterms a b c f f a+b+c 0 0 0 0 1 a+b+c 0 0 1 0 1 a+b +c 0 1 0 0 1 a+b +c 0 1 1 1 0 a +b+c 1 0 0 1 0 a +b+c 1 0 1 1 0 a +b +c 1 1 0 1 0 a +b +c 1 1 1 1 0 One sum (or) term for each 0 in f: f = (a+b+c)(a+b+c )(a+b +c) f = (a+b +c )(a +b+c)(a +b+c ) (a +b +c)(a+b+c ) Mapping from SOP to POS (or POS to SOP): Derive truth table then proceed. 9/16/04 UCB EECS150 D. Culler Fa04 6

ncompletely specified functions Example: binary coded decimal increment by 1 BCD digits encode decimal digits 0 9 in bit patterns 0000 1001 %&!" # # $ 9/16/04 UCB EECS150 D. Culler Fa04 Outline Review De Morgan s to transform SofP into simple 2-level forms Uniting Law to reduce SofP N-cube perspective Announcements Karnaugh Maps Examples Reduction Algorithm 9/16/04 UCB EECS150 D. Culler Fa04 8 Putting DeMorgan s to work Transformation to Simple Gates DeMorgan s Law: (a + b) = a b (a b) = a + b a + b = (a b ) (a b) = (a + b ) = = = = Sum of Products nvolution: x = (x ) push bubbles or introduce in pairs or remove pairs. = De Morgans 9/16/04 UCB EECS150 D. Culler Fa04 9 9/16/04 UCB EECS150 D. Culler Fa04 10 mplementations of Two-level Logic Sum-of-products AND gates to form product terms (minterms) OR gate to form sum Two-level Logic using NAND Gates Replace minterm AND gates with NAND gates Place compensating inversion at inputs of OR gate Product-of-sums OR gates to form sum terms (maxterms) AND gates to form product 9/16/04 UCB EECS150 D. Culler Fa04 11 9/16/04 UCB EECS150 D. Culler Fa04 12

Two-level Logic using NAND Gates OR gate with inverted inputs is a NAND gate de Morgan's: A'+ B'= (A B)' Two-level NAND-NAND network nverted inputs are not counted n a typical circuit, inversion is done once and signal distributed Two-level Logic using NOR Gates Replace maxterm OR gates with NOR gates Place compensating inversion at inputs of AND gate 9/16/04 UCB EECS150 D. Culler Fa04 13 9/16/04 UCB EECS150 D. Culler Fa04 14 Two-level Logic using NOR Gates AND gate with inverted inputs is a NOR gate de Morgan's: A' B'= (A + B)' Two-level NOR-NOR network nverted inputs are not counted n a typical circuit, inversion is done once and signal distributed The Uniting Theorem Key tool to simplification: A (B'+ B) = A Essence of simplification of two-level logic Find two element subsets of the ON-set where only one variable changes its value this single varying variable can be eliminated and a single product term used to represent both elements () * )% *& ) # ' # ' ' # 9/16/04 UCB EECS150 D. Culler Fa04 15 9/16/04 UCB EECS150 D. Culler Fa04 16 Boolean cubes Visual technique for identifying when the uniting theorem can be applied n input variables = n-dimensional "cube Neighbors address differs by one bit flip 9/16/04 UCB EECS150 D. Culler Fa04 1 Mapping truth tables onto Boolean cubes Uniting theorem combines two "faces" of a cube into a larger "face" Example: +, ) + (()# - ) ' $%& # $%& '! 9/16/04 UCB EECS150 D. Culler Fa04 18

Three variable example Binary full-adder carry-out logic Higher dimensional cubes Sub-cubes of higher dimension than 2 % *& % *& %* & # -- # %+.& ' # - /0 # (%!!&)Σ# %1!2!3!4& # 5 66!# " 66!8# # %&9 - : )** 9/16/04 UCB EECS150 D. Culler Fa04 19 9/16/04 UCB EECS150 D. Culler Fa04 20 m-dimensional cubes in a n- dimensional Boolean space n a 3-cube (three variables): 0-cube, i.e., a single node, yields a term in 3 literals 1-cube, i.e., a line of two nodes, yields a term in 2 literals 2-cube, i.e., a plane of four nodes, yields a term in 1 literal 3-cube, i.e., a cube of eight nodes, yields a constant term "1" n general, m-subcube within an n-cube (m < n) yields a term with n m literals Announcements Homework 2 due Friday Reading: 2.5-2.8 (rest of ch 2) Homework 3 posted 9/16/04 UCB EECS150 D. Culler Fa04 21 9/16/04 UCB EECS150 D. Culler Fa04 22 Karnaugh maps Flat map of Boolean cube Wrap around at edges Hard to draw and visualize for more than 4 dimensions Virtually impossible for more than 6 dimensions Alternative to truth-tables to help visualize adjacencies Guide to applying the uniting theorem On-set elements with only one variable changing value are adjacent unlike the situation in a linear truth-table ( 8 9/16/04 UCB EECS150 D. Culler Fa04 23 Karnaugh maps Numbering scheme based on Gray code e.g., 00, 01, 11, 10 2 n values of n bits where each differs from next by one bit flip» Hamiltonian circuit through n-cube Only a single bit changes in code for adjacent map cells 3 1 8 4 2 8 3 1 4 2 1 2 8 4 3 ; 8 < 9/16/04 UCB EECS150 D. Culler Fa04 24 2 1 8))=

Adjacencies in Karnaugh maps Karnaugh map examples Wrap from first to last column Wrap top row to bottom row F = Cout = f(a,b,c) = Σm(0,4,6,) = 9/16/04 UCB EECS150 D. Culler Fa04 25 # # *== *= -9 ' 9/16/04 UCB EECS150 D. Culler Fa04 26 ** More Karnaugh map examples K-map: 4-variable interactive quiz >%!!&) F(A,B,C,D) = Σm(0,2,3,5,6,,8,10,11,14,15) F = (%!!&)Σ# %!1!2!4& )*== ( # - ' ( %!!&)Σ # %!!8!3& )= *= # # 9 +, %' # ' ' # & 9/16/04 UCB EECS150 D. Culler Fa04 2 9/16/04 UCB EECS150 D. Culler Fa04 28 Karnaugh map: 4-variable example F(A,B,C,D) = Σm(0,2,3,5,6,,8,10,11,14,15) F = *= *== # # 9 +, %' # ' ' # & Karnaugh maps: don t cares f(a,b,c,d) = Σ m(1,3,5,,9) + d(6,12,13) without don't cares» f = = *== 9/16/04 UCB EECS150 D. Culler Fa04 29 9/16/04 UCB EECS150 D. Culler Fa04 30

Karnaugh maps: don t cares Design example: two-bit comparator f(a,b,c,d) = Σ m(1,3,5,,9) + d(6,12,13) f = A'D + B'C'D without don't cares f = with don't cares -9 # 9' # 9,, A: BC >: @9# D ) E A: BC >: ' 1?9 # 8 9/16/04 UCB EECS150 D. Culler Fa04 31 9/16/04 UCB EECS150 D. Culler Fa04 32 Design example: two-bit comparator?# A:?# BC?# >: Design example: two-bit comparator ' # # BC ' ' +. A: ) * * BC ) * ** = >: ) * * Canonical PofS vs minimal? )%" &F %" &, +.# # ' 8# 9 A: >: # %GG& 9/16/04 UCB EECS150 D. Culler Fa04 33 9/16/04 UCB EECS150 D. Culler Fa04 34 Design example: 2x2-bit multiplier @9# H H H1 H; H; H1 H H 1?# 1 9/16/04 UCB EECS150 D. Culler Fa04 35 Design example: 2x2-bit multiplier?# H; H;)?# H?# H1 H1) * H ) * * * 9/16/04 UCB EECS150 D. Culler Fa04 36?# H H )

Design example: BCD increment by 1 Design example: BCD increment by 1 @9# + + + 1 + ; + ; + 1 + + 1?# 1 + ; + 1 + ;)* + 1) * *= + )= = * + ) + + 9/16/04 UCB EECS150 D. Culler Fa04 3 9/16/04 UCB EECS150 D. Culler Fa04 38 Definition of terms for two-level simplification Examples to illustrate terms mplicant Single element of ON-set or DC-set or any group of these elements that can be combined to form a subcube Prime implicant mplicant that can't be combined with another to form a larger subcube Essential prime implicant Prime implicant is essential if it alone covers an element of ON-set Will participate in ALL possible covers of the ON-set DC-set used to form prime implicants but not to make implicant essential Objective: Grow implicant into prime implicants (minimize literals per term) Cover the ON-set with as few prime implicants as possible (minimize number of product terms) 9/16/04 UCB EECS150 D. Culler Fa04 39 2# # J!!!! # # # J1# 3# # J!!!!! # # # J* * 9/16/04 UCB EECS150 D. Culler Fa04 40 Algorithm for two-level simplification Algorithm: minimum sum-of-products expression from a Karnaugh map Step 1: choose an element of the ON-set Step 2: find "maximal" groupings of 1s and Xs adjacent to that element» consider top/bottom row, left/right column, and corner adjacencies» this forms prime implicants (number of elements always a power of 2) Repeat Steps 1 and 2 to find all prime implicants Step 3: revisit the 1s in the K-map» if covered by single prime implicant, it is essential, and participates in final cover» 1s covered by essential prime implicant do not need to be revisited Step 4: if there remain 1s not covered by essential prime implicants» select the smallest number of prime implicants that cover the remaining 1s 9/16/04 UCB EECS150 D. Culler Fa04 41 Algorithm for two-level simplification (example) 9/16/04 UCB EECS150 D. Culler Fa04 42

Summary Boolean Algebra provides framework for logic simplification De Morgans transforms between gate types Uniting to reduce minterms Karnaugh maps provide visual notion of simplifications Algorithm for producing reduced form. Question: are there programmable logic families that are simpler than FPGAs for the canonical forms? 9/16/04 UCB EECS150 D. Culler Fa04 43