Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 4 Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty.

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Logical Systems Synthesis.
Chapter 2 Logic Circuits.
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.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
Overview Part 1 – Gate Circuits and Boolean Equations
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
Boolean Algebra and Logic Gates
COMBINATIONAL LOGIC CIRCUITS C.L. x1 x2 xn Z Z = F (x1, x2, ……., Xn) F is a Binary Logic (BOOLEAN ) Function Knowing F Allows Straight Forward Direct Implementation.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Edited by Dr. Muhamed Mudawar for COE 202 & EE 200 at KFUPM) Boolean Algebra and Logic Gates.
CSCE 211: Digital Logic Design
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 1.
Boolean Algebra and Logic Simplification. Boolean Addition & Multiplication Boolean Addition performed by OR gate Sum Term describes Boolean Addition.
Chapter 2: Boolean Algebra and Logic Functions
Boolean Algebra. Binary Logic and Gates Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic.
Gate Circuits and Boolean Equations BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
CHAPTER 2 Boolean Algebra
Logic Design CS221 1 st Term Boolean Algebra Cairo University Faculty of Computers and Information.
Binary Logic and Gates Binary variables take on one of two values.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
ECE 331 – Digital System Design
 Seattle Pacific University EE Logic System DesignSOP-POS-1 The Connection: Truth Tables to Functions abcF abcF
1 Representation of Logic Circuits EE 208 – Logic Design Chapter 2 Sohaib Majzoub.
Department of Computer Engineering
Combinational Logic 1.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
Overview Part 1 – Gate Circuits and Boolean Equations
LOGIC GATES & BOOLEAN ALGEBRA
6 - 1 Simplification Theorems Useful for simplification of expressions & therefore simplification of the logic network which results. XY + XY' = ( X +
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 6 – Canonical Forms.
1 Boolean Algebra  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean.
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.
ece Parity Used to check for errors Can be either ODD or EVEN Left most bit used as the indicator For EVEN, insert a 0 or a 1 so as to make the.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Boolean Algebra – II. Outline  Basic Theorems of Boolean Algebra  Boolean Functions  Complement of Functions  Standard Forms.
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS.
A. Abhari CPS2131 Chapter 2: Boolean Algebra and Logic Gates Topics in this Chapter: Boolean Algebra Boolean Functions Boolean Function Simplification.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
© BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 1.
Module –I Switching Function
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates.
Module 5.  In Module 3, you have learned the concept of Boolean Algebra which consists of binary variables and binary operator.  A binary variable x,
Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 1.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
Boolean Algebra. BOOLEAN ALGEBRA Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0).
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
1 CS 352 Introduction to Logic Design Lecture 2 Ahmed Ezzat Boolean Algebra and Its Applications Ch-3 + Ch-4.
CHAPTER 2 Boolean algebra and Logic gates
Canonical Forms BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Boolean Algebra and Logic Gates COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Overview Part 1 – Gate Circuits and Boolean Equations
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CS 105 Digital Logic Design
Gate Circuits and Boolean Equations
CHAPTER 2 Boolean Algebra This chapter in the book includes:
Princess Sumaya University
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Boolean Algebra.
Boolean Algebra.
Chapter 2 Boolean Algebra and Logic Gate
Presentation transcript:

Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 4 Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty of Engineering Zagazig University

Boolean Algebra and Logic Gates Course Web Page

Announcements  Only 2 Students > 10 in Quizz.  1- Abdallah Salah Eldeen (13)  2- Mohamed Nagi Mahmoud (12)  Only 5 <2 Students < 10 in Quizz.  1- Mohamed Samir Abd-Ellatif (9)  2-Heba Allah Abdo Ali (8)  Every Lec. There will be a Quizz Boolean Algebra and Logic Gates 3

Lec. # 4 Binary Logic & Gates (Contd.) Boolean Algebra and Logic Gates 4

