05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2.

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

ECE 301 – Digital Electronics Minterm and Maxterm Expansions and Incompletely Specified Functions (Lecture #6) The slides included herein were taken from.
ECE 331 – Digital System Design
ECE 331 – Digital System Design
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Canonical Forms and Logic Miniminization
CSCE 211: Digital Logic Design
Chapter 2: Boolean Algebra and Logic Functions
CHAPTER 2 Boolean Algebra
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
Lecture 2 – Boolean Algebra Lecturer: Amy Ching Date: 21 st Oct 2002.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
ECE 331 – Digital System Design
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
1 Chapter 5 Karnaugh Maps Mei Yang ECG Logic Design 1.
 Seattle Pacific University EE Logic System DesignSOP-POS-1 The Connection: Truth Tables to Functions abcF abcF
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
07 KM Page 1 ECEn/CS 224 Karnaugh Maps. 07 KM Page 2 ECEn/CS 224 What are Karnaugh Maps? A simpler way to handle most (but not all) jobs of manipulating.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
LOGIC GATES & BOOLEAN ALGEBRA
1 Minterm and Maxterm Expressions Definition: a minterm of n variables is a product of the variables in which each appears exactly once in true or complemented.
KFUPM COE 202: Digital Logic Design Combinational Logic Part 1 Courtesy of Dr. Ahmad Almulhem.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
1 EENG 2710 Chapter 2 Algebraic Methods For The Analysis and Synthesis of Logic circuits.
© BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 4: Cost of Logic Circuits and Karnaugh Maps José Nelson Amaral.
CEC 220 Digital Circuit Design SOP and POS forms Friday, January 23 CEC 220 Digital Circuit Design Slide 1 of 17.
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
School of Computer and Communication Engineering, UniMAP DKT 122/3 - DIGITAL SYSTEM I Chapter 4A:Boolean Algebra and Logic Simplification) Mohd ridzuan.
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. De Morgan’s Theorem De Morgan’s Theorem.
DE MORGAN’S THEOREM. De Morgan’s Theorem De Morgan’s Theorem.
1 CS 352 Introduction to Logic Design Lecture 2 Ahmed Ezzat Boolean Algebra and Its Applications Ch-3 + Ch-4.
©2010 Cengage Learning SLIDES FOR CHAPTER 4 APPLICATIONS OF BOOLEAN ALGEBRA MINTERM AND MAXTERM EXPANSIONS Click the mouse to move to the next page. Use.
UNIT 4 APPLICATIONS OF BOOLEAN ALGEBRA MINTERM AND MAXTERM EXPANSIONS Click the mouse to move to the next page. Use the ESC key to exit this chapter. This.
©2010 Cengage Learning SLIDES FOR CHAPTER 3 BOOLEAN ALGEBRA (continued) Click the mouse to move to the next page. Use the ESC key to exit this chapter.
ECE 331 – Digital System Design
De Morgan’s Theorem,.
Chapter 2: Boolean Algebra and Logic Functions
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Computer Organisation
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CHAPTER 2 Boolean Algebra
CS 352 Introduction to Logic Design
CHAPTER 1 : INTRODUCTION
CHAPTER 2 Boolean Algebra This chapter in the book includes:
Basic Digital Logic Systems
Lecture 3 Algebraic Simplification
Princess Sumaya University
Boolean Algebra – Part 1 ECEn 224.
ECE 331 – Digital System Design
Digital Logic and Design
Boolean Algebra.
BASIC & COMBINATIONAL LOGIC CIRCUIT
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION Part (a)
Lecture 4 Minterm and Maxterm
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
Analysis of Logic Circuits Example 1
Laws & Rules of Boolean Algebra
Lecture 2: Combinational Logic Design
Presentation transcript:

05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2

05 BA2 Page 2 ECEn/CS 224 Inversion Inversion or Complement of a Function means all 0 outputs become 1 and all 1 outputs become 0

05 BA2 Page 3 ECEn/CS 224 Inversion DeMorgan’s Laws ( X + Y ) ’ = X ’ Y ’. ( X Y ) ’ = X ’ + Y ’ Proof:

05 BA2 Page 4 ECEn/CS 224 DeMorgan’s Laws For N variables: (X 1 + X 2 + X 3 + …+ X n )’ = X 1 ’ X 2 ’ X 3 ’ … X n ’ ( X 1 X 2 X 3 … X n )’ = X 1 ’ + X 2 ’ + X 3 ’ + …+ X n ’

