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

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

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

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

CS61c: Representations of Combinational Logic Circuits

Combinational Logic. Review of Combinational Logic 1

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

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

This form sometimes used in logic circuit, example:

CHAPTER III BOOLEAN ALGEBRA

Logic Design. Chapter 2: Introduction to Logic Circuits

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

CHAPTER III BOOLEAN ALGEBRA

Unit 2 Session - 6 Combinational Logic Circuits

Chapter 2: Switching Algebra and Logic Circuits

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

EEE130 Digital Electronics I Lecture #4

Possible logic functions of two variables

Chapter 2 Combinational logic

Combinational Logic Design Principles

211: Computer Architecture Summer 2016

Digital Circuit And Logic Design I. Lecture 3

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

Chapter-2 BOOLEAN ALGEBRA

EECS Variable Logic Functions

Boolean Algebra and Logic Design (Class 2.2 1/24/2013) CSE 2441 Introduction to Digital Logic Spring 2013 Instructor Bill Carroll, Professor of CSE

ENG2410 Digital Design Combinational Logic Circuits

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

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Combinational Logic Circuits Part II -Theoretical Foundations

CPE100: Digital Logic Design I

Switches: basic element of physical implementations

Digital Logic Design. Combinational Logic

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

Administrative Notes. Chapter 2 <9>

Chap 2. Combinational Logic Circuits

Combinational Logic Fundamentals

MC9211 Computer Organization

Combinational Logic (mostly review!)

Chapter 2 Combinational Logic Circuits

Week-I. Combinational Logic & Circuits

Midterm1 Review. Jan 24 Armita

CHAPTER 2 BOOLEAN ALGEBRA

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

L2: Combinational Logic Design (Construction and Boolean Algebra)

Lecture A: Logic Design and Gates

Gate-Level Minimization

ELCT201: DIGITAL LOGIC DESIGN

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

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

CS 226: Digital Logic Design

Chapter 2 Combinational Logic Circuits

CHAPTER1: Digital Logic Circuits Combination Circuits

WEEK 2.1 BOOLEAN ALGEBRA

Signals and Systems Digital Logic System

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

Digital Logic (2) Boolean Algebra

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

Lecture 2 Review on Digital Logic (Part 1)

Chapter 7 Logic Circuits

Number System conversions

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

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

KP/Worksheets: Propositional Logic, Boolean Algebra and Computer Hardware Page 1 of 8

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

UNIT 5 KARNAUGH MAPS Spring 2011

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Review for Test 1 : Ch1 5

L2: Combinational Logic Design (Construction and Boolean Algebra)

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

Slides for Lecture 10

Unit 2 Boolean Algebra

Standard Expression Forms

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

Every time has a value associated with it, not just some times. A variable can take on any value within a range

Boolean Algebra and Digital Logic

Chapter 2 Boolean Algebra and Logic Gates

Chapter 2 Combinational Logic Circuits

Minimization techniques

BOOLEAN ALGEBRA CLASS XII. Presented By : Dinesh Patel PGT CS KV IIT Powai

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

If f = ABC + ABC + A B C then f = AB C + A BC + AB C + A BC + A B C

2 Application of Boolean Algebra Theorems (15 Points - graded for completion only)

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

Digital Logic Appendix A

DIGITAL ELECTRONICS & it0203 Semester 3

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

1. Name the person who developed Boolean algebra

Chapter 2 Combinational Logic Circuits

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

Boolean Algebra, Gates and Circuits

EC-121 Digital Logic Design

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

Chapter 2 Boolean Algebra and Logic Gates

BOOLEAN ALGEBRA TRUTH TABLE

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

L2: Combinational Logic Design (Construction and Boolean Algebra)

Simplifying Logic Circuits with Karnaugh Maps

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Theorem/Law/Axioms Over (.) Over (+)

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

Transcription:

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive March 30, 2010 John Wawrzynek Spring 2010 EECS150 - Lec19-cl1 Page 1 Boolean Algebra I (Representations of Combinational Logic Circuits) Spring 2010 EECS150 - Lec19-cl1 Page 2

Outline Review of three representations for combinational logic: truth tables, graphical (logic gates), and algebraic equations Relationship among the three Adder example Laws of Boolean Algebra Canonical Forms Boolean Simplification Spring 2010 EECS150 - Lec19-cl1 Page 3 Combinational Logic (CL) Defined y i = f i (x0,...., xn-1), where x, y are {0,1}. Y is a function of only X. If we change X, Y will change immediately (well almost!). There is an implementation dependent delay from X to Y. Spring 2010 EECS150 - Lec19-cl1 Page 4