Boolean Algebra and Logic Gates Commutative Associative Distributive DeMorgan’s X. 1 X = X. 00 = X. XX = 0 = Boolean Algebra X + YY + X = (X + Y)Z + X + (YZ)Z) += X(Y + Z)XYXZ += X + YX. Y = XYYX = (XY)ZX(YX(YZ)Z) = X+ YZ(X + Y)(X + Z)= X. YX + Y = X + 0 X = + X 11 = X + XX = 1 = X = X  An algebraic structure defined by a set B = {0, 1}, together with two binary operators (+ and ·) and a unary operator ( ) Idempotence Complement Involution Identity element

Boolean Algebra and Logic Gates 6 Some Properties of Boolean Algebra  Boolean Algebra is defined in general by a set B that can have more than two values  A two-valued Boolean algebra is also know as Switching Algebra. The Boolean set B is restricted to 0 and 1. Switching circuits can be represented by this algebra.  Sometimes, the dot symbol ‘  ’ (AND operator) is not written when the meaning is clear.

Boolean Algebra and Logic Gates 7 Boolean Operator Precedence  The order of evaluation is: 1.Parentheses 2.NOT 3.AND 4.OR  Consequence: Parentheses appear around OR expressions  Example: F = A(B + C)(C + D)

Boolean Algebra and Logic Gates 8 Boolean Algebraic Proof – Example 1  A + A · B = A (Absorption Theorem) Proof StepsJustification A + A · B = A · 1 + A · B Identity element: A · 1 = A = A · ( 1 + B) Distributive = A · B = 1 = A Identity element  Our primary reason for doing proofs is to learn: Careful and efficient use of the identities and theorems of Boolean algebra, and How to choose the appropriate identity or theorem to apply to make forward progress, irrespective of the application.

Boolean Algebra and Logic Gates 9  AB + AC + BC = AB + AC (Consensus Theorem) Proof StepsJustification = AB + AC + BC = AB + AC + 1 · BCIdentity element = AB + AC + (A + A) · BCComplement = AB + AC + ABC + ABCDistributive = AB + ABC + AC + ACBCommutative = AB · 1 + ABC + AC · 1 + ACBIdentity element = AB (1+C) + AC (1 + B)Distributive = AB. 1 + AC. 11+X = 1 = AB + ACIdentity element Boolean Algebraic Proof – Example 2

Boolean Algebra and Logic Gates 10 Useful Theorems  Minimization X Y + X Y = Y  Absorption X + X Y = X  Simplification X + X Y = X + Y  DeMorgan’s  X + Y = X · Y  Minimization (dual) (X+Y)(X+Y) = Y  Absorption (dual) X · (X + Y) = X  Simplification (dual) X · (X + Y) = X · Y  DeMorgan’s (dual)  X · Y = X + Y

Boolean Algebra and Logic Gates 11 Truth Table to Verify DeMorgan’s XYX·YX·YX+YXY X · YX·YX·YX+Y X + Y = X · Y X · Y = X + Y  Generalized DeMorgan’s Theorem: X 1 + X 2 + … + X n = X 1 · X 2 · … · X n X 1 · X 2 · … · X n = X 1 + X 2 + … + X n

Boolean Algebra and Logic Gates 12 Complementing Functions  Use DeMorgan's Theorem: 1.Interchange AND and OR operators 2.Complement each constant and literal  Example: Complement F = F = (x + y + z)(x + y + z)  Example: Complement G = (a + bc)d + e G = (a (b + c) + d) e x  zyzyx

Boolean Algebra and Logic Gates 13 Expression Simplification  An application of Boolean algebra  Simplify to contain the smallest number of literals (variables that may or may not be complemented) = AB + ABCD + A C D + A C D + A B D = AB + AB(CD) + A C (D + D) + A B D = AB + A C + A B D = B(A + AD) +AC = B (A + D) + A C (has only 5 literals)  DCBADCADBADCABA

Boolean Algebra and Logic Gates 14 Next … Canonical Forms  Minterms and Maxterms  Sum-of-Minterm (SOM) = Sum-of-Products (SOP)  Canonical Sum  Product-of-Maxterm(POM)= Product of Sum (POS)  Canonical Form

 Representation of Complements of Functions  Conversions between Representations Boolean Algebra and Logic Gates 15

