Digital Logic Design: Logic Gates - Lecture 2
Document Details

Uploaded by SupremeMandelbrot
Muhammad Martuza
Tags
Summary
These are lecture notes on digital logic design, specifically focusing on logic gates. The notes cover boolean variables, logical operations, truth tables, and the synthesis of boolean functions. Examples of AND, OR, and NOT gates are provided along with examples of logic networks.
Full Transcript
Digital Logic Design Lecture 2 Logic Gates Dr. Muhammad Martuza Ch. 2.1 to 2.4 1 Learning Objectives Students will be able to: § Understand Boolean Variables and Functions § Understand Logical Operation § AN...
Digital Logic Design Lecture 2 Logic Gates Dr. Muhammad Martuza Ch. 2.1 to 2.4 1 Learning Objectives Students will be able to: § Understand Boolean Variables and Functions § Understand Logical Operation § AND, OR, and Inversion Operations § Understand XOR and XNOR operations § Analyze a logic circuit, set-up its truth table and describe its functionality. § Synthesize Boolean Functions 2 Variable and Function Binary Switch § A switch has three parts § Source input and output § Current wants to flow from source input to output § Control input § Voltage that controls whether that current can flow § Control input x=0, switch open § Control input x=1, switch closed 3 Variable and Functions Switch Application § Light bulb application § Build a circuit where switch controls whether light bulb on or off § Light bulb glows when current passes through its filament § When switch is closed (x=1) § Current flows § Light bulb glows § When switch is opened (x=0) § Current doesn’t flow § Light bulb off 4 Variable and Functions Logic Expression § We can describe the system as a logic expression § Input: switch control x § Output: light bulb L § Light L is a function of the input variable x § L = 1 if x = 1 § L =0 if x = 0 § Thus, L(x) = x 5 Variable and Functions Two Switch Application-Series Connection § What if we use two switches to control the light? § x1, x2 are control inputs to the switches § We first connect switches in series § When will the light be on? 6 Variable and Functions: Logical AND Function § We observed § Light on only when both switches are closed § If either switch open, light is off § Logical expression to describe behaviour § L(x1, x2) = x1 · x2 § Function evaluates as follows § L = 1, if x1 = 1 and x2 = 1 § L = 0, otherwise L(x1,x2) = x1 · x2 “.” symbol is called AND operator Implements the logical AND function 7 Variable and Functions Two Switch Application-Parallel Connection § We again use two switches to control the light § x1, x2 are control inputs to the switches § Connect switches in parallel § When will the light be on? 8 Variable and Functions Logical OR Function § We observed § Light on when either switch is closed § Light on when both switches closed § Light off only when both switches are open § Logical expression to describe “+” symbol is called OR operator behaviour Implements the logical OR function § L(x1, x2) = x1 + x2 § Function evaluates as follows § L = 0, if x1 = 0 and x2 = 0 § L = 1, otherwise L(x1,x2) = x1 + x2 9 Variable and Functions Three Switch Application § AND and OR functions § Building blocks for larger circuits § Example with three switches § x1, x2, and x3 are control inputs to the switches § Series-parallel connection § When will the light be on? 10 Variable and Functions AND OR Logic Function § We observed 1 § Light on when x3 is closed while at the same time x1 and/or x2 are closed § Logical expression to describe behaviour 1 § L(x1, x2, x3) = (x1 + x2) · x3 1 11 Variable and Functions Switch Application- Inversion § What about a positive action when the switch is opened? § Switch connected in parallel with light § Closed switch short circuits the light, light is off § Open switch, light turns on § Logical expression to describe behaviour Overbar indicates complement § L(x) = x´ Implements the NOT function § Function evaluates as follows § L = 1, if x = 0 § L = 0, if x = 1 L(x1) = x1 12 Inversion NOT Operation Notation § Different names for NOT operation § Complement, Invert, Inverse § Different notations for NOT operation § x = x´ = !x = ~x § NOT operation can be applied to a single variable or multiple variables § F(x) = x´ § F(x) = x´+ a § F(x) = x1 + x2 = (x1 + x2)´ = !(x1 + x2) = ~(x1 + x2) § NOT operation can be applied to a function § If F(x) = x1 + x2 + x3 Complement of F(x) is F´(x) = (x1 + x2 + x3)´ 13 Truth Table Introduction § Introduced AND, OR, and NOT functions by relating them to simple circuits built with switches § Same operations can be defined in the form of a truth table No of combinations = 2n where n = No of inputs 14 Truth Table Varied Truth Table Formats § Truth tables can have single or multiple outputs § Truth tables can be formatted in different ways 15 Truth Table Introduction § Advantages § Only one truth table § Intuitive to read How many § Disadvantages § Size explosion lines are needed if you have 8 inputs? 5-input truth table? 16 Truth Table Introduction § AND & OR functions can be extended to n-inputs § AND function with n-inputs is equal to 1 only if all n inputs are 1 § OR function with n-input is equal to 1 if at least one, or more n inputs are 1 17 Logic Gates and Networks Basic Logic Gates § AND, OR, & NOT operations can be implemented electronically with transistors § Resulting circuit is a logic gate § One or more inputs § One output, function of its inputs § Logic circuit often described graphically in a circuit diagram or schematic § Consists of graphical symbols for the AND, OR, & NOT gates 19 Logic Gates and Networks Basic Logic Gates … Cont Also Exclusive OR (XOR) and XNOR operations can be implemented electronically with transistors XOR XNOR Inputs Gate Symbol & Function Coincidence Operator A A B A F F B F = AÅ B B F = AÅ B 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 The output of the XOR gate is equal to 1 if an odd number of inputs have a value of 1 and 0 otherwise. è Odd Function 20 Logic Gates and Networks Network of Gates § Larger circuits are implemented by a network of gates § Logic function previously constructed using switches can be implemented by a network of gates. 21 Logic Gates and Networks Logic Network Gates Cost & Complexity § Circuit complexity directly correlates to cost § Always desirable to reduce cost, thus important to determine how to implement circuit as inexpensively as possible § Network of gates § Also called logic network, logic circuit, circuit 22 Logic Gates and Networks Digital System Designer Concern § Digital system designer faced with two basic issues § Determine function of an existing logic network ® Analysis § Designing a logic network to implement the desired function ® Synthesis 23 Logic Gates and Networks Analysis of Logic Network § Convert logic network into logic expression f= f=a+b f = x1´ + b f = x1´ + (x1 · x2) 24 Logic Gates and Networks Analysis of Logic Network § Convert logic network into logic expression f= f = a´ f = (x1 + b)´ f = (x1 + (x1 · x2))´ 25 Logic Gates and Networks Analysis of Logic Network § Convert logic network into logic expression 26 Logic Gates and Networks Analysis of Logic Network § Another way to specify circuit functionality – truth table § Consider what happens to output f for all possible inputs 27 Logic Gates and Networks Analysis of Logic Network – second example § Let’s analyze another logic circuit § What is the corresponding truth table? 28 Logic Gates and Networks Functional Equivalence § You may have noticed we got the same truth table for both examples § Logic circuits are functionally equivalent § Logic function can be implemented in a variety of ways § Designer wants to use the simpler one – lower cost § How do we determine the best implementation? § Manipulate function using a set of rules (Boolean Algebra) § Other techniques discussed in Chapter 4 29 Logic Gates and Networks Timing Diagram § Yet another way to describe logic circuit behaviour – timing diagram § Time runs from left to right § Each input value is held for a fixed period § Waveform shown indicating inputs, output, and internal signal values 30 Logic Gates and Networks Synthesis of Logic Network § Second design issue – Synthesis § How do I go from a logic expression to a logic circuit? 31 Logic Gates and Networks Synthesis of Logic Network § Convert f= x1´ + (x1 · x2) to a logic circuit § What are your inputs? § x1, x2 § What are/is your output(s)? § F § How is the function evaluated? § Parentheses § NOT operation § OR operation 32 Logic Gates and Networks Synthesis of Logic Network § Convert H = a · (b + c´)´ to a logic circuit § Expression inside parentheses first § OR operation or NOT operation? § NOT operation § AND operation 33 Logic Gates and Networks Synthesis of Logic Network § Convert R = (a · b´) · (b + c´) to a logic circuit § Expressions inside parentheses first § AND operation 34 Logic Gates and Networks Synthesis of Logic Network § Convert Fout = (a1 · bw´ + c)´ to a logic circuit § Expression inside parentheses first § NOT, AND, or OR operation? § NOT operation 35 Logic Gates and Networks Synthesis of Logic Network § Convert Fout = (a · b · c) to a logic circuit § How do we implement a 3-input gate? § Using 2-input AND gates § Using 3-input AND gates – Same for OR gates – J=k+l+m+n 36 Practice Problems from the Textbook § P2.8 § P2.9 37