05 BA2 Page 5 ECEn/CS 224 DeMorgan’s Laws For complex expressions, apply DeMorgan’s Laws successively Example: F = A’B + AB’ F’= (A’B + AB’)’ = (A’B)’(AB’)’ = (A+B’)(A’+B) = AA’+AB+A’B’+BB’ = AB+A’B’

05 BA2 Page 6 ECEn/CS 224 DeMorgan’s Laws Another Example: [ ( a’b + 1)(cd + e’ + 0) ]’ (a’b + 1)’ + (cd + e’ + 0)’ [(a’b)’ 1’] + (cd)’ (e’)’ 0’ (a + b’) 0 + (c’ + d’) e 1 Note: Expression is not simplified

05 BA2 Page 7 ECEn/CS 224 DeMorgan’s Laws - One Step Rule [ f ( X 1, X 2, … X N, 0, 1, +, ) ] ’ = f ( X 1 ’, X 2 ’, … X N ’, 1, 0,, +) 1. Replace all variables with the inverse 2. Replace + with and with + 3. Replace 0 with 1 and 1 with 0 Be careful of hierarchy… This is biggest source of errors Before beginning, surround all AND terms with parens

05 BA2 Page 8 ECEn/CS 224 Canonical Forms

05 BA2 Page 9 ECEn/CS 224 Canonical Forms Is this equality true? –AD + A ’ D ’ + CD ?=? AD + A ’ D ’ + A ’ C Hard to tell –Both look minimized… –But they look different… For many expressions there are multiple minimal forms Miminimizing is not a good way to determine equality

05 BA2 Page 10 ECEn/CS 224 Canonical Forms A canonical form is something written in the standard way –Two expressions which are equal will have identical canonical forms Is there a standard (canonical) way of representing boolean expressions?

05 BA2 Page 11 ECEn/CS 224 Truth Tables  Canonical? f = AD + A’D’ + CDf = AD + A’D’ + A’C Same truth table -two different minimal expressions. Are truth tables canonical forms?

05 BA2 Page 12 ECEn/CS 224 Minterm Expansions Truth table is unique if rows in set order Each row can be numbered Call each row’s AND term a minterm f = AD + A’D’ + A’C f (A,B,C,D) = m0 + m2 + m3 + m4 + m6 + m7 + m9 + m11 + m13 + m15 f (A,B,C,D) =  m(0,2,3,4,6,7,9,11,13,15)

05 BA2 Page 13 ECEn/CS 224 Minterms Are these minterms of 4 variables? abcd yes ab’cd’ yes ab’c no, only 3 literals a’bc’bd no, b more than once

05 BA2 Page 14 ECEn/CS 224 Minterms have names Note: the order of the variables is significant.

05 BA2 Page 15 ECEn/CS 224 Minterm Expansion A minterm expansion is unique f (A,B,C,D) =  m(0,2,3,7) Useful for: –Proving equality –Shorthand for representing boolean expressions

05 BA2 Page 16 ECEn/CS 224 Maxterms are POS Equivalents to Minterms Note that maxterms are the inverse of minterms

05 BA2 Page 17 ECEn/CS 224 Maxterm Expansion Are these maxterms of 4 variables? a + b + c + d yes a + b’ + c + d’ yes a + b’ + d’ no, only 3 literals a’ + b + c’ + a’ + d no, a’ more than once

05 BA2 Page 18 ECEn/CS 224 Maxterm Expansion Any function can be written as a product of maxterms. This is called a: Standard Product of Sums (Standard POS) Use the 0’s for f to write the POS: f (A,B,C) =M 0 M 2 M 3 M 4 f (A,B,C) =  M(0, 2, 3, 4 ) f = (A+B+C)(A+B’+C)(A+B’+C’)(A’+B+C)

05 BA2 Page 19 ECEn/CS 224 Maxterm Expansion Maxterm expansions are useful –For the same things as minterm expansions We will use them when we want POS instead of SOP representations

05 BA2 Page 20 ECEn/CS 224 Minterm / Maxterm Relationships f (A,B,C) = m 1 + m 5 + m 6 + m 7 f (A,B,C) = M 0 M 2 M 3 M 4 For any function, if a minterm is in the Minterm Expansion, the corresponding maxterm is not in the Maxterm Expansion. Makes it easy to convert between SOP and POS

05 BA2 Page 21 ECEn/CS 224 Minterm Example Is this equation true? AD + A’D’ + CD = AD + A’D’ + A’C 1.Write each side as a truth table 2.Compare which minterms each contains Minterm expansions  shorthand truth tables…

