Logic Reference Guide
Total Page:16
File Type:pdf, Size:1020Kb
Logic Reference Guide Advanced Micro Devices INTRODUCTION The standard schematic symbols used to represent these gates are shown in Figure 1. Throughout this data book and design guide we have assumed that you have a good working knowledge of logic. Unfortunately, there always comes a time when you are called on to remember something which can NOT only be found in that logic textbook which you threw away years ago. AND This section is intended to provide a quick review and reference of the basic principles of digital logic. We will OR cover three general areas: 90000A-1 Basic logic elements Figure 1. Schematics Symbols for the Three Basic storage elements Fundamental Gates Binary numbers The AND and NOT functions can be combined into the Throughout the text, we will use the notation that was NAND function. This is equivalent to an AND gate fol- used throughout this book. If you are unfamiliar with the lowed by an inverter, as shown in Figure 2a. Likewise, syntax, you will probably find it easy to understand as the OR and NOT gates can be combined into the NOR you read; if you wish for a more detailed explanation of function, as shown in Figure 2b. Each of these gates is the symbols, please refer to the Basic Design with PLDs functionally complete; any logic function can be ex- section where they are defined. pressed solely as a function of NAND or NOR gates. As this is a logic reference only, we cannot take on lengthy discussions, nor can we train you in the basic principles of digital logic if you have not previously been = trained. In such a case, we must refer you to your favorite logic textbook. a. The NAND Function BASIC LOGIC ELEMENTS = In this section, we will discuss the concepts surrounding combinatorial logic functions. b. The NOR Function The Three Basic Gates 90000A-2 There are three basic logic gates from which all other Figure 2. The NAND and NOR Functions combinatorial logic functions can be generated. These functions are NOT, AND, and OR. A truth table indicat- Precedence of Operators ing these functions is shown in Table 1. Since they can be used to generate any function, they are said to be Logic functions may be created with any combination of functionally complete. the three basic functions. How those functions are ex- pressed affects the evaluation of the function. The Table 1. Truth Table for the NOT, AND, and OR normal order of evaluation is: Functions NOT, AND, OR A B /A A*B A+B 00 100 Evaluation proceeds in order from left to right. 01 101 10 001 11 011 Publication# 90000 Rev. A Amendment /0 6-3 Issue Date: June 1993 AMD This order may be altered by inserting parentheses in Some example functions are evaluated in Table 2. the function. The contents of the parentheses will al- ways be evaluated before the rest of the expression, from left to right. Table 2. Using Parentheses to Change the Order of Evaluation A*B+/A* A*B+/A* A*(B+/A)* A*(B+/A)* A B C D C+D (C+D) C+D (C+D) 000 0 0 0 0 0 011 0 1 1 0 0 100 1 1 0 1 0 111 1 1 1 1 1 Commutative, Associative, and Duality Distributive Laws The two distributive laws give an example of the concept The AND and OR functions are commutative and asso- of duality. This principle states that: ciative. This means that the operands can appear in any Any identity will also be true if the following substitutions order without affecting the evaluation of the function. are made: This is illustrated in Tables 3 and 4. * for + Table 3. Commutativity + for * 1 for 0 A B A*B B*A A+B B+A 0 for 1 00000 0 01001 1 Thus, it is only necessary to prove the first of the distribu- 10001 1 tive laws; the second one will then be true by duality. Note that duality is not required to prove the second law; 11111 1 it can also be proven by truth table or by logic manipulation. Table 4. Associativity Manipulating Logic A B C (A*B)*C A*(B*C) (A+B)+C A+(B+C) Logic functions may be manipulated by the use of 00 0 0 0 0 0 Boolean algebra. The logic functions may be expressed 01 1 0 0 1 1 in one of the two canonical forms, or by using a simpli- 10 1 0 0 1 1 fied expression. 11 1 1 1 1 1 There are actually two distributive laws; one of them re- sembles standard algebra more than the other. These two laws state that: A*(B+C) = (A*B) + (A*C) A+(B*C) = (A+B) * (A+C) 6-4 Logic Reference Guide AMD Canonical Forms or maxterm number, as shown in Table 5. Within each minterm or maxterm, the individual variables are re- There are two fundamental canonical forms: sum-of- ferred to as literals. minterms and product-of-maxterms. The former is by far the most widespread. These are special cases of what For the case of sum-of-minterms form, the expression are more generally referred to as sum-of-products and for a function may be found by ORing the minterms product-of-sums forms. Minterms and maxterms are which correspond to the 1’s in the function’s truth table. products and sums of the variables involved in a func- Likewise, the product-of-maxterms expression may be tion. Each particular combination of noninverted and found by ANDing the maxterms which correspond to the inverted variables in a product or sum is given a minterm 0’s in the truth table. This is illustrated in Figure 3. Table 5. Minterms and Maxterms Table of Minterms for Three Table of Maxterms for Three Variables Variables Minterm Name Maxterm Name /x*/y*/z m0 x + y + z M0 /x*/y*z m1 x + y +/z M1 /x*y*/z m2 x +/y + z M2 /x*y*z m3 x +/y + /z M3 x*/y*/z m4 /x + y + z M4 x*/y*z m5 /x + y + /z M5 x*y*/z m6 /x + /y + z M6 x*y*z m7 /x + /y + /z M7 Conversion Between Canonical Forms One can convert back and forth between these repre- sentations by using the rules shown in Table 6. It is a simple matter to convert between canonical forms. Given a truth table for a function F, there are four differ- ent representations that can be used: Sum-of-minterms form of F Product-of-maxterms form of F Sum-of-minterms form of /F Product-of-maxterms form of /F Logic Reference Guide 6-5 AMD Minterm/ Maxterm A B C D X Y Number 000011 0 000101 1 001011 2 001111 3 010001 4 010110 5 011000 6 011111 7 100011 8 100111 9 101000 10 ...... ...... ...... 111100 15 a. Truth Table X = m0+m2+m3+m5+m7+m8+m9 X = M1*M4*M6*M10*M11*M12*M13*M14*M15 = ∑m (0,2,3,5,7,8,9) ΠM (1,4,6,10,11,12,13,14,15) = /A * /B * /C * /D ;m0 =(A+B+C+/D) ;M1 + /A * /B * C * /D ;m2 *(A+/B+C+D) ;M4 + /A */B* C * D;m3 *(A+/B+/C+D) ;M6 + /A * B * /C * D ;m5 *(/A+B+/C+D) ;M10 + /A * B * C * D ;m7 *(/A+B+/C+/D) ;M11 + A * /B * /C * /D ;m8 *(/A+/B+C+D) ;M12 + A */B* /C * D;m9 *(/A+/B+C+/D) ;M13 *(/A+/B+/C+D) ;M14 Y = m0+m1+m2+m3+m4+m7+m8+m9 *(/A+/B+/C+/D) ;M15 = ∑m (0,1,2,3,4,7,8,9) Y = M5*M6*M10*M11*M12*M13*M14*M15 = /A * /B * /C * /D ;m0 = ΠM (5,6,10,11,12,13,14,15) + /A */B* /C * D;m1 + /A */B* C * /D;m2 =(A+/B+C+/D) ;M5 + /A */B* C * D;m3 *(A+/B+/C+D) ;M6 + /A * B * /C * /D ;m4 *(/A+B+/C+D) ;M10 + /A * B * C * D ;m7 *(/A+B+/C+/D) ;M11 + A */B* /C * /D;m8 *(/A+/B+C+D) ;M12 + A */B* /C * D;m9 *(/A+/B+C+/D) ;M13 *(/A+/B+/C+D) ;M14 *(/A+/B+/C+/D) ;M15 b. The Sum-of-Minterms Expression c. The Product-of-Maxterms Expression Figure 3. Finding the Canonical Form from the Truth Table 6-6 Logic Reference Guide AMD Table 6. Conversion of Forms Table Desired Form Given Form Minterm Maxterm Inverted Minterm Inverted Maxterm Expansion of F Expansion of F Expansion of F Expansion of F Minterm – Maxterm numbers List Minterms not Maxterm numbers expansion are those numbers present in F are the same as of F not in the Minterm Minterm numbers list of F of F Maxterm Minterm numbers – Minterm numbers expansion are those numbers are the same as List Maxterms not of F not on the Maxterm Maxterm numbers present in F list of F of F Simplifying Logic There are four basic postulates, two of which are the commutative and distributive laws which were dis- Canonical forms are convenient in that it is easy to de- cussed above. From these postulates, it is possible to rive and convert them. However, the representation is derive nine basic theorems. The postulates and theo- bulky, since all variables must appear in each sum or rems are listed in Table 7. product. These expressions can be simplified by apply- ing the basic laws and theorems of Boolean algebra.