1 Digital Design Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Types of Logic Circuits
Chapter 2 Logic Circuits.
Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 4 Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty.
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.
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Boolean Algebra and Logic Gates
Logic Functions and their Representation. Slide 2 Combinational Networks x1x1 x2x2 xnxn f.
CSCE 211: Digital Logic Design
Chapter Two Boolean Algebra and Logic Gate
Chapter 2: Boolean Algebra and Logic Functions
Gate Circuits and Boolean Equations BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Computer Organization
Chapter 2 Boolean Algebra and Logic Gates
Boolean Algebra Boolean algebra Boolean algebra, like any other deductive mathematical system, may be defined with –a set of elements, –a set of operators,
CHAPTER 2 Boolean Algebra
Boolean Algebra – I. Outline  Introduction  Digital circuits  Boolean Algebra  Two-Valued Boolean Algebra  Boolean Algebra Postulates  Precedence.
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
Discrete Mathematics and Its Applications.  The English mathematician George Boole ( ) sought to give symbolic form to Aristotle's system of.
Boolean Algebra 1854, George Boole created a two valued algebraic system which is now called Boolean algebra. 1938, Claude Shannon adapted Boolean algebra.
Module 4.  Boolean Algebra is used to simplify the design of digital logic circuits.  The design simplification are based on: Postulates of Boolean.
Chapter 4 Combinational Logic Design Principles. Overview Objectives -Define combinational logic circuit -Analysis of logic circuits (to describe what.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
LOGIC GATES & BOOLEAN ALGEBRA
6 - 1 Simplification Theorems Useful for simplification of expressions & therefore simplification of the logic network which results. XY + XY' = ( X +
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.
Chap 2. Combinational Logic Circuits
Discrete Mathematics CS 2610 September Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B.
A. Abhari CPS2131 Chapter 2: Boolean Algebra and Logic Gates Topics in this Chapter: Boolean Algebra Boolean Functions Boolean Function Simplification.
Lecture 4 Boolean Algebra. Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements.
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.
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2002 Topic2: DeMorgan Laws José Nelson Amaral.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Lecture 18: Boolean Algebra Boolean Functions. w = Chris is allowed to watch television x = Chris's homework is finished y = it is a school night z =
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
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).
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
Boolean Algebra.
1 CS 352 Introduction to Logic Design Lecture 2 Ahmed Ezzat Boolean Algebra and Its Applications Ch-3 + Ch-4.
Basic Laws, theorems, and postulates of Boolean Algebra
©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.
CHAPTER 2 Boolean algebra and Logic gates
Boolean Algebra & Logic Gates
Chapter 2: Boolean Algebra and Logic Functions
Unit 2 Boolean Algebra.
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
CHAPTER 2 Boolean Algebra This chapter in the book includes:
SLIDES FOR CHAPTER 2 BOOLEAN ALGEBRA
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Boolean Algebra.
Boolean Algebra.
Lecture 14: Boolean Algebra
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
Chapter 2 Introduction to Logic Circuits
Introductory Concepts
Chapter 4 Combinational Logic Design Principles. Overview Objectives -Define combinational logic circuit -Analysis of logic circuits (to describe what.
Presentation transcript:

1 Digital Design Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur

Switching Algebra and Its Applications 2

Algebraic System/Structure Closure: A set S is said to be closed wrt. A binary operator if, for every pair of elements of S, the binary operator specifies a rule for obtaining an element of S. –Ex: Set of Natural numbers closed under addition, but not under subtraction Associative Law: A binary operator * on a set S is associative if: (x*y)*z=x*(y*z) for all x, y, z in S –Ex: Operator + and set of Natural numbers, (a+b)+c=a+(b+c) for all a, b, c in S 3

Algebraic System/Structure Commutative Law: A binary operator * on a set S is commutative if: x*y=y*x for all x, y in S –Set of Natural numbers, binary operation ‘-’ is not commutative! Identity element: A set S is said to have an identity element, e, wrt. a binary operation * on S if: x*e=x for all x in S –Ex: The element 0 is an identity element, binary operation +, set of Integers {…, -3, -2, -1, 0, 1, 2, 3, …} –Ex: What is the identity for the set of Natural numbers? 4

Algebraic System/Structure Inverse: A set S with the identity element e, is said to have an inverse (also called complement) wrt. a binary operator * if: x * y = e for all x in S. y is called the inverse of x. Ex: In the set of integers I with e=0, the inverse of an element a is (-a) since a + (-a) = 0 Distributive Law: If * and. are two binary operators on a set S, * is said to be distributive over. whenever: x*(y.z)=(x*y).(x*z) 5

6 Basic Properties Idempotency: x + x = x x. x = x Perfect induction: proving a theorem by verifying every combination of values that the variables may assume Proof of x + x = x: = 1 and = 0 If x is a switching variable, then: x + 1 = 1 x. 0 = 0 x + 0 = x x. 1 = x Commutativity: x + y = y + x x. y = y. x

7 Basic Properties (Contd.) Associativity: (x + y) + z = x + (y + z) (x. y). z = x. (y. z) Complementation: x + x’ = 1 x. x’ = 0 Distributivity: x. (y + z) = x. y + x. z x + y. z = (x + y). (x + z) Proof by perfect induction using a truth table:

8 Basic Properties (Contd.) Principle of Duality: Preceding properties grouped in pairs One statement can be obtained from the other by interchanging operations OR and AND and constants 0 and 1 The two statements are said to be dual of each other This principle stems from the symmetry of the postulates and definitions of switching algebra w.r.t. the two operations and constants Implication: necessary to prove only one of each pair of statements

9 Switching Expressions and Their Manipulation Switching expression: combination of finite number of switching variables and constants via switching operations (AND, OR, NOT) Any constant or switching variable is a switching expression If T 1 and T 2 are switching expressions, so are T 1 ’, T 2 ’, T 1 +T 2 and T 1 T 2 No other combination of constants and variables is a switching expression Absorption law: x + xy = x x(x + y) = x Proof: x + xy = x1 + xy [basic property] = x(1 + y) [distributivity] = x1 [commutativity and basic property] (Note we write in the law y + 1 = y, so we apply commutativity) = x [basic property]

10 Laws of Switching Algebra Another important law: x + x’y = x + y x(x’ + y) = xy Proof: x + x’y = (x + x’)(x + y) [distributivity] = 1(x + y) [complementation] = x + y [commutativity and basic property] Consensus theorem: xy + x’z + yz = xy + x’z (x + y)(x’ + z)(y + z) = (x + y)(x’ + z) Proof: xy + x’z + yz = xy + x’z + yz1 = xy + x’z + yz(x+x’) = xy(1 + z) + x’z(1 + y) = xy + x’z

11 Switching Expression Simplification Literal: variable or its complement Redundant literal: if value of switching expression is independent of literal x i then x i is said to be redundant Example: Simplify T(x,y,z) = x’y’z + yz + xz x’y’z + yz + xz = z(x’y’ + y + x) = z(x’ + y + x) = z(y + 1) = z1 = z Thus, literals x and y are redundant in T(x,y,z) Important note: Since no inverse operations are defined in Switching Algebra, cancellations are not allowed A + B = A + C does not imply B = C Counterexample: A = B = 1 and C = 0 Similarly, AB = AC does not imply B = C

12 De Morgan’s Theorems Involution: (x’)’ = x De Morgan’s theorem for two variables: (x + y)’ = x’. y’ (x. y)’ = x’ + y’ Proof by perfect induction: De Morgan’s theorems for n variables: [f(x 1, x 2, …, x n, 0, 1, +,.)]’ = f(x 1 ’, x 2 ’, …, x n ’, 1, 0,., +)

13 Simplification Examples Example: Simplify T(x,y,z) = (x + y)[x’(y’ + z’)]’ + x’y’ + x’z’ (x + y)[x’(y’ + z’)]’ + x’y’ + x’z’ = (x + y)(x + yz) + x’y’ + x’z’ = (x + xyz + yx + yz) + x’y’ + x’z’ = x + yz + x’y’ + x’z’ = x + yz + y’ + z’ = x + z + y’ + z’ = x + y’ + 1 = 1 Thus, T(x,y,z) = 1, independently of the values of the variables Example: Prove xy + x’y’ + yz = xy + x’y’ + x’z From consensus theorem, x’z can be added to LHS Consensus theorem can be applied again to first, third and fourth terms in xy + x’y’ + yz + x’z to eliminate yz and reduce it to RHS

14 Simplification Examples Example: Simplify T(x,y,z) = (x + y)[x’(y’ + z’)]’ + x’y’ + x’z’ (x + y)[x’(y’ + z’)]’ + x’y’ + x’z’ = (x + y)(x + yz) + x’y’ + x’z’ = (x + xyz + yx + yz) + x’y’ + x’z’ = x + yz + x’y’ + x’z’ = x + yz + y’ + z’ = x + z + y’ + z’ = x + y’ + 1 = 1 Thus, T(x,y,z) = 1, independently of the values of the variables Example: Prove xy + x’y’ + yz = xy + x’y’ + x’z LHS=xy+(x’y’+yz)=xy+(x’y’+yz+x’z)=xy+x’(y’+z)+yz=xy+x’y’+x’z

15 Switching Functions Let T(x 1, x 2, …, x n ) be a switching expression: Since each variable can assume 0 or 1, 2 n combinations are possible Determining the value of an expression for an input combination: Example: T(x,y,z) = x’z + xz’ + x’y’ T(0,0,1) = 0’1 + 01’ + 0’0’ = 1 Truth table for T What is the Truth Table for T 1 (x,y,z)=x’z+xz’+y’z’?

16 Switching Function (Contd.) Switching function f(x 1, x 2, …, x n ): values assumed by an expression for all combinations of variables x 1, x 2, …, x n Complement function: f’(x 1, x 2, …, x n ) assumes value 0 (1) whenever f(x 1, x 2, …, x n ) assumes value 1 (0) Logical sum of two functions: f(x 1, x 2, …, x n ) + g(x 1, x 2, …, x n ) = 1 for every combination in which either f or g or both equal 1 Logical product of two functions: f(x 1, x 2, …, x n ). g(x 1, x 2, …, x n ) = 1 for every combination for which both f and g equal 1

17 Switching Function (Contd.) Illustrating sum, product and complementation of functions:

18 Simplification of Expressions Example: Simplify T(x,y,z) = A’C’ + ABD + BC’D + AB’D’ + ABCD’ Example: Simplify T(A,B,C,D) = A’B + ABD + AB’CD’ + BC

19 Simplification of Expressions Example: Simplify T(x,y,z) = A’C’ + ABD + BC’D + AB’D’ + ABCD’ Apply consensus theorem to first three terms -> BC’D is redundant Apply distributive law to last two terms -> AD’(B’ + BC) -> AD’(B’ + C) Thus, T = A’C’ + A[BD + D’(B’ + C)] Example: Simplify T(A,B,C,D) = A’B + ABD + AB’CD’ + BC A’B + ABD = B(A’ + AD) = B(A’ + D) AB’CD’ + BC = C(B + AB’D’) = C(B + AD’) Thus, T = A’B + BD + ACD’ + BC Expand BC to (A + A’)BC to obtain T = A’B + BD + ACD’ + ABC + A’BC From absorption law: A’B + A’BC = A’B From consensus theorem: BD + ACD’ + ABC = BD + ACD’ Thus, T = A’B + BD + ACD’

20 Canonical Forms Deriving an expression from a truth table: Find the sum of all terms that correspond to combinations for which function is 1 Each term is a product of the variables on which the function depends Variable x i appears in uncomplemented (complemented) form in the product if has value 1 (0) in the combination Truth table for f = x’y’z’ + x’yz’ + x’yz + xyz’ + xyz

21 Canonical Sum-of-products Minterm: a product term that contains each of the n variables as factors in either complemented or uncomplemented form It assumes value 1 for exactly one combination of variables Canonical sum-of-products: sum of all minterms derived from combinations for which function is 1 Also called disjunctive normal expression Compact representation of switching functions: (0,2,3,6,7)

22 Canonical Product-of-sums Maxterm: a sum term that contains each of the n variables in either complemented or uncomplemented form It assumes value 0 for exactly one combination of variables Variable x i appears in uncomplemented (complemented) form in the sum if it has value 0 (1) in the combination Canonical product-of-sums: product of all maxterms derived from combinations for which function is 0 Also called conjunctive normal expression Compact representation of switching functions: (1,4,5) f = (x + y + z’)(x’ + y + z)(x’ + y + z’)

23 Shannon’s Expansion to Obtain Canonical Forms Shannon’s expansion theorem: f(x 1, x 2, …, x n ) = x 1. f(1, x 2, …, x n ) + x 1 ’. f(0, x 2, …, x n ) f(x 1, x 2, …, x n ) = [x 1 + f(0, x 2, …, x n )]. [ x 1 ’ + f(1, x 2, …, x n )] Proof by perfect induction: Plug in x 1 = 1 and then x 1 = 0 to reduce RHS to LHS Shannon’s expansion around two variables: f(x 1, x 2, …, x n ) = x 1 x 2 f(1, 1, x 3,…, x n ) + x 1 x 2 ’f(1, 0, x 3, …, x n ) + x 1 ’x 2 f(0, 1, x 3, …, x n ) + x 1 ’x 2 ’f(0, 0, x 3, …, x n ) Similar Shannon’s expansion around all n variables yields the canonical sum-of-products Repeated expansion of the dual form yields the canonical product-of-sums

24 Simpler Procedure for Canonical Sum-of- products 1.Examine each term: if it is a minterm, retain it; continue to next term 2.In each product which is not a minterm: check the variables that do not occur; for each x i that does not occur, multiply the product by (x i + x i ’) 3.Multiply out all products and eliminate redundant terms Example: T(x,y,z) = x’y + z’ + xyz = x’y(z + z’) + (x + x’)(y + y’)z’ + xyz = x’yz + x’yz’ + xyz’ + xy’z’ + x’yz’ + x’y’z’ + xyz = x’yz + x’yz’ + xyz’ + xy’z’ + x’y’z’ + xyz Canonical product-of-sums obtained in a dual manner Example: T = x’(y’ + z) = (x’ + yy’ + zz’)(y’ + z + xx’) = (x’ + y + z)(x’ + y + z’)(x’ + y’ + z)(x’ + y’ + z’)(x + y’ + z)(x’ + y’ + z) = (x’ + y + z)(x’ + y + z’)(x’ + y’ + z)(x’ + y’ + z’)(x + y’ + z)

25 Transforming One Form to Another Example: Find the canonical product-of-sums for T(x,y,z) = x’y’z’ + x’y’z + x’yz + xyz + xy’z + xy’z’ T = (T’)’ = [(x’y’z’ + x’y’z + x’yz + xyz + xy’z + xy’z’)’]’ Complement T’ consists of minterms not contained in T. Thus, T = [x’yz’ + xyz’]’ = (x + y’ + z)(x’ + y’ + z) Canonical forms are unique Two switching functions are equivalent if and only if their corresponding canonical forms are identical

26 Functional Properties Let binary constant a i be the value of function f(x 1, x 2, …, x n ) for the combination of variables whose decimal code is i. Thus, f(x 1, x 2, …, x n ) = a 0 x 1 ’x 2 ’…x n ’ + a 1 x 1 ’x 2 ’…x n + … + a r x 1 x 2 …x n Factor a i is set to 1 (0) if the corresponding minterm is (is not) in the canonical form Since there are 2 n coefficients, each of which can have two values, 0 and 1, there are 2^2 n possible switching functions of n variables Example: Canonical sum-of-products form for two variables f(x,y) = a 0 x’y’ + a 1 x’y + a 2 xy’ + a 3 xy There are 2^2 2 functions corresponding to the 16 possible assignments of 0’s and 1’s to a 0, a 1, a 2, and a 3

27 List of Functions of Two Variables

28 The Exclusive-OR Operation Exclusive-OR: modulo-2 addition, i.e., A B = 1 if either A or B is 1, but not both Commutativity: A B = B A Associativity: (A B) C = A (B C) = A B C Distributivity: (AB) (AC) = A(B C) If A B = C, then A C = B B C = A A B C = 0 Exclusive-OR of an even (odd) number of elements, whose value is 1, is 0 (1)

29 Functionally Complete Operations Every switching function can be expressed in canonical form consisting of a finite number of switching variables, constants and operations +,., ’ A set of operations is functionally complete (or universal) if and only if every switching function can be expressed by operations from this set Example: Set {+,., ’} Example: Set {+, ’} since using De Morgan’s theorem, x. y = (x’ + y’)’. Thus, + and ’ can replace the. in any switching function Example: Set {., ’} for similar reasons Example: NAND since NAND(x,x) = x’ and NAND[NAND(x,y),NAND(x,y)] = xy Example: NOR since NOR(x,x) = x’ and NOR[NOR(x,y),NOR(x,y)] = x + y

30 Isomorphic Systems Isomorphism: Two algebraic systems are isomorphic if For every operation in one system, there exists a corresponding operation in the second system To each element x i in one system, there corresponds a unique element y i in the other system, and vice versa If each operation and element in every postulate of one system is replaced by the corresponding operation and element in the other system, then the resulting postulate is valid in the second system Thus, two algebraic systems are isomorphic if and only if they are identical except the labels and symbols used to represent the operations and elements

31 Series-parallel Switching Circuits Gate: a two-state device capable of switching from one state, which permits flow of information, to another, which blocks it, and vice versa Primed (unprimed) two-valued variable: denotes flowing (blocked) information If a gate permits (blocks) the flow of information: literal associated with it takes value 1 (0) Elementary series-parallel switching circuits Parallel connection x + y Series connection xy Series-parallel circuits: any circuit constructed of either a series or parallel connection of two or more elementary series-parallel circuits

32 Transmission Function Transmission function for a circuit: assumes value 1 (0) when there is (there is not) a path from one terminal of the circuit to the other through which information flows Definition of transmission functions Analogy: OR parallel; AND series Complement of a given circuit: one that blocks all paths of information flow whenever the given circuit permits any Thus, algebraic system for switching circuits isomorphic to switching algebra

33 Switching Circuit Simplification Circuit realizing T = xy’ + (x’+ y)zSimplified circuit realizing T = xy’ + x’z + yz = xy’ + x’z + y’z + yz = xy’ + x’z + z = xy’ + z Important application of theory of switching circuits: CMOS

34 Propositional Calculus Proposition: declarative statement which may be either true or false Example: temperature is 100 degree Celsius turtle runs faster than the hare sum of 2 and 3 equals 5 Proposition variable: 1 (0) if proposition is true (false) Negation p’ of proposition p: 1 (0) if p is 0 (1) Conjunction of propositions p and q is pq: true when both p and q are true and false whenever either one or both p and q are false Disjunction of propositions p and q is p + q: true when either p or q or both are true and false whenever both p and q are false

35 Propositional Calculus (Contd.) Definition of conjunction and disjunction of p and q Analogy: OR disjunction; AND conjunction Thus, algebraic system for switching circuits is isomorphic to propositional calculus

36 Propositional Calculus Example Example: Air-conditioning of a storage warehouse to be turned on if one or more of the following three conditions occurs: 1.Weight of stored material is less than 100 kg, relative humidity is at least 60%, and temperature is above 60 degrees Celsius 2.Weight of stored material is 100 kg or more and temperature is above 60 degrees Celsius 3.Weight of the stored material is less than 100 kg and the barometer stands at 30 inches of mercury or over A: proposition that air-conditioning is turned on W: weight of 100 kg or more H: relative humidity of at least 60% T: temperature above 60 degrees Celsius P: barometric pressure is 30 inches of mercury or more A = W’HT + WT + W’P = HT + WT + W’P = T(H+W) + W’P Thus, air-conditioning is on if the temperature is above 60 degrees Celsius and either the weight is at least 100 kg or the humidity is at least 60%, or if the weight is less than 100 kg and the barometer stands at 30 inches or over

37 Electronic Gate Networks Electronic gates: generally receive voltages as inputs and produce output voltages Precise values of voltages not significant: restricted to value ranges – high (value 1) and low (value 0) Electronic gates constructed with two-state switching devices: each capable of permitting the flow of current or blocking it To implement arbitrary switching functions: gates must be able to implement a functionally complete set of operations Functionally complete set

38 Gate Network for Air-conditioning Function