We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47
Digital Logic
Introduction, Truth Tables and Boolean expressions
Logic Gates Combination of Logic Gates Circuit tracing and Boolean expressions Creating Truth Table from a circuit Creating a Circuit from a Truth Table Basic Boolean Algebra Using Boolean Algebra for Circuit Simplification Practical Considerations Digital Circuit versus an analog circuit Digital systems operate based on discrete information or signals, were as an analog system relies on continuous information or signals. Digital systems are binary in nature, they have two distinct states as opposed to the infinite states available in an analog system. A Digital system accepts discrete inputs and generates discrete outputs, such as On/Off, High/Low, True/False, or 1/0. EXAMPLE 7.1 Car Seat Pr essur e Sensor Vol t age Sensor Compar at or Compar at or Enabl e Accel er at or Seat Bel t Possibilities: Y or N Pressure Voltage Run A B F F = Function of Truth Tables and Boolean expressions Digital Circuit Inputs Output A B C F A B C F 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 Input Combinations Output A B C F 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 Input Combinations Output A Truth Table is used to describe the relationships of inputs and outputs in tabular form. A Boolean expression can be used to describe the relationships of inputs and outputs in mathematical form. F = ABC+ABC+ABC+ABC Digital logic circuits consist of a series of special integrated circuits called gates. The gates are the building blocks of the circuit and can be combined to construct a circuit to satisfy practically any situation. We will cover the gates known as: NOT gate (or inverter) AND gate OR gate NAND gate NOR gate XOR gate (exclusive OR gate) Logic Gates NOT gate (inverter) The simplest of all logic gates A F = A 0 1 1 0 A A A F = A 0 1 1 0 A F = A 0 1 1 0 A A A A Note we will use A to represent the complement of A or any other variable. EXAMPLE 7.2 AND gate A B F =AB 0 0 0 0 1 0 1 0 0 1 1 1 A AB B A B F =AB 0 0 0 0 1 0 1 0 0 1 1 1 A B F =AB 0 0 0 0 1 0 1 0 0 1 1 1 A AB B A AB B EXAMPLE 7.3 Note the product AB is read A and B. OR gate A B F =A+B 0 0 0 0 1 1 1 0 1 1 1 1 A B A+B A B F =A+B 0 0 0 0 1 1 1 0 1 1 1 1 A B F =A+B 0 0 0 0 1 1 1 0 1 1 1 1 A B A+B A B A+B Note the sum A+B is read A or B. EXAMPLE 7.4 NAND gate A B F =(AB) 0 0 1 0 1 1 1 0 1 1 1 0 A B (AB) A B F =(AB) 0 0 1 0 1 1 1 0 1 1 1 0 A B F =(AB) 0 0 1 0 1 1 1 0 1 1 1 0 A B (AB) A B (AB) AND NOT A B AB (AB) AND NOT A B AB (AB) EXAMPLE 7.5 NOR gate A B F =(A+B) 0 0 1 0 1 0 1 0 0 1 1 0 A B (A+B) A B F =(A+B) 0 0 1 0 1 0 1 0 0 1 1 0 A B F =(A+B) 0 0 1 0 1 0 1 0 0 1 1 0 A B (A+B) A B (A+B) OR NOT A B A+B (A+B) OR NOT A B A+B (A+B) EXAMPLE 7.6 XOR gate (exclusive OR gate) XOR gate B A F A B F 0 0 0 0 1 1 1 0 1 1 1 0 XOR gate B A F XOR gate B A F A B F 0 0 0 0 1 1 1 0 1 1 1 0 A B F 0 0 0 0 1 1 1 0 1 1 1 0 EXAMPLE 7.7 5 V 5 V 5 V 5 V Momentary on and off Fi r e Al ar m Chemi cal Sensor Heat Sensor Compar at or Compar at or Sound Al ar m Fire Alarm Combination of Logic Gates 1. Given a Logic circuit, a system of connected logic gates, how do we determine its behavior? That is for a given set of inputs what will be the output? 2. Given a set of outputs, how do we create a Logic circuit that will satisfy them? Two questions must be addressed When analyzing a logic circuit, our goal will be to create a Truth Table. There are several methods that will accomplish this task. We will explore the methods of: 1) Circuit tracing (the most basic and time consuming approach). 2) Writing a Boolean expression which we will then use to generate a truth table (recommended method for this class). Method one: steps for Circuit tracing 1. We write out our truth table, leaving the outputs blank. 2. Place the first input combination, from the truth table, onto the inputs of the circuit and trace the logic outputs through the entire circuit. 3. Place the output result in the truth table and move to the next input combination. 4. Repeat steps 2 and 3 for all of the input combinations. Circuit tracing example 1. We write out our truth table, leaving the outputs blank. A B F 0 0 0 1 1 0 1 1 A B F 0 0 0 1 1 0 1 1 2. Place the first input combination, from the truth table, onto the inputs of the circuit and trace the logic through the entire circuit. 3. Place the output result in the truth table and move to the next input combination. A B F 0 0 1 0 1 1 0 1 1 A B F 0 0 1 0 1 1 0 1 1 A B F 0 0 1 0 1 0 1 0 1 1 A B F 0 0 1 0 1 0 1 0 1 1 4. Repeat steps 2 and 3 for all of the input combinations. A B F 0 0 1 0 1 0 1 0 1 1 1 A B F 0 0 1 0 1 0 1 0 1 1 1 A B F 0 0 1 0 1 0 1 0 1 1 1 1 A B F 0 0 1 0 1 0 1 0 1 1 1 1 Method two: steps for generating a truth table from a derived Boolean expression (Our preferred approach) 1. Begin by labeling the inputs to the circuit (A, B, C, ). 2. Label the outputs of the first set of gates encountered, based on the inputs. 3. Label the next set of gate outputs based on the previous gate output. 4. Repeat step 3 until you reach the final circuit output, this will be your circuit derived Boolean expression. 5. Generate a truth table based on the Boolean expression derived for the circuit. Steps 1 through 4 A B A B A B AB AB F=AB+AB A B A B A B AB AB F=AB+AB 1. Begin by labeling the inputs to the circuit. 2. Label the outputs of the first set of gates encountered, based on the inputs. 3. Label the next set of gate outputs based on the previous gate output. 4. Repeat step 3 until you reach the final circuit output. Step 5 generating the truth table 1. Identify the inputs to the Boolean expression. 2. Create a truth table with all possible permutations of the inputs. 3. Determine the outputs using the inputs and your Boolean expression. A B A B A B AB AB F=AB+AB A B A B A B AB AB F=AB+AB A B F =AB+AB 0 0 0 1 1 0 1 1 A B F =AB+AB 0 0 0 1 1 0 1 1 Example 1: Find the truth table Example 2: Find the truth table Converting a truth table to a logic circuit There are several ways that a truth table can be converted into a logic circuit. We will focus on one method, the sum of products or minterm method. This turns out to be a two step process 1) Use minterms to create a Boolean Expression (sum of products) for the desired circuit. 2) Build a circuit from the Boolean expression Basically, a minterm is the product of n variables in which each variable appears only once, or a list of all possible permutations of the n variables. So, for a given logic circuit, there are as many possible minterms as there are rows in the circuits truth table. A B minterm 0 0 0 1 1 0 1 1 We care about minterms because a Boolean expression may be constructed by picking out the minterms of a truth table that evaluate to 1 and summing them. A B F minterm 0 0 0 0 0 1 AB 0 1 AB 1 0 AB 1 1 AB F = AB A B F minterm 0 0 1 1 1 0 AB 0 1 AB 1 0 AB 1 1 AB F = AB+AB+AB Step one: find the minterms and write a Boolean expression 1. Find the rows in the truth table with true (1) results. 2. Determine the minterms for these rows. 3. Create a Boolean expression consisting of the sum of these minterms. A B C F 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0 A B C F 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0 Step two: going from the Boolean expression to the Circuit A product represents the operation of an AND gate. A sum indicates the operation of an OR gate. Using AND gates to represent the products, OR gates to represent the sums, and NOT gates to represent the complimented terms, we can easily construct our circuit. This approach, when applied correctly, will produce a working circuit. However, the circuit will not necessarily be the most efficient Create a circuit for: F=AB+AB+AB 1. Start with the product terms (AND Gates) 2. Create the sum, OR the AND gates (3-input OR Gate) 3. Create the complemented inputs (NOT Gates). F = AB + AB + AB F = AB + AB + AB Example Create a circuit for: F=A'B'C' BC AC + + Example Create a circuit for: A B F 0 0 0 0 1 1 1 0 1 1 1 0 Basic Boolean Algebra Creating a useful digital logic circuit requires the best possible design for the application in which it will be used. Typically this means you should use the simplest possible circuit design. Advantages 1. Lower cost 2. Reduce power consumption 3. Increase speed 4. Reduce circuit size and complexity One of the most common approaches to digital logic circuit simplification is through the use of Boolean algebra. Compliment Notation 0 = 1 (read as NOT 0 is equal to 1) 1 = 0 (read as NOT 1 is equal to 0) If A=1 then A=0 If A=1 then A=0 Therefore (A) = A Multiplicative Behavior: (AND Gates) 0*0 = 0 0*1 = 0 1*1 = 1 Additive Behavior (OR Gates) 0 + 0 = 0 0 + 1 = 1 1 + 1 = 1 Basic Operations of Boolean algebra Important Laws of Boolean algebra Commutative Laws AB = BA A+B = B+A Associative Laws (AB)C = A(BC) (A+B)+C = A+(B+C) Distributive Laws A(B+C) = AB + AC A+BC = (A+B)(A+C) Some Basic Boolean algebra Theorems Theorem 1 A+0=A Theorem 2 A+1=1 Theorem 3 A+A=A Theorem 4 A*1=A Theorem 5 A*0=0 Theorem 6 A*A=A Theorem 7 (A)=A Theorem 8 A+A=1 Theorem 9 A*A=0 How to use Boolean algebra to simplify a sum of products expression 1. Try to find variables that can be factored out in such a way as to leave terms that will simplify to zero or one. For example AB + AB = A(B+B) = A(1)=A. 2. If it helps you recognize patterns, rearrange the order of the terms in the expression to group terms that have common variables together. 3. Keep the second distributive law in mind. It is used a great deal and situations where it would help are often missed by people new to Boolean expression simplification. A+BC = (A+B)(A+C) Example F=AB+AB+AB F=A(B+B)+AB Theorem 8: B+B = 1 F=A+AB Second Distributive law: A+BC = (A+B)(A+C) F=(A+A)(A+B) Theorem 8: A+A = 1 F=(1)(A+B) F=A+B First Distributive law: A(B+C) = AB + AC End Result (a) F=AB+AB+AB (b) F=A+B (a) F=AB+AB+AB (b) F=A+B DeMorgans Theorem (AB) = A+B Part a. DeMorgans Theorem (A+B) = AB Part b. X Y 7400N 7402N 7404N 7408N Practical Considerations What gates really look like GND VCC 4 2-Input AND 4 2-Input OR 6 NOT 7404 7432 7408 GND VCC GND VCC 4 2-Input AND 4 2-Input OR 6 NOT 7404 7432 7408 Typical High/Low voltages for TTL (Transistor-Transistor Logic) and CMOS (Complementary Metal Oxide Semiconductor) logic GND +1 +5 +3 +4 +2 2.0 V 0.8 V TTL HIGH TTL LOW GND +10 +5 7.0 V 3.0 V CMOS HIGH CMOS LOW GND +1 +5 +3 +4 +2 2.0 V 0.8 V TTL HIGH TTL LOW GND +10 +5 7.0 V 3.0 V CMOS HIGH CMOS LOW V supply = 5 Volts V supply = 10 Volts V supply fixed for TTL but for CMOS can be approximately 3 - 18 volts What You Should Know 1. Know the Basic Logic Gates symbols and their Truth Tables 2. Know how to create a Truth Table from a circuit 3. Know how to create a circuit from a Truth Table