Boolean Algebra and Logic Gates 16 Minterms  Minterms are AND terms with every variable present in either true or complemented form.  Given that each binary variable may appear normal (e.g., x) or complemented (e.g., ), there are 2 n minterms for n variables.  Example: Two variables (X and Y) produce 2 x 2 = 4 combinations: (both normal) (X normal, Y complemented) (X complemented, Y normal) (both complemented)  Thus there are four minterms of two variables. YX XY YX YX x

Boolean Algebra and Logic Gates 17 Maxterms  Maxterms are OR terms with every variable in true or complemented form.  Given that each binary variable may appear normal (e.g., x) or complemented (e.g., x), there are 2 n maxterms for n variables.  Example: Two variables (X and Y) produce 2 x 2 = 4 combinations: (both normal) (x normal, y complemented) (x complemented, y normal) (both complemented) YX  YX  YX  YX 

Boolean Algebra and Logic Gates 18  Two variable minterms and maxterms.  The minterm m i should evaluate to 1 for each combination of x and y.  The maxterm is the complement of the minterm Minterms & Maxterms for 2 variables xyIndexMintermMaxterm 000m 0 = x yM 0 = x + y 011m 1 = x yM 1 = x + y 102m 2 = x yM 2 = x + y 113m 3 = x yM 3 = x + y

Boolean Algebra and Logic Gates 19 Minterms & Maxterms for 3 variables M 3 = x + y + zm 3 = x y z3110 M 4 = x + y + zm 4 = x y z4001 M 5 = x + y + zm 5 = x y z5101 M 6 = x + y + zm 6 = x y z y x z M 7 = x + y + zm 7 = x y z7 M 2 = x + y + zm 2 = x y z2 M 1 = x + y + zm 1 = x y z1 M 0 = x + y + zm 0 = x y z0 MaxtermMintermIndex Maxterm M i is the complement of minterm m i M i = m i and m i = M i

Boolean Algebra and Logic Gates 20 Purpose of the Index  Minterms and Maxterms are designated with an index  The index number corresponds to a binary pattern  The index for the minterm or maxterm, expressed as a binary number, is used to determine whether the variable is shown in the true or complemented form  For Minterms: ‘1’ means the variable is “Not Complemented” and ‘0’ means the variable is “Complemented”.  For Maxterms: ‘0’ means the variable is “Not Complemented” and ‘1’ means the variable is “Complemented”.

Boolean Algebra and Logic Gates 21 Standard Order  All variables should be present in a minterm or maxterm and should be listed in the same order (usually alphabetically)  Example: For variables a, b, c: Maxterms (a + b + c), (a + b + c) are in standard order However, (b + a + c) is NOT in standard order (a + c) does NOT contain all variables Minterms (a b c) and (a b c) are in standard order However, (b a c) is not in standard order (a c) does not contain all variables

Boolean Algebra and Logic Gates 22 Sum-Of-Product (SOP)  Sum-Of-Product (SOP) = Canonical Sum: Sum of minterms of entries that evaluate to ‘1’ xyzFMinterm m 1 = x y z m 6 = x y z 1111m 7 = x y z F = m 1 + m 6 + m 7 = ∑ (1, 6, 7) = x y z + x y z + x y z Focus on the ‘1’ entries

Sum-Of-Product (SOP) F = m1 + m6 + m7 = x y z + x y z + x y z Boolean Algebra and Logic Gates 23 Canonical Sum

Sum-Of-Product (SOP) F =∑ (1, 6, 7) Boolean Algebra and Logic Gates 24 On-Set

Boolean Algebra and Logic Gates 25 + a b c d Sum-Of-Products Examples  F(a, b, c, d) = ∑(2, 3, 6, 10, 11)  F(a, b, c, d) = m 2 + m 3 + m 6 + m 10 + m 11  G(a, b, c, d) = ∑(0, 1, 12, 15)  G(a, b, c, d) = m 0 + m 1 + m 12 + m 15 + a b c da b c d+ a b c d a b c d+ a b c d