05 BA2 Page 22 ECEn/CS 224 Minterm Example Minimize the following: f (A,B,C) = m 1 + m 5 + m 7 1.Write out as SOP f = A’B’C + AB’C + ABC 2.Minimize f = B’C + AC minterm expansions  shorthand expressions…

05 BA2 Page 23 ECEn/CS 224 Maxterm Example Minimize the following: f (A,B,C) = M 1 M 5 M 7 1.Write out as SOP f = (A+B+C’)(A’+B+C’)(A’+B’+C’) 2.Minimize f = (B+C’)(A’+C’) maxterm expansions  shorthand expressions…

05 BA2 Page 24 ECEn/CS 224 Minterm/Maxterm Example Convert the following to POS: F = AB + C 1.Write minterm expansion F = m1+m3+m5+m6+m7 (use truth table if it helps) 2.Convert to maxterm expansion F = M0 M2 M4 3.Write POS from maxterm expansion F = (A+B+C)(A+B’+C)(A’+B+C) 4.Simplify if desired F = (B+C)(A+C)

05 BA2 Page 25 ECEn/CS 224 Algebraic Simplification

05 BA2 Page 26 ECEn/CS 224 Algebraic Simplification Objectives Why Simplify? –Simpler equations  less hardware to implement, faster, cheaper, less power By inspection: f = A’B’C + AB’C + ABC’ + ABC Simplifying: f = A’B’C + AB’C + ABC’ + ABC f = B’C + AB XY’+XY=X 4 3-input AND gates 1 4-input OR gate 2 2-input AND gates 1 2-input OR gate

05 BA2 Page 27 ECEn/CS 224 Hardware Cost Exact cost depends on technology –nMOS, CMOS, TTL, I 2 L, GaAs, FPGA, … In general: –Fewer literals  smaller/faster/lower power circuit –Inverters don’t count Free in some technologies Insignificant difference in others

05 BA2 Page 28 ECEn/CS 224 Algebraic Simplification: Which Theorems To Use? Suggestions: 1.Focus on yellow ones 2.Create duals on right as needed 3.Be familiar with 4

05 BA2 Page 29 ECEn/CS Methods of Algebraic Simplification 1.Combine terms 2.Eliminate terms 3.Eliminate literals 4.Add redundant terms

05 BA2 Page 30 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Use X Y + X Y’ = X ABC’ + A’B’C + A’BC’ = BC’ + A’B’C Eliminate terms Eliminate literals Add redundant terms

05 BA2 Page 31 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Eliminate terms A’B + B ( A’D + C) A’B + A’BD + BC Use X + X Y = X A’B + BC Eliminate literals Add redundant terms

05 BA2 Page 32 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Eliminate terms Eliminate literals Use X + X ’ Y = X + Y A’B + A’B’C’D’ + ABCD’ A’( B + B’C’D’) + ABCD’ A’( B + C’D’) + ABCD’ A’B + A’C’D’ + ABCD’ A’C’D’ + B( A’ +ACD’) A’C’D’ + B( A’ +CD’) A’B + BCD’ + A’C’D’ Add redundant terms

05 BA2 Page 33 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Eliminate terms Eliminate literals Add redundant terms A’B’C + AB’C + ABC A’B’C + AB’C + AB’C + ABC B’C + AC

05 BA2 Page 34 ECEn/CS 224 Proving an Equation is True 1.Construct a truth table for both sides i.Tedious, not very elegant ii.Computers love this method 2.Convert Both Sides to minterm/maxterm expansion 3.Manipulate one side algebraically to equal the other 4.Perform the same operation on both sides

05 BA2 Page 35 ECEn/CS 224 Perform the same operation on both sides Valid Operations –Complement –Construct the duals Invalid Operations –Add a term to both sides (not reversible) –Multiply (AND) both sides by a term (not reversible) –Subtract a term from both sides (subtraction?)

05 BA2 Page 36 ECEn/CS 224 Proving an Equation Add a term to both sides Prove y = z Add 1 to both sides y + 1 = z + 1 Use X + 1 = 1 1 = 1 Therefore y = z But not really, you cannot add an arbitrary term to both sides. This does not prevent you from duplicating an existing term: Y = Z  Y+Y = Z

05 BA2 Page 37 ECEn/CS 224 Proving an Equation Multiply (AND) both sides by a term Prove y = z Multiply both sides by 0 y 0 = z 0 Use X 0 = 0 0 = 0 Therefore y = z But not really, you cannot multiply both sides by an arbitrary term But, you can multiply by a redundant existing term: y z = y y z

05 BA2 Page 38 ECEn/CS 224 Proving an Equation is False Show one combination of values which is false (counter example) Use Boolean algebra manipulation –Reduce to sum of products form –Minimize –Compare the 2 sides –Be careful – some expressions have >1 minimal forms…