CL Block Example #1 Boolean Equation: y 0 = (x 0 AND not(x 1 )) OR (not(x 0 ) AND x 1 ) y 0 = x 0 x 1 ' + x 0 'x 1 Truth Table Description: Gate Representation: How would we prove that all three representations are equivalent? Spring 2010 EECS150 - Lec19-cl1 Page 5 Boolean Algebra/Logic Circuits Why are they called logic circuits? Logic: The study of the principles of reasoning. The 19th Century Mathematician, George Boole, developed a math. system (algebra) involving logic, Boolean Algebra. His variables took on TRUE, FALSE Later Claude Shannon (father of information theory) showed (in his Master s thesis!) how to map Boolean Algebra to digital circuits: Primitive functions of Boolean Algebra: Spring 2010 EECS150 - Lec19-cl1 Page 6

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. How do we convert from one to the other? Spring 2010 EECS150 - Lec19-cl1 Page 7 CL Block Example #2 4-bit adder: Truth Table Representation: R = A + B, c is carry out In general: 2 n rows for n inputs. 256 rows! Is there a more efficient (compact) way to specify this function? Spring 2010 EECS150 - Lec19-cl1 Page 8

4-bit Adder Example Motivate the adder circuit design by hand addition: Add a1 and b1 as follows: Add a0 and b0 as follows: carry to next stage r = a XOR b = a b c = a AND b = ab r = a b c i co = ab + ac i + bc i Spring 2010 EECS150 - Lec19-cl1 Page 9 In general: r i = a i b i c in 4-bit Adder Example c out = a i c in + a i b i + b i c in = c in (a i + b i ) + a i b i Now, the 4-bit adder: Full adder cell ripple adder Spring 2010 EECS150 - Lec19-cl1 Page 10

4-bit Adder Example Graphical Representation of FAcell r i = a i b i c in c out = a i c in + a i b i + b i c in Alternative Implementation (with 2-input gates): r i = (a i b i ) c in c out = c in (a i + b i ) + a i b i Spring 2010 EECS150 - Lec19-cl1 Page 11 Defined as: Boolean Algebra Spring 2010 EECS150 - Lec19-cl1 Page 12

Logic Functions Do the axioms hold? Ex: communitive law: 0+1 = 1+0? Spring 2010 EECS150 - Lec19-cl1 Page 13 Other logic functions of 2 variables (x,y) Look at NOR and NAND: Theorem: Any Boolean function that can be expressed as a truth table can be expressed using NAND and NOR. Proof sketch: How would you show that either NAND or NOR is sufficient? Spring 2010 EECS150 - Lec19-cl1 Page 14

Laws of Boolean Algebra Duality: A dual of a Boolean expression is derived by interchanging OR and AND operations, and 0s and 1s (literals are left unchanged). Any law that is true for an expression is also true for its dual. Operations with 0 and 1: 1. x + 0 = x x * 1 = x 2. x + 1 = 1 x * 0 = 0 Idempotent Law: 3. x + x = x x x = x Involution Law: 4. (x ) = x Laws of Complementarity: 5. x + x = 1 x x = 0 Commutative Law: 6. x + y = y + x x y = y x Spring 2010 EECS150 - Lec19-cl1 Page 15 Laws of Boolean Algebra (cont.) Associative Laws: (x + y) + z = x + (y + z) x y z = x (y z) Distributive Laws: x (y + z) = (x y) + (x z) x +(y z) = (x + y)(x + z) Simplification Theorems: x y + x y = x x + x y = x (x + y) (x + y ) = x x (x + y) = x DeMorgan s Law: (x + y + z + ) = x y z (x y z ) = x + y +z Theorem for Multiplying and Factoring: (x + y) (x + z) = x z + x y Consensus Theorem: x y + y z + x z = (x + y) (y + z) (x + z) x y + x z = (x + y) (x + z) Spring 2010 EECS150 - Lec19-cl1 Page 16

Proving Theorems via axioms of Boolean Algebra Ex: prove the theorem: x y + x y = x x y + x y = x (y + y ) distributive law x (y + y ) = x (1) x (1) = x identity complementary law Ex: prove the theorem: x + x y = x x + x y = x 1 + x y identity x 1 + x y = x (1 + y) distributive law x (1 + y) = x (1) identity x (1) = x identity Spring 2010 EECS150 - Lec19-cl1 Page 17 DeMorgan s Law (x + y) = x y Exhaustive Proof (x y) = x + y Exhaustive Proof Spring 2010 EECS150 - Lec19-cl1 Page 18

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. How do we convert from one to the other? Spring 2010 EECS150 - Lec19-cl1 Page 19 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 Spring 2010 EECS150 - Lec19-cl1 Page 20

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 ) Spring 2010 EECS150 - Lec19-cl1 Page 21 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. Spring 2010 EECS150 - Lec19-cl1 Page 22