Boolean Algebra and Logic Gates 26 Product-Of-Sum (POS)  Product-Of-Sum (POS) = Canonical Product: Product of maxterms of entries that evaluate to ‘0’ xyzFMaxterm M 2 = (x + y + z) M 4 = (x + y + z) M 6 = (x + y + z) 1111 Focus on the ‘0’ entries F = M 2 ·M 4 ·M 6 = ∏ (2, 4, 6) = (x+y+z) (x+y+z) (x+y+z)

Boolean Algebra and Logic Gates 27 Product-Of-Sum (POS)  Canonical Product: xyzFMaxterm M 2 = (x + y + z) M 4 = (x + y + z) M 6 = (x + y + z) 1111 F = M 2 ·M 4 ·M 6 = (x+y’+z) (x’+y+z) (x’+y’+z)

Boolean Algebra and Logic Gates 28 Product-Of-Sum (POS)  Off-Set xyzFMaxterm M 2 = (x + y + z) M 4 = (x + y + z) M 6 = (x + y + z) 1111 F = M 2 ·M 4 ·M 6 = ∏ (2, 4, 6)

Boolean Algebra and Logic Gates 29  F(a, b, c, d) = ∏(1, 3, 6, 11)  F(a, b, c, d) = M 1 · M 3 · M 6 · M 11  G(a, b, c, d) = ∏(0, 4, 12, 15)  G(a, b, c, d) = M 0 · M 4 · M 12 · M 15 Product-Of-Sum Examples (a+b+c+d)

Boolean Algebra and Logic Gates 30 Observations  We can implement any function by "ORing" the minterms corresponding to the ‘1’ entries in the function table. A minterm evaluates to ‘1’ for its corresponding entry.  We can implement any function by "ANDing" the maxterms corresponding to ‘0’ entries in the function table. A maxterm evaluates to ‘0’ for its corresponding entry.  The same Boolean function can be expressed in two canonical ways: Sum-of-Products (SOP) and Product-of-Sum (POS).  If a Boolean function has fewer ‘1’ entries then the SOP canonical form will contain fewer literals than POS. However, if it has fewer ‘0’ entries then the POS form will have fewer literals than SOP.

Boolean Algebra and Logic Gates 31 Converting to Sum-of-Products Form  A function that is not in the Sum-of-Minterms form can be converted to that form by means of a truth table  Consider F = y + x z xyzFMinterm 0001m 0 = x y z 0011m 1 = x y z 0101m 2 = x y z m 4 = x y z 1011m 5 = x y z F = ∑(0, 1, 2, 4, 5) = m 0 + m 1 + m 2 + m 4 + m 5 = x y z + x y z + x y z + x y z + x y z

Boolean Algebra and Logic Gates 32 Converting to Product-of-Sum Form  A function that is not in the Product-of-Minterms form can be converted to that form by means of a truth table  Consider again: F = y + x z xyzFMinterm M 3 = (x+y+z) M 6 = (x+y+z) 1110M 7 = (x+y+z) F = ∏(3, 6, 7) = M 3 · M 6 · M 7 = (x+y+z) (x+y+z) (x+y+z)

Boolean Algebra and Logic Gates 33 Conversions Between Canonical Forms F = m 1 +m 2 +m 3 +m 5 +m 7 = ∑(1, 2, 3, 5, 7) = x y z + x y z + x y z + x y z + x y z F = M 0 · M 4 · M 6 = ∏(0, 4, 6) = (x+y+z)(x+y+z)(x+y+z) xyzFMintermMaxterm 0000M 0 = (x + y + z) 0011m 1 = x y z 0101m 2 = x y z 0111m 3 = x y z 1000M 4 = (x + y + z) 1011m 5 = x y z 1100M 6 = (x + y + z) 1111m 7 = x y z

