Lecture 6: Universal Gates

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Logic Gates.
Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR
Types of Logic Circuits
Chapter 2 Logic Circuits.
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.
Revision Mid 2 Prof. Sin-Min Lee Department of Computer Science.
1 CK Cheng CSE Dept. UC San Diego CS 140, Lecture 2 Combinational Logic.
CS 140 Lecture 6: Other Types of Gates Professor CK Cheng 1.
1 Digital Logic
Computer organization at the logic level Some not so famous last words.
Faculty of Computer Science © 2006 CMPUT 229 Digital Logic From Switches to Memories.
1 COMP541 Combinational Logic - II Montek Singh Aug 27, 2014.
Lecture 3. Boolean Algebra, Logic Gates
CS 140 Lecture 7 Professor CK Cheng 10/17/02. Combinational Logic  Complete set of gates  Other types of gates 1)XOR 2)NAND / NOR 3)Block Diagram Transfers.
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
Propositional Calculus Math Foundations of Computer Science.
1 CK Cheng CSE Dept. UC San Diego CSE 140, Lecture 2 Combinational Logic.
Chapter 2: Boolean Algebra and Logic Functions
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Computer Organization 1 Logic Gates and Adders. Propositions –Venn Diagrams.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /05/2013 Lecture 4: Basics of Logic Design Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
CSE 140, Lecture 2 Combinational Logic
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
CSE 20: Lecture 7 Boolean Algebra CK Cheng
Logic Gates. A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment,
1 CK Cheng CSE Dept. UC San Diego CSE 140, Lecture 2 Combinational Logic.
Module 7.  In Module 3 we have learned about NAND gate – it is a combination of AND operation followed by NOT operation  Symbol A. B = Y  Logic Gate.
CSE 140: Components and Design Techniques for Digital Systems Lecture 6: Universal Gates CK Cheng Dept. of Computer Science and Engineering University.
CEC 220 Digital Circuit Design SOP and POS forms Friday, January 23 CEC 220 Digital Circuit Design Slide 1 of 17.
Department of Preparatory Year, Umm Al Qura University CSCI 240 Digital Logic.
Digital Logic. Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CSE 140 Lecture 8 Sequential Networks
Lecture 4 Topics Boolean Algebra Huntington’s Postulates Truth Tables
CHAPTER 7 MULTI-LEVEL GATE CIRCUITS / NAND AND NOR GATES
Morgan Kaufmann Publishers
Department of Preparatory Year, Umm Al Qura University
Logic Gates and Boolean Algebra
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Chapter 2: Boolean Algebra and Logic Functions
DIGITAL LOGIC CIRCUITS
Digital Technology.
COMP541 Combinational Logic - II
Logic Gates and Boolean Algebra
DIGITAL LOGIC CIRCUITS
Reading: Hambley Chapters
Basics Combinational Circuits Sequential Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Fundamentals of Computer Science Part i2
Lecture 6: Universal Gates
CSE 370 – Winter Combinational Logic - 1
Lecture 4 Topics Boolean Algebra Huntington’s Postulates Truth Tables
Week 7: Gates and Circuits: PART II
Digital Logic.
Lecture 6: Universal Gates
Digital Logic.
DIGITAL ELECTRONICS B.SC FY
Digital Logic Circuits
CS 140 Lecture 6: Other Types of Gates
COMP541 Combinational Logic - II
Design of Digital Circuits Lab 1 Supplement: Drawing Basic Circuits
BOOLEAN ALGEBRA.
Presentation transcript:

Lecture 6: Universal Gates CSE 140: Components and Design Techniques for Digital Systems Lecture 6: Universal Gates CK Cheng Dept. of Computer Science and Engineering University of California, San Diego

Combinational Logic: Various Types of Gates Universal Set of Gates Motivation Definition Examples Other Types of Gates XOR NAND / NOR Block Diagram Transfers Here we finish up our discussion on combination logic. We first will talk about complete set of gates, then move on to talk about other types of gates such as XOR gates and NAND / NOR gates. We will also talk about block diagram transfers, which is like converting a circuit into an equivalent circuit (i.e. it has the same exact function), but in the process changing and even reducing the number of gates.