Algebraic Simplification Example Ex: full adder (FA) carry out function (in canonical form): Cout = a bc + ab c + abc + abc Spring 2010 EECS150 - Lec19-cl1 Page 23 Algebraic Simplification Cout = a bc + ab c + abc + abc = a bc + ab c + abc + abc + abc = a bc + abc + ab c + abc + abc = (a + a)bc + ab c + abc + abc = (1)bc + ab c + abc + abc = bc + ab c + abc + abc + abc = bc + ab c + abc + abc + abc = bc + a(b +b)c + abc +abc = bc + a(1)c + abc + abc = bc + ac + ab(c + c) = bc + ac + ab(1) = bc + ac + ab Spring 2010 EECS150 - Lec19-cl1 Page 24

Outline for remaining CL Topics K-map method of two-level logic simplification Multi-level Logic NAND/NOR networks EXOR revisited Spring 2010 EECS150 - Lec19-cl1 Page 25 Algorithmic Two-level Logic Simplication Key tool: The Uniting Theorem: xy + xy = x (y + y) = x (1) = x ab f 00 0 01 0 10 1 11 1 ab g 00 1 01 0 10 1 11 0 f = ab + ab = a(b +b) = a b values change within the on-set rows a values don t change b is eliminated, a remains g = a b +ab = (a +a)b =b b values stay the same a values changes b remains, a is eliminated Spring 2010 EECS150 - Lec19-cl1 Page 26

Boolean Cubes Visual technique for identifying when the Uniting Theorem can be applied Alternative way to represent boolean functions. Filled in nodes represent a 1 in the function. Moving between adjacent nodes represents changing only one input. Sub-cubes of on-nodes can be used for simplification. On-set: filled in nodes, off-set: empty nodes Spring 2010 EECS150 - Lec19-cl1 Page 27 FA carry out: 3-variable cube example a b c cout 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 What about larger sub-cubes? 1 1 0 1 1 1 1 1 ab c + ab c + abc + abc ac + ac + ab = a + ab = a Both b & c change, a is asserted & remains constant. Spring 2010 EECS150 - Lec19-cl1 Page 28

Karnaugh Map Method K-map is an alternative method of representing the TT and to help visual the adjacencies. Note: gray code labeling. Spring 2010 EECS150 - Lec19-cl1 Page 29 Karnaugh Map Method Adjacent groups of 1 s represent product terms Spring 2010 EECS150 - Lec19-cl1 Page 30

K-map Simplification 1. Draw K-map of the appropriate number of variables (between 2 and 6) 2. Fill in map with function values from truth table. 3. Form groups of 1 s. Dimensions of groups must be even powers of two (1x1, 1x2, 1x4,, 2x2, 2x4, ) Form as large as possible groups and as few groups as possible. Groups can overlap (this helps make larger groups) Remember K-map is periodical in all dimensions (groups can cross over edges of map and continue on other side) 4. For each group write a product term. the term includes the constant variables (use the uncomplemented variable for a constant 1 and complemented variable for constant 0) 5. Spring Form 2010Boolean expression EECS150 as - Lec19-cl1 sum-of-products. Page 31 K-maps (cont.) Spring 2010 EECS150 - Lec19-cl1 Page 32

Product-of-Sums Version 1. Form groups of 0 s instead of 1 s. 2. For each group write a sum term. the term includes the constant variables (use the uncomplemented variable for a constant 0 and complemented variable for constant 1) 3. Form Boolean expression as product-of-sums. Spring 2010 EECS150 - Lec19-cl1 Page 33 BCD incrementer example Binary Coded Decimal 0 1 2 3 4 5 6 7 8 9 a b c d w x y z 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 - - - - 1 0 1 1 - - - - 1 1 0 0 - - - - 1 1 0 1 - - - - 1 1 1 0 - - - - 1 1 1 1 - - - - {a,b,c,d} 4 +1 4 {w,x,y,z} Spring 2010 EECS150 - Lec19-cl1 Page 34

BCD Incrementer Example Note one map for each output variable. Function includes don t cares (shown as - in the table). These correspond to places in the function where we don t care about its value, because we don t expect some particular input patterns. We are free to assign either 0 or 1 to each don t care in the function, as a means to increase group sizes. In general, you might choose to write product-ofsums or sum-of-products according to which one leads to a simpler expression. Spring 2010 EECS150 - Lec19-cl1 Page 35 BCD incrementer example 00 01 11 10 00 01 11 10 w = x = y = 00 01 11 10 00 01 11 10 z = Spring 2010 EECS150 - Lec19-cl1 Page 36

BCD Incrementer Example Note one map for each output variable. Function includes don t cares (shown as - in the table). These correspond to places in the function where we don t care about its value, because we don t expect some particular input patterns. We are free to assign either 0 or 1 to each don t care in the function, as a means to increase group sizes. In general, you might choose to write product-ofsums or sum-of-products according to which one leads to a simpler expression. Spring 2010 EECS150 - Lec19-cl1 Page 37 BCD incrementer example 00 01 11 10 00 01 11 10 w = x = y = 00 01 11 10 00 01 11 10 z = Spring 2010 EECS150 - Lec19-cl1 Page 38

Higher Dimensional K-maps Spring 2010 EECS150 - Lec19-cl1 Page 39