320 likes | 467 Views
Chapter 2 Combinatorial Logic Circuits. In this chapter we will discuss logic gates which is the most primitive logic elements in digital circuits. In a combinatorial logic circuit the output at time t depends only on the input at time t. Digital Design.
E N D
Chapter 2Combinatorial Logic Circuits In this chapter we will discuss logic gates which is the most primitive logic elements in digital circuits. In a combinatorial logic circuit the output at time t depends only on the input at time t. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Digital Design • The first step in the digital design process is to create a formal description of the requirements of the problem. This formal description is called a behavioral description because it defines precisely what the eventual circuit is supposed to do. The objective of a behavioral description is to provide a formal specification that satisfies the following: • complete: All possible outputs are accounted for. That is, there is no input sequence for which we have not also identified the corresponding output. • unambiguous: Each input sequence has a unique corresponding output sequence. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Behavioral Description • A behavioral description specifies what a circuit does, but not how. Behavioral descriptions ALWAYS consist of two parts: • An entity definition that identifies the signal lines that make up the inputs and outputs and the ports that interface the device with those signal lines. A signal line is any connection that can transmit one bit at a time. This will be discussed later in Chapter 3. • A functional specification that specifies how the outputs are determined by the inputs. This information can be conveyed by a table, algebraically, or algorithmically. Initially the functional specification will be examined using function tables (truth-tables are a special case) and algebraic expressions (including Boolean expressions). CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Function Tables and Logic Operations • A function table or truth table is a listing of the output expected for every possible assignment of values to the inputs; that is, for every possible binary input sequence. • The three basic logical operations in the order of precedence are • NOT, • AND, • OR. • The truth tables of these logical operations are discussed in the next slide. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
A A.B B A A + B B Ā A Truth Tables for the basic logical operations The truth tables and the logic diagrams for the binary operations are: See Figure 2-1 on page 32. Note: NOT gates are often referred to as inverters. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Equivalency When are two boolean functions equal? When are two logic circuit diagrams the same? Two boolean functions are equal when to every instance of the input sequence they give the same output. Likewise two logic circuit diagrams are the same if to every instance of the same input, they give the same output. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Boolean Algebra This is an algebra dealing with binary variables and logic operations. The alphabet on which a Boolean algebra is defined can have two or more elements. The three basic operations of this algebra are NOT, AND, OR. This algebra is useful in simplifying statement forms of complex logic circuits by using boolean identities given in Table 2-3 on page 35 of the text. As a result of which the complex expressions/forms are transformed into simpler ones which evidently makes our design more parsimonious. The statement forms are referred to as multiple output boolean functions. A multiple output boolean function is a mapping from from each of the possible combinations of values 0 and 1 on the function variables to combinations of 0 and 1 on the function outputs. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Truth Tables of functions with n-input variables A function using two input variables (binary functions) has 22 possible input sequences as shown in Slide 5 of this chapter. A function using n input variables has 2n possible input sequences. The table below shows the input sequence of a function using three input variables. Note: There are 23 possible input sequences CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Duality Principle • By the dual of a boolean expression/form, we mean expression obtained by substituting AND for OR, OR for AND, 0 for 1, and 1 for 0. • The dual of A + B is A . B. • The dual of A . B is A + B. • The dual of Āis Ā. • The dual of A + 0 is A . 1. • Duality is often used in finding the complement of a complex boolean expressions. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Complementation using Duality The following steps are used in finding the complement of a boolean expression, F. Step 1: Find the dual of F. Step 2: Complement each literal after finding the literal. See examples on page 41 of the text. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Sum terms and Product terms Product terms for 3-input boolean functions are of the form F1(a, b, c) = a . b . c, F2 (a, b, c) = ā. b . c, . . . 23 such functions. Sum terms for 3-input boolean functions are of the form G1 (a, b, c) = a + b + c, G2 (a, b, c) = ā + b + c, . . . 23 such functions. Note: H(a, b, c) = ab+ bc + c is not a sum term example. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Minterms and Maxterms Minterms and Maxterms are special product and sum terms, respectively. In a minterm term of the type f(a, b, c) = a . b . c, a “1” appears exactly once in the truth-values of the function. In a maxterm term of the type g(a, b, c) = a + b + c, a “0” appears exactly once in the truth-values of the function. See Table 2-6, 2-7 on page 42-43. The boolean expression in the table, F(a,e), is not a maxterm even though there is only one ”0” in the truth values because the terms contain more than one literal. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Sum of products From the values in a table we can obtain a boolean expression by obtaining the minterms and then summing them up. This process is called “Sum of Products.” This process can, also, be used identifying the rows containing a “1” with the corresponding minterm. For example, in the table shown below rows 1, 3, and 4 contain a “1”. These are the only rows one needs to consider in order to obtain the Boolean expression. Using these rows we obtain the minterms and then sum them up. U(a,e) = m0 + m2 +m3 =ā ē + ā e + a e Ū(a,e) = m1 =a ē CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Products of sums From the values in a table we can obtain a boolean expression by obtaining the maxterms and then multiplying them up. This process is called “Product of Sums.” This process can, also, be used identifying the rows containing a “1” with the corresponding maxterm, and then taking the products. “Product of Sums” can, also, be obtained for a “Sum of Products by taking the dual of each term, and then taking the complement of each literal. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Implicants Implicants are product terms with special properties as they relate to a function F that we are trying to implement: An implicant P of a function F is a product term P such that F = 1 whenever P = 1. An implicant P covers an implicant Q if P = 1 whenever Q = 1. That is, Q is an implicant of P. By definition, an implicant can cover itself. However a useful covering implicant has fewer literals than any implicant it covers. A prime implicant P of F is any implicant that is not covered by any other implicant of F. An essential prime implicant of a function F is one that covers a minterm of F not covered by any other prime implicant of F. Two implicants are adjacent if all but one of their literals are identical, and the differing literals consist of a variable in one implicant and its complement in the other. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Cost Evaluation • Cost evaluation for a given statement form or a logic circuit diagram is calculated as follows: • Find the sum of • All the literals appearances, • The number of terms excluding terms that consist only of a single literal, and, optionally • The number of distinct complemented literals. The function G = āb + cā + cda has 7 literals, 3 terms, and 1 distinct complemented literal. So cost value is 11. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Karnaugh Maps (K-Maps) This is a pictorial method for obtaining minimal sum-of-products. Algebraic determination of the prime implicants of a function is tedious for simple functions and impractical for more complex ones. Therefore alternate strategies are available that simplify the process of identifying prime implicants, such as the Tabulation or Karnaugh Map method: The Karnaugh Map (K-Map) representation is a variation on function table representation where minterms are arranged so that adjacent minterms are next to each other, either vertically or horizontally in the K-Map table. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Two Variable K-Map This consists of a 2 by 2 table containing the minterms, m0, m2 ,m3 ,m4. F(a,b) = ā Two adjacent squares differing in one statement letter represents one literal CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Three Variable K-Map This consists of a 3 by 3 table containing the minterms, m0 , m2 ,m3 ,m4 ,m5 , m6,m7 ,m8. F(a,b,c) = m2 +m3 + m4 +m5 F(a,b,c) = ā b Two adjacent squares differing in one statement letter represents one literal CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
FINDING PRIME IMPLICANTS FROM A K-MAP 1.) Enter a 1 in the appropriate position of the K-Map Table corresponding to each minterm that is present in the function to be minimized. 2.) Group into pairs any two 1’s that are side-by-side to produce 1x2 or 2x1 arrays of 1’s. 3.) Group into fours any two pairs that are side-by-side to produce 1x4, 4x1 or 2x2 arrays of 1’s. 4.) Group into eights any two fours that are side-by-side to produce 2x4 or 4x2 arrays of 1’s. While every possible "group-of-one", pairing, group of four, and group of eight defines an implicant, the prime implicants are those groups that do not belong to any larger group. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Optimization using Prime Implicants For example to find the prime implicants of f(x,y,z) =Sm(1,3,6,7), the Karnaugh map of f is given by: Three prime implicants are identified, along with four additional implicants corresponding to the minterm 1’s. To identify an algebraic representation for each implicant, construct a product term that includes a literal for each variable, if that variable does not change value for any minterm within the group representing the implicant. In the example above, the prime implicants are x’z, yz, and xy. Of these, x’zand xyare essential prime implicants. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
To construct a minimal sum-of-products representation for a function: 1.) Choose all the essential prime implicants. These have to be included since by definition they are the only prime implicants that cover certain minterms. 2.) If such a choice does not cover all the minterms of the function, then choose the smallest number of remaining prime implicants possible so as to cover all the remaining minterms of the function. 3.) The required sum-of-products is obtained by "summing" all selected prime implicants. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Optimization using Don’t Care Conditions In many design problems there exists certain conditions which are impossible or for which no requirement is made. These are referred to as Don’t Care Conditions. The boolean functions of these circuits have unspecified outputs and are called incomplete specified functions. The Don’t Care Conditions are the unspecified minterms of the functions. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Multilevel Optimization Transformations • The following transformations can be used in cost optimization. • Factoring, • Decomposition, • Extraction, • Substitution, • Elimination. See description and details on page 67 of text. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Entity Diagrams Entity Diagram are of the type: a f f A b g B g c The input/output ports correspond to external signal lines of the logic diagram that provide the input and output values. There are combinations of logic circuits connected within these rectangles. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Entity diagrams in digital systems We determine the behavioral descriptions of all components. We begin with components whose inputs are only connected to external signal lines which determine the output from each component for each row of the function table according to the behavioral description of the component. This may determine additional columns in the function table corresponding to values on internal signal lines for each input assignment. We construct a column in the function table for each internal signal line or external output signal line from each component as soon as the values of all inputs to the component have been defined. When all external output signals have been defined, the function table is complete. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
u1 m a x t y s D2 x t D1 y s x D3 y z n u3 b c u2 Example of an entity diagram CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
a m b n c Entity definition for this logic diagram Behavioral description of the entity diagram CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
OTHER TYPES OF GATES The laws of Boolean Algebra provide an effective means for transforming algebraic representations of circuits into other representations that define different but equivalent circuits. However, the transformation rules are applicable only to expressions that employ the AND and OR operations. Four other important binary operations, called NAND, NOR, XOR, and XNOR, have useful applications even though do not define boolean algebras and therefore may not satisfy a given tranformation rule. To manipulate expressions that employ these operators, it is necessary to reduce Boolean expressions that include these functions to ones that use only AND, OR, and NOT. Reduction Rules for achieving this can be obtained by obtaining a minimal sum-of-products rerepsentation from the function tables for each operation. See Diagrams on Pages 72-73 of text. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
Odd Functions A function, f(x,y,z) is odd, if f(x,y,z) = 1 whenever x = 1, y = 1, or z = 1, exclusively. In a more generalized form we can say that for any n-ary function, the number of 1’s in any input sequence must be odd. f(x,y,z) = x y z CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
X Z Buffers A buffer produces the logical function Z = X, since the binary value of the output is equal to the binary value of the input. This circuit is used primarily to amplify an electrical signal to permit more gates to be attached to the output or to decrease the time it takes for signals to propagate through the circuit. F = X CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU
The 3-State Buffers The 3-state (buffer) logic output exhibits three distinct states. Two of the “states” are the logic 1 and logic 0 of conventional logic. The third “state” is the high impedance, Hi-Z value, that, for three-state logic, is referred to as Hi-Zstate. OUT IN Enable Input, EN If EN = 1, OUTis equal to IN, behaving like a normal buffer. The only time we get high impedance output is when EN = 0. CMPT 150, Chapter 2, Tariq Nuruddin, Fall 06, SFU