Universal Set of Gates: Motivation AND, OR, NOT: Logic gates related to reasoning from Aristotle (384-322BCE) NAND, NOR: Inverted AND, Inverted OR gates. For VLSI technologies, all gates are inverted (AND,OR operation with a bubble at output). Multiplexer + input table: Table based logic for programmability. FPGA technology. XOR: Exclusive OR gates. Parity check. Neuron and Synapse: Neural network In the future, we may have new sets of gates due to new technologies. Given a set of gates, can the gates in the set cover all possible switching functions?

Universal Set Universal set is a powerful concept to identify the coverage of a set of gates afforded by a given technology. Criterion: If the set of gates can implement AND, OR, and NOT gates, the set is universal.

Universal Set Definition Universal Set: A set of gates such that every switching function can be implemented with the gates in this set. Examples {AND, OR, NOT} {AND, NOT} {OR, NOT} A universal set simply means that some set of gates can implement any switching function. For example, {AND OR NOR} is a universal set because you can do any possible switching (0 or 1) function with it. {AND NOR} is also universal because you can implement OR with just AND, NOT. Since you can do that, you can implement any switching function.

Universal Set: Examples Universal Set: A set of gates such that every switching function can be implemented with the gates in this set. Examples {AND, OR, NOT} {AND, NOT} OR can be implemented with AND & NOT gates: a+b = (a’b’)’ {OR, NOT} AND can be implemented with OR & NOT gates: ab = (a’+b’)’ {XOR} is not universal {XOR, AND} is universal A universal set simply means that some set of gates can implement any switching function. For example, {AND OR NOR} is a universal set because you can do any possible switching (0 or 1) function with it. {AND NOR} is also universal because you can implement OR with just AND, NOT. Since you can do that, you can implement any switching function.

iClicker Is the set {AND, OR} (but no NOT gate) universal? Yes No

iClicker Is the set {f(x,y)=xy’} universal? Yes No

Universal Set: Examples {NAND, NOR} {XOR} {XOR, AND} X ⊕ 1 = X*1’ + X’*1 = X’ if constant “1” is available. We see that a set consisting of just the NAND and NOR gates forms a universal set. We can implement a NOT gate by using a NAND gate and we can form an AND and OR gate by simply negating the NAND and NOR gates. 1

Other Types of Gates: Properties and Usage XOR X ⊕ Y = XY’ + X’Y NAND, NOR Block Diagram Transfers A XOR gate is a gate that is 1 only when one and only one of the two inputs is also 1. If both are 0 or both are 1, then the XOR gate will output a 0 also.

Other Types of Gates: XOR X ⊕ Y = XY’ + X’Y It is a parity function (examples) useful for testing because the flipping of a single input changes the output. X Y XY’ X’Y id x y x ⊕ y 1 2 3 x=0 x=1 y=0 1 y=1 A XOR gate is a gate that is 1 only when one and only one of the two inputs is also 1. If both are 0 or both are 1, then the XOR gate will output a 0 also.

Other Types of Gates: XOR XOR X ⊕ Y = XY’ + X’Y X Y XY’ X’Y Commutative X ⊕ Y = Y ⊕ X Associative (X ⊕ Y) ⊕ Z = X ⊕ (Y ⊕ Z) A XOR gate is a gate that is 1 only when one and only one of the two inputs is also 1. If both are 0 or both are 1, then the XOR gate will output a 0 also.

Other Types of Gates: XOR XOR X ⊕ Y = XY’ + X’Y X Y XY’ X’Y Commutative X ⊕ Y = Y ⊕ X Associative (X ⊕ Y) ⊕ Z = X ⊕ (Y ⊕ Z) 1 ⊕ X = X’, 0 ⊕X = X X ⊕ X = 0, X⊕X’ = 1 A XOR gate is a gate that is 1 only when one and only one of the two inputs is also 1. If both are 0 or both are 1, then the XOR gate will output a 0 also.