05 BA2 Page 39 ECEn/CS 224 Converting English to Boolean Expressions

05 BA2 Page 40 ECEn/CS 224 The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

05 BA2 Page 41 ECEn/CS Identify phrases F = air conditioner should be turned on A = temperature is greater than 75  B = time is between 8a.m. and 5 p.m C = it is not a holiday The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

05 BA2 Page 42 ECEn/CS Identify connective words implied and = The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

05 BA2 Page 43 ECEn/CS Construct a Boolean Expression F = air conditioner should be turned on A = temperature is greater than 75  B = time is between 8a.m. and 5 p.m C = it is not a holiday F = A B C’ The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

05 BA2 Page 44 ECEn/CS Draw the Network F = A B C’ The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday. B A C F

05 BA2 Page 45 ECEn/CS 224 Converting English to Boolean 1. Identify phrases 2. Identify connective words 3. Construct a Boolean Expression 4. Draw the Network

05 BA2 Page 46 ECEn/CS 224 Converting English to Boolean Be careful: Boolean algebra is precise, English is not. The roads will be very slippery if it snows or rains and there is oil on the road. F = A + BC or F = (A + B) C A B C Which is it?

05 BA2 Page 47 ECEn/CS 224 AND/OR vs. OR/AND Logic Forms

05 BA2 Page 48 ECEn/CS 224 AND/OR Logic from Truth Table 1. Write the SOP by inspection from f ABCABC f f = A’B’C +AB’C + ABC’ + ABC

05 BA2 Page 49 ECEn/CS 224 AND/OR Logic from Truth Table 2. Simplify the equation f = A’B’C +AB’C + ABC’ + ABC f = (A + A’) B’C + AB ( C + C’) f = AB + B’C

05 BA2 Page 50 ECEn/CS 224 AND/OR Logic from Truth Table 3. Draw the logic network f = AB + B’C A B C f

05 BA2 Page 51 ECEn/CS 224 OR/AND Logic from Truth Table ABCABC f f ‘ = A’B’C’ + A’BC’ + AB’C’ f = (A + B + C)(A + B’ + C)(A’ + B + C) 1.Write a POS by inspection from f

05 BA2 Page 52 ECEn/CS 224 OR/AND Logic from Truth Table 3. Simplify the equation: f = (B+C)(A+C) 4. Draw the logic network A C B C f

05 BA2 Page 53 ECEn/CS 224 Incompletely Specified Functions

05 BA2 Page 54 ECEn/CS 224 Incompletely Specified Functions wxyzwxyz ABCABC F N1N1 N2N2 Known: N 1 does not generate outputs A B C with values of 101 or 111 The X’s represent don’t care – since those input combos never occur, you don’t care what the output is.

05 BA2 Page 55 ECEn/CS 224 Incompletely Specified Functions f 1 = A’B’C + AB’C’ + ABC’ f 1 = A’B’C + AC’ f 2 = A’B’C + AB’C’ + ABC’ + ABC f 2 = A’B’C + AC’(B’ + B) + AB(C’ + C) f 2 = A’B’C + AC’ + AB Worse than f 1 Multiple ways to choose those X’s when minimizing. Cost of minimal solution will depend on which one chosen.

05 BA2 Page 56 ECEn/CS 224 Incompletely Specified Functions f 1 = A’B’C + AC’ f 3 = A’B’C + AB’C’ + AB’C + ABC’ f 3 = A’C( B + B’) + AB’( C’ + C) f 3 = A’C + AB’ Better than f 1 f 4 = A’B’C + AB’C’ + AB’C + ABC’ + ABC f 4 = (A’ + A)B’C+ AB’(C’ + ’C) + AB(C’ + C) f 4 = B’C+ AB’ + AB = B’C + A Best

05 BA2 Page 57 ECEn/CS 224 Incompletely Specified Functions If the function has n don’t cares –Must solve 2 n truth tables –Ouch A better way will be shown in a later chapter…

05 BA2 Page 58 ECEn/CS 224 Don’t Cares - Minterm Representation Use d 0 … d 7 to represent don’t care minterms F = m 1 + m 4 + m 6 + d 5 + d 7 F =  m( 1, 4, 6) +  d( 5, 7)

05 BA2 Page 59 ECEn/CS 224 Don’t Cares - Maxterm Representation Use D 0 … D 7 to represent don’t care maxterms F = M 0 M 2 M 3 D 5 D 7 F =  M(0, 2, 3)  D(5, 7)