Presentation is loading. Please wait.

Presentation is loading. Please wait.

Designing Logic Circuits

Similar presentations


Presentation on theme: "Designing Logic Circuits"— Presentation transcript:

1 Designing Logic Circuits
Using Basic Logic Gates to Create Digital Circuits This lecture discusses the fundamental concepts that are central to the design of digital logic circuits for computer systems. The concepts originate from symbol logic and integrate with simple electronic devices to produce electrical circuits whose behavior represents logical functions.

2 Copyright Gene A. Tagliarini
Steps Determine the logic function(s) the circuit is to perform Find a logic expression to represent the logic function(s) Create a circuit to correspond to the logic expression The process of digital logic circuit design consists of three steps: determining the logic function to be performed, finding a logic expression for the function, and then implementing a circuit to represent the logic expression. The method of circuit design presented here may use more electrical devices than some other approaches; however, the design strategy is extremely regular, can be automated easily, and is well suited for implementation on device (gate) arrays. We begin by reviewing the notion of a logic function. Copyright Gene A. Tagliarini 11/16/2018

3 Example: All Possible Logic Functions of Two Variables X and Y
H I J K L M N O P 1 A logic function expresses the relationship among logic variables. A logic function can be specified by a logic table. For example, the logic table shown defines ALL of the logic functions of two independent variables, X and Y. Notice that there are four rows of data in the logic table. The four rows arise from the fact that, in a two-valued logical system, each independent variable may assume only one or the other of exactly two states at a given time. Here the states are represented using the symbols 0 and 1. Thus, X and Y may both be 1, as indicated in the first row; X may be 1 while Y is 0, as in the second row; X may be 0 while Y is 1, as in the third row; or X and Y may both be 0, as in the fourth row. Thus, the first two columns in the table represent all possible combinations of the logic values of the independent variables X and Y. The remaining columns, labeled A through P, represent the possible functions of X and Y. Notice that there are four entry positions under each of the labels A-P and each of those entries could either be filled using a 0 or a 1. Consequently, there are exactly 2^4=16 possible functions of X and Y. Those possible functions are precisely the functions specified by this logic table. Notice also that there is natural correspondence between these functions and the functions of two symbolic logic variables that might be specified by a truth table. In particular, associating the digital logic symbols 1 and 0 with the symbolic logic symbols TRUE and FALSE, respectively, we can see that this logic function table is simply a truth table (in disguise). For example, notice that the digital logic functions B and H would correspond to the symbolic logic functions OR and AND, respectively. We now generalize these concepts to allow for the situation in which there are N independent logic variables. Copyright Gene A. Tagliarini 11/16/2018

4 Logic Functions of N Variables
There are 22N possible logic functions of N variables. Can we create logic expressions for arbitrary logic functions? (Yes!) Extending the notion of logic functions of two variables to an arbitrary number N is straightforward. The logic table would possess 2^N many rows because there are 2^N possible combinations of the logic values of N independent logic variables. Since there are 2^N rows, and each entry in a row may be chosen in one of two ways, there are 2^2^N different ways of supplying the entries in a column to define a logic function. Thus, in a two-value logic system (a Boolean system), we can distinguish 2^2^N logic functions of N logic variables. Many such functions have a natural correspondence with named symbolic logic functions such as AND, OR, NOT, XOR, etc. However, other logic functions may not have any common name. In order to design a circuit to perform a logic function, we need a method that will enable us to create a logic expression for the logic function and the represent that logic expression using digital logic circuit devices. Before we show the circuit design method itself, we will study a typical problem. Copyright Gene A. Tagliarini 11/16/2018

5 Example Problem: Logic Functions and Binary Addition
Recall: <=carry bits <=augend <=addend <=sum Arithmetic operations are commonly performed in the arithmetic and logic unit (ALU) of a central processing unit (CPU). Consider the sample, multi-digit, binary addition problem shown. Any addition problem contains an augend and an added. It may also include a sequence of digits, some of which may be 0, that are referred to as “ carry” values. For regularity sake, we could assume that each column of a multi-digit addition employs a carry digit (possibly 0). The multi-digit addition operation may be subdivided into several one digit wide slices, with a carry digit being passed from stage to stage appropriately. Thus, multi-digit addition reduces to a problem of finding the sum and carry arising from a slice containing three digits—in the example problem given, the first sub-problem is to find the sum and carry arising from adding 0 (from a carry in that is supplied for regularity), 1 (the rightmost bit of the augend), and 1 (the rightmost bit of the addend). The second slice of the problem would be to determine the sum and carry arising from adding 1 (the carry out of the preceding slice), 0 (from next to the rightmost bit of the augend), and 1 (from the next to the rightmost bit of the addend). The process continues slice by slice from the right to the left. Notice, in particular, that any combination of three binary digits may arise as the values to be added in a slice of a binary, multi-digit addition problem. This insight is the basis for writing a logic function table that enumerates all the possible combinations of bits that may occur in a slice of a multi-digit addition together with the resulting sum and carry bits. Before we develop this table, we review basic binary representations and arithmetic. Copyright Gene A. Tagliarini 11/16/2018

6 Recall How The Binary Representation Works
Binary Arithmetic Base 2 uses only the digits “0” and “1” Digits represent increasing powers of 2 Example: binary represents decimal 38 Operation Tables for Binary Arithmetic In a positional number system based on a radix r, the digits 0, 1,…, r-1 will be used to represent values. Working in base 10, where the radix r=10, we use the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. By contrast in the binary number system, where r=2, only the digits 0 and 1 are used to represent quantities. By convention, the digits in a number’s representation occur in order from right to left, with the rightmost digit being the coefficient of the lowest power of the radix used in the representation. The digits that appear are each coefficients of powers of the radix that increase consecutively from right to left. For integers, the lowest power of the radix used is zero. In the binary number system, the quantity corresponds to the decimal value 38. We see this by expanding the binary notation to reveal that in binary equals 0x2^7 + 0x2^6 + 1x2^5 + 0x2^4 + 0x2^3 + 1x2^2 + 1x2^1 + 0x2^0 or = 38 (in base 10). Binary integer operations are performed analogously to decimal operations but using a binary representation of both the intermediate and final results. Two arithmetic tables may be memorized to facilitate performing binary arithmetic. Notice that all of the values in the multiplication table match the decimal multiplication table, so nothing new need be learned. The addition table for binary numbers differs in only one position from the decimal table of addition for combinations of 0 and 1. Notice that = 10 in binary. The 10 shown IS NOT ten! It is 10 (in binary!) whose value can be determined if we use expanded notation as 1x2^1 + 0x2^0 = = 2 (in decimal). Thus, the symbol 10 in the binary addition table represents the decimal quantity 2. Extending arithmetic to multiple digits in a simple example, notice that in binary arithmetic = 11. Clearly 10 in binary represents the decimal value 2, 1 in each base represents the quantity 1, and 11 in binary represents 1x2^1 + 1x2^0 = = 3 (decimal). + 1 X 10 Copyright Gene A. Tagliarini 11/16/2018

7 Example Problem: Logic Functions and Binary Addition (continued)
<=carry in <=augend X <=addend Y <=sum Carry Out As we return to the circuit design problem, notice that we have subdivided the multi-digit addition problem so that initially, we will only seek to find a circuit that will solve the sub-problem of adding three binary digits (bits) and the producing a sum bit and a carry out bit. In the example problem, one slice of the addition has been highlighted. The carry in, augend, and addend bits all happen to be 1. As a result the sum and carry out bits for this slice are both 1. Notice that other combinations of carry in, augend, and addend bits occur and these combinations give rise to alternative patterns of sum and carry out bits. Also notice that the carry in to one bit slice is the carry out from the preceding column (if there is a preceding column). There will always be a carry out (having value either 0 or 1) of the leftmost bits in the summands. If we can design a circuit that will add bit slices, then perhaps we can use multiple such circuits, wired so that the carry out from one slice is applied as the carry in to the next slice, in order to perform multi-digit addition. We now describe the logic function that must be performed by the sub-circuits. Sum Copyright Gene A. Tagliarini 11/16/2018

8 All Possible Slices of an Addition Problem: Looks Like a Truth Table!
CarryIn Augend Addend CarryOut Sum 1 This logic function table has five columns. The first three columns enumerate all possible combinations of the carry in, augend, and addend bits. The last two columns specify two distinct logic functions: carry out and sum. Notice that the first row in the table represents the highlighted slice of the problem on the preceding slide: the carry in, augend, and addend were all 1, so the sum and carry out were also 1. Notice how the fifth row in the table corresponds to the rightmost column in the example problem: the carry in is 0, while the augend and addend are both 1, producing a carry out that is 1 and a sum that is 0. Notice how the table is similar to a symbolic logic truth table, where 1 has replaced T and 0 has replaced F. Copyright Gene A. Tagliarini 11/16/2018

9 Copyright Gene A. Tagliarini
Steps Determine the logic function(s) the circuit is to perform Find a logic expression to represent the logic function(s) Create a circuit to correspond to the logic expression Thus, we have completed the first step in designing a digital logic circuit for the multi-digit addition problem—we have specified the logic functions that the circuit must perform. We must still find appropriate logic expressions for the logic functions and then map those expressions onto logic circuits. Copyright Gene A. Tagliarini 11/16/2018

10 Logic Functions Can Be Decomposed Using Two Methods
Sum of Products (Use Min-terms) The “sums” are “OR” expressions The “products” are “AND” expressions Use when there are fewer 1’s than 0’s Product of Sums (Use Max-terms) Use when there are fewer 0’s than 1’s There are two common methods that will enable a designer to formulate a logic expression for a given logic function specified by a logic function table. The two methods are complementary as are many results in symbolic logic. As a result, we will focus on one of the two methods, and we will describe when each method would be preferred. In addition, we note that there may be methods to simplify the logic expressions that are given but the expressions that arise from the methods presented are highly regular and readily automated. The two methods for finding a logic expression that will be discussed are known as the Sum-of-Products Method and the Product-of-Sums Method. The Sum-of-Products Method is used when there are fewer 1’s than 0’s in the logic function table. Complementarily, the Product-of-Sums Method is used when there are fewer 0’s than 1’s in the logic function table. If the number of 0’s equals the number of 1’s, then either method can be used. Also, in either method, “sum” corresponds to symbolic logic “OR” and “product” corresponds to symbolic logic “AND”. Copyright Gene A. Tagliarini 11/16/2018

11 Example: Disjunctive (OR-based) Decomposition Of A Logic Function
Q F A= P AND Q B= P’ AND Q’ F = A OR B 1 Consider the logic function F of the logic variables P and Q as specified in the first three columns of the table shown. We observe that there are exactly two 1’s and two 0’s in the specification of F; hence, either the Sum-of-Products or the Product-of-Sums method can be used to form a logic expression for F. Notice that the 1’s that are included in the specification of F occur in the first and last rows of the logic function table. Notice also that that the specifications for logic functions A and B each possess one 1 and those 1’s occur in the rows of the table corresponding to the 1’s that occur in the specification of F. The last column in the table indicates one way in which F can be decomposed using the logic functions A and B. Remember that the disjunction (“sum”) of logic variables is 1, whenever any one of the logic variables has the logic value 1. Clearly, the logic function A = P * Q has a 1 in the first row of its definition and 0’s elsewhere. Similarly, B = ~P * ~Q has a 1 in the last row and zeros elsewhere. In any event, to form an expression for the logic function F, we may write F = A + B = (P * Q) + (~P * ~Q) a Sum-of-Products. The expressions P * Q and ~P * ~Q are examples of “min-terms”, logic functions whose specification has as few 1’s as possible without being all 0’s. Min-terms can also be described as logic functions whose specifications possess exactly one 1. Notice that, to form A, which has a 1 in the first row, the expression for A conjoins P and Q unmodified (since in the first row, both logic variables P and Q have the value 1). However, to form the min-term B, both P and Q were inverted (because the definition of B has a 1 in the last row, where P and Q both have logic value 0). There are two more min-terms of two logic variables. Can you write down their expressions? … The min-term having a 1 only in row two would have expression P * ~Q while the min-term having its only 1 in row three would have expression ~P * Q. . Copyright Gene A. Tagliarini 11/16/2018

12 Example: Conjunctive (AND-based) Decomposition Of A Logic Function
Q F X= P’ OR Q Y= P OR Q’ F = X AND Y 1 Using complementary logic, we now notice that the function F is also defined using two 0’s, one each in rows two and three of the logic table. Also recall that the AND of logic expressions is 0 if any term that is ANDed has logic value 0. The logic functions X and Y are examples of “max-terms”, logic functions with as many 1’s as possible without being all 1’s in the function specification. By combining max-term expressions, we can place 0’s at any desired point within the specification by conjoining the max-term expressions. Thus, F = X * Y. What remains is to see how to create max-term expressions. Notice that X can be formed from ~P + Q because the disjunction is only 0 if all terms being disjoined are 0. Since P has logic value 1 in row two, ~P has logic value 0 in row two. Consequently, ~P + Q has logic value 0 in row two but 1 elsewhere. Similarly, P + ~Q has logic value 0 only in row three. The max-terms that place 0 in row 1 or in row four are (~P + ~Q) and (P + Q), respectively. Thus, F = X * Y = (~P + Q) * (P + ~Q), which is a Product-of-Sums. Copyright Gene A. Tagliarini 11/16/2018

13 Two-variable, Min-term Logic Expressions
Q P AND Q P AND Q’ P’ AND Q P’ AND Q’ 1 This slide shows the min-term expressions for two independent logic variables. Notice that inversions are introduced to negate the necessary terms and produce 1’s in the rows where needed. The concept generalizes directly to as many independent variables as may be dictated by a given problem. Copyright Gene A. Tagliarini 11/16/2018

14 Two-variable, Max-term Logic Expressions
Q P OR Q P OR Q’ P’ OR Q P’ OR Q’ 1 This slide shows the max-term expressions for two independent logic variables. Notice that inversions are introduced to negate the necessary terms and produce 0’s in the rows where needed. The max-term concept generalizes directly to as many independent variables as may be dictated by a given problem. Copyright Gene A. Tagliarini 11/16/2018

15 Example: Logic Expressions For The Function F
Using the sum-of-products approach (P AND Q) or (P’ AND Q’) Using the product-of-sums approach (P OR Q’) and (P’ OR Q) We have demonstrated two approaches to develop a logic expression for the logic function F. Fortunately, as can be seen by inspecting the logic function tables, the two expressions have identical functionality. Which is preferred? Neither, for this problem. However, if the logic function F had contained fewer 1’s, the min-term expression would have been shorter (and the corresponding circuit less complex). Analogously, had there been fewer 0’s in the specification of the logic function F, the max-term solution would have produced a less complicated expression. Neither of these solutions produces a circuit with the least number of logic gates, but the simplicity and reliability of the method as well as the regularity of the corresponding circuits motivates its use. Now we return to the problem of multi-digit addition. Copyright Gene A. Tagliarini 11/16/2018

16 Recall: All Possible Slices Of A Binary Addition Problem
CarryIn Augend Addend CarryOut Sum 1 Recall the logic functions, carry out and sum, that must be computed. In each case, there are as many 1’s as 0’s in the logic function definition. We choose to develop a min-term expression (Sum-of-Products) for each logic function. Copyright Gene A. Tagliarini 11/16/2018

17 Example: Logic Expressions For The Function CarryOut and Sum
Using the sum-of-products, CarryOut = (CarryIn * X * Y) (CarryIn * X * Y’) (CarryIn * X’ * Y) (CarryIn’ * X * Y) Sum = (CarryIn * X * Y) (CarryIn * X’ * Y’) (CarryIn’ * X * Y’) (CarryIn’ * X’ * Y) For convenience in writing, we let X and Y stand for the augend and addend, respectively. The min-term expression for the function CarryOut is given by the expression shown. Notice that the min-terms are conjunctive expressions, each of which has only one 1 in its specification. The min-terms are listed in the order of the 1’s that they generate in the logic table specification for the function CarryOut. The min-term expression for the function Sum is also given using the min-terms in the order in which they are used to produce 1’s in the specification of the function Sum. Notice that the first min-terms in each expression are identical. This would give rise to a redundant electrical circuit. However, you should also notice that the process of developing the min-term expressions is essentially mechanical and can (with a little practice) be done automatically. Copyright Gene A. Tagliarini 11/16/2018

18 Example: Logic Expressions For The Function CarryOut and Sum
Using the product-of-sums, CarryOut = ? Sum = ? You should now try to construct the max-term (Product-of-Sums) expressions for the logic functions CarryOut and Sum. (These expressions are covered as an in class exercise.) Copyright Gene A. Tagliarini 11/16/2018

19 Copyright Gene A. Tagliarini
Steps Determine the logic function(s) the circuit is to perform Find a logic expression to represent the logic function(s) Create a circuit to correspond to the logic expression We have now completed the first two steps in the process of circuit design. We have determined the logic functions to be performed and we have formulated logic expressions for those functions. Next we describe the mapping from logic expressions to electronic circuits. Copyright Gene A. Tagliarini 11/16/2018

20 The Relation Between Logic Expressions and Circuits
AND gates represent the connective “and” OR gates represent the connective “or” Inverters represent the connective “not” Logic (voltage) levels represent “true” or “false” Logic circuit behavior can be determined by examining the truth table for the corresponding logic expression Fortunately, the transition from logic expressions to digital logic circuit devices is straightforward. Logical products (represented with * or AND in a logic expression) are represented in circuits using AND gates. Logical sums (represented with + or OR in a logic expression) are represented in circuits using OR gates. Inverters are used to represent “NOT” or negating operations. Logic levels are represented using electrical potentials (voltages), where 1 and 0 often correspond to TRUE and False, respectively. Copyright Gene A. Tagliarini 11/16/2018

21 Use The Expressions For Sum And CarryOut To Draw An Adder Circuit
Cout = x’yCin + xy’Cin + xyCin’ + xyCin Sum = x’y’Cin + x’yCin’ + xy’Cin’ + xyCin Notice how each product in the logic expression corresponds to an AND gate, each sum corresponds to an OR gate, and each NOT has been implemented with an inverter. Also notice that the parentheses enforce an order upon the connections in the circuit. In particular, each min-term is represented using AND gate and the results of all of the ANDing sub-circuits are ORed together. By replicating CarryOut and Sum circuits for each of the slices in the multi-digit addition and then wiring the subcircuits so that the augend and addend are applied in parallel and so that the CarryOut from one sub-circuit becomes the CarryIn to the next appropriately, we have design a simple adder circuit. Copyright Gene A. Tagliarini 11/16/2018

22 Copyright Gene A. Tagliarini
Steps Determine the logic function(s) the circuit is to perform Find a logic expression to represent the logic function(s) Create a circuit to correspond to the logic expression In summary, to design a basic digital logic circuit one must: Determine the logic functions to be performed; Formulate a logic expression for each function; and Use digital circuit devices to create a circuit that corresponds to the logic expression. Copyright Gene A. Tagliarini 11/16/2018


Download ppt "Designing Logic Circuits"

Similar presentations


Ads by Google