Other Types of Gates: Properties and Usage e) If ab = 0, then a ⊕ b = a + b Proof: If ab = 0, then a = a (b+b’) = ab+ab’ = ab’ b = b (a + a’) = ba + ba’ = a’b Therefore, a+b = ab’ + a’b = a ⊕ b In full adder, we have cout=ab+bc+ac=ab+c(a+b) From property e), we can also write cout=ab+c(a ⊕ b)

Other Types of Gates: XOR f) f(x,y)=x ⊕ xy’⊕ x’y ⊕ (x + y) ⊕ x= ? (Priority of operations: AND, ⊕, OR) Hint: We apply Shannon’s Expansion.

Shannon’s Expansion (for switching functions) Formula: f (X,Y) = X * f (1, Y) + X’ * f (0, Y) Proof by enumeration: If X = 1, f (X,Y) = f (1, Y) : 1*f (1, Y) + 1’*f(0,Y) = f (1, Y) If X = 0, f(X,Y) = f (0, Y) : 0*f (1, Y) + 0’*f(0,Y) = f(0, Y) Shannon’s Expression is actually very useful equation. It simply says a function can be decomposed by restricting X. Thus we have two cases, one when X is 0 and one when X is 1.

Other types of gates: XOR Simplify the function (Priority of operations: AND, ⊕, OR) f(X,Y) = X⊕XY’⊕X’Y⊕(X+Y)⊕X Case X = 1: f (1, Y) = 1 ⊕ Y’⊕ 0 ⊕ 1 ⊕ 1 = Y Case X = 0: f (0, Y) = 0 ⊕ 0 ⊕ Y ⊕ Y ⊕ 0 = 0 Thus, using Shannon’s expansion, we have f (X, Y) = Xf(1,Y)+X’f(0,Y)= XY Using Shannon’s Expression, we can easily solve for the answer to our problem. First we put parentheses around terms with higher precedence (like AND terms), and then from there we apply Shannon’s Expression to derive the two cares of when X is 1 and X is 0. Because we see that when X is 1, the function is Y, and when X is 0, the function is 0, we realize that the function is simply XY.

XOR gates iClicker: Is the equation a+(b⊕c) = (a+b)⊕(a+c) true? Yes No

Other Types of Gates: NAND, NOR 2) NAND, NOR gates NAND (NOR) gates are not associative Let a | b = (ab)’ (a | b) | c ≠ a | (b | c)

Other Types of Gates: Block Diagram Transform 3) Block Diagram Transformation a) Reduce # of inputs.  

Other Types of Gates: Block Diagram Transform b. DeMorgan’s Law  (a+b)’ = a’b’ DeMorgan’s Law implies that if you are given a NOR gate, you can convert that to an AND gate with two inverted inputs. Same with a NAND gate, you can replace a NAND gate with a OR gate with two inverted inputs.  (ab)’ = a’+b’

Other Types of Gates: Block Diagram Transform c. Sum of Products (Using only NAND gates)  Sum of Products (We create many bubbles with NOR gates) As we can see, there is a difference in how we transform our circuit. Comparing the two above, it is clear that using the NAND gates is much preferable to using the NOR gates as there are much less gates in the NAND version.

Other Types of Gates: Block Diagram Transform d. Product of Sums (NOR gates only)   Here we transform a product of sums circuit (two OR gates followed by an AND gate) into one with just NOR gates. We see that in this case, we don’t have a lot of gates like we did in the Sum of Products case. We will create many bubbles with NAND gates.

Other Types of Gates: Block Diagram Transform NAND, NOR gates Remark: Two level NAND gates: Sum of Products Two level NOR gates: Product of Sums

Part II. Sequential Networks Memory / Timesteps Clock A combinational logic cannot have some sort of feedback loop where the output of a logic is also the input of it. A sequential network on the other hand can have this feature. Flip flops Specification Implementation