Boolean Algebra and Logic Gates 34 Algebraic Conversion to Sum-of-Products  Expand all terms first to explicitly list all minterms  AND any term missing a variable v with (v + v)  Example 1: f = x + x y(2 variables) f = x (y + y) + x y f = x y + x y + x y f = m 3 + m 2 + m 0 = ∑(0, 2, 3)  Example 2: g = a + b c(3 variables) g = a (b + b)(c + c) + (a + a) b c g = a b c + a b c + a b c + a b c + a b c + a b c g = a b c + a b c + a b c + a b c + a b c g = m 1 + m 4 + m 5 + m 6 + m 7 = ∑ (1, 4, 5, 6, 7)

Boolean Algebra and Logic Gates 35 Algebraic Conversion to Product-of-Sum  Expand all terms first to explicitly list all maxterms  OR any term missing a variable v with v · v  Example 1: f = x + x y(2 variables) Apply 2 nd distributive law: f = (x + x) (x + y) = 1 · (x + y) = (x + y) = M 1  Example 2: g = a c + b c + a b(3 variables) g = (a c + b c + a) (a c + b c + b)(distributive) g = (c + b c + a) (a c + c + b)(x + x y = x + y) g = (c + b + a) (a + c + b)(x + x y = x + y) g = (a + b + c) (a + b + c) = M 5. M 2 = ∏ (2, 5)

Boolean Algebra and Logic Gates 36 Function Complements  The complement of a function expressed as a sum of products is constructed by selecting the minterms missing in the sum-of-products canonical form  Alternatively, the complement of a function expressed by a Sum of Products form is simply the Product of Sum with the same indices  Example: Given F(x, y, z) = ∑ (1, 3, 5, 7) F(x, y, z) = ∑ (0, 2, 4, 6) F(x, y, z) = ∏ (1, 3, 5, 7)

Boolean Algebra and Logic Gates 37 Summary of Minterms and Maxterms  There are 2 n minterms and maxterms for Boolean functions with n variables.  Minterms and maxterms are indexed from 0 to 2 n – 1  Any Boolean function can be expressed as a logical sum of minterms and as a logical product of maxterms  The complement of a function contains those minterms not included in the original function  The complement of a sum-of-products is a product-of- sum with the same indices

Boolean Algebra and Logic Gates 38  Standard Sum-of-Products (SOP) form: equations are written as an OR of AND terms  Standard Product-of-Sums (POS) form: equations are written as an AND of OR terms  Examples: SOP: POS:  These “mixed” forms are neither SOP nor POS Standard Forms B C B A C B A   C · ) C B (A · B) (A  C) (A C) B (A  B) (A C A C B A 

Boolean Algebra and Logic Gates 39 Standard Sum-of-Products (SOP)  A sum of minterms form for n variables can be written down directly from a truth table. Implementation of this form is a two-level network of gates such that: The first level consists of n-input AND gates The second level is a single OR gate  This form often can be simplified so that the corresponding circuit is simpler.

Boolean Algebra and Logic Gates 40  A Simplification Example:  Writing the minterm expression: F = A B C + A B C + A B C + ABC + ABC  Simplifying: F = A B C + A (B C + B C + B C + B C) F = A B C + A (B (C + C) + B (C + C)) F = A B C + A (B + B) F = A B C + A F = B C + A  Simplified F contains 3 literals compared to 15 Standard Sum-of-Products (SOP) )7,6,5,4,1()C,B,A(F  

Boolean Algebra and Logic Gates 41 AND/OR Two-Level Implementation  The two implementations for F are shown below It is quite apparent which is simpler!

Boolean Algebra and Logic Gates 42 SOP and POS Observations  The previous examples show that: Canonical Forms (Sum-of-minterms, Product-of-Maxterms), or other standard forms (SOP, POS) differ in complexity Boolean algebra can be used to manipulate equations into simpler forms Simpler equations lead to simpler implementations  Questions: How can we attain a “simplest” expression? Is there only one minimum cost circuit? The next part will deal with these issues