
7b5e9a1feb83664239aac698c33fd69d.ppt
- Количество слайдов: 45
Combinational Logic Circuits • • • Read MK 29 -80 Binary Logic and Gates Logic Simulation Boolean Algebra Standard Forms Karnaugh Maps NAND/NOR and XOR gates
Schematic for 4 Bit ALU Inverto r AN D Gate EXO R Gate OR Gate 2. 2 - Jon Turner - 3/17/2018
Simulation of 4 Bit ALU A 4 B 4 S 2. 3 - Jon Turner - 3/17/2018 D 2 if S=0 then D=B-A if S=1 then D=A-B if S=2 then D=A+B if S=3 then D=-A
Elementary Binary Logic Functions n Digital circuits represent information using two voltage levels. » binary variables are used to denote these values » by convention, the values are called “ 1” and “ 0” and we often think of them as meaning “True” and “False” n Functions of binary variables are called logic functions. » AND(A, B) = 1 if A=1 and B=1, else it is zero. – AND is generally written in the shorthand A×B (or A&B or AÙB) » OR(A, B) = 1 if A=1 or B=1, else it is zero. – OR is generally written in the shorthand form A+B (or A|B or AÚB) » NOT(A) = 1 if A=0 else it is zero. – NOT is generally written in the shorthand form n (or ØA or A ) AND, OR and NOT can be used to express all other logic functions. 2. 4 - Jon Turner - 3/17/2018
0 0 1 1 0 1 1 1 0 0 1 n Can 1 1 1 0 0 1 1 0 A B B A (A B) (B A) B 0 1 EQUAL A 0 0 1 1 ZERO ONE A B AND NAND OR NOR EXOR Two Variable Binary Logic Functions 1 0 0 1 1 1 0 0 1 0 0 make similar truth tables for 3 variable or 4 variable functions, but gets big (256 & 65, 536 columns). n Representing functions in terms of AND, OR, NOT. » NAND(A, B) = (A×B) » EXOR(A, B) = (A ×B) + (A×B ) 2. 5 - Jon Turner - 3/17/2018
Basic Logic Gates AND Gate X Y X×Y X Y X+Y OR Gate Inverter n Logic X Timing Diagram X Y X’ X×Y X+Y X’ gates “compute” elementary binary functions. » output of an AND gate is “ 1” when both of its inputs are “ 1”, otherwise the output is zero » similarly for OR gate and inverter n Timing diagram shows how output values change over time as input values change. 2. 6 - Jon Turner - 3/17/2018
Multivariable Gates 3 input AND Gate A B A×B×C C 6 input OR Gate A B C D E F A+B+C+D+E+F n AND function on n variables is “ 1” if and only if ALL its arguments are “ 1”. » n input AND gate output is “ 1” if all inputs are “ 1” n OR function on n variables is “ 1” if and only if at least one of its arguments is “ 1”. » n input OR gate output is “ 1” if any inputs are “ 1” n Can construct “large” gates from 2 input gates. » however, large gates can be less expensive than required number of 2 input gates 2. 7 - Jon Turner - 3/17/2018
Elements of Boolean Algebra n Boolean algebra defines rules for manipulating symbolic binary logic expressions. » a symbolic binary logic expression consists of binary variables and the operators AND, OR and NOT (e. g. A+B×C ) The possible values for any Boolean expression can be tabulated in a truth table. A B C B×C A+B×C n Can define circuit for 0 0 0 0 1 0 0 expression by combining 0 1 1 gates. 0 1 1 0 0 n A B C 2. 8 - Jon Turner - 3/17/2018 A+B×C 1 1 0 0 1 1 0 1 0 0 1 1 1 1
Schematic Capture & Logic Simulation schematic entry tools wires schematic symbols gates signal waveforms terminals signal names 2. 9 - Jon Turner - 3/17/2018
Installing CAD Tools xilinx. com/univ/ link to resource center 2. 10 - Jon Turner - 3/17/2018
Accessing Installation Tutorial link to installation tutorial 2. 11 - Jon Turner - 3/17/2018
Installation Tutorial Follow instructions carefully. It’s easy to do it right, but it’s even easier to do wrong! 2. 12 - Jon Turner - 3/17/2018 Go through tutorial and print each page before starting installation
Outline of Installation n Xilinx University page - http: //xilinx. com/univ/index. htm n University resource center - http: //xup. msu. edu/ » for installation tutorial - recommend you print this out first! n Problems/issues » disks may be mislabeled - tutorial says they are, mine weren’t » installation instructions included with disks may be wrong » modelsim is not included on the install disk, but is available on web site n Major steps – see tutorial for details » Find registration id on printed card with software » Install software and documentation – choose typical installation with all device types (default) – when Multi. Linx driver dialog box comes up, just say no » Install the service pack from the Xilinx web site (use link on tutorial) » Install the IP update from the Xilinx web site (use link on tutorial) » Install Model. Sim from the Xilinx web site (use link on tutorial) – select MXE Starter – license Model. Sim 2. 13 - Jon Turner - 3/17/2018
Starting New Project n Start Project Navigator by selecting » Start Programs Xilinx ISE 4 Project Navigator File New Project Specify name and location Specify Virtex 2 and XST VHDL 2. 14 - Jon Turner - 3/17/2018
Starting New Project New Source Select Schematic enter name 2. 15 - Jon Turner - 3/17/2018
Starting New Project zoom controls click here to create gate 2. 16 - Jon Turner - 3/17/2018 select and 2
Starting New Project wiring tool IO pin tool add IO pins add wires 2. 17 - Jon Turner - 3/17/2018
Starting New Project rename as desired 2. 18 - Jon Turner - 3/17/2018 double-click for properties
Simulating Circuit Project New Source 2. 19 - Jon Turner - 3/17/2018 select test bench waveform
Specifying Inputs to Circuit define input waveforms by clicking to create transitions note how all combinations of inputs are defined When saving enter 1. Comes up on startup - enter 10 in both and ns for Time Scale 2. 20 - Jon Turner - 3/17/2018
Generating Expected Results double-click here to generate expected results finally, double-click here to do full simulation 2. 21 - Jon Turner - 3/17/2018 expected results shown in HDL Bencher quit without saving
Running Simulation main Model. Sim command window zoom controls waveforms appear here 2. 22 - Jon Turner - 3/17/2018 restart and Run –all buttons
Boolean Functions to Logic Circuits n Any Boolean expression can be converted to a logic circuit made up of AND, OR and NOT gates. step 1: add parentheses to expression to fully define order of operations - A+(B×(C )) step 2: create gate for “last” operation in expression gate’s output is value of expression gate’s inputs are expressions combined by operation A (B×(C )) A+B×C step 3: repeat for sub-expressions and continue until done n Number of simple gates needed to implement expression equals number of operations in expression. » so, simpler equivalent expression yields less expensive circuit » Boolean algebra provides rules for simplifying expressions 2. 23 - Jon Turner - 3/17/2018
Basic Identities of Boolean Algebra 1. 3. 5. 7. 9. 10. 12. 14. 16. X+0=X 2. X+1=1 4. X+X=X 6. X + X’ = 1 8. (X ’)’ = X X+Y=Y+X 11. X+(Y+Z ) = (X+Y )+Z 13. X(Y+Z ) = X×Y + X×Z 15. (X + Y ) = X ×Y 17. X× 1 = X X× 0 = 0 X×X = X X×X’ = 0 X×Y = Y×X X×(Y×Z ) = (X×Y )×Z X+(Y×Z ) = (X+Y )×(X+Z ) (X×Y)’ = X +Y commutative associative distributive De. Morgan’s n Identities define intrinsic properties of Boolean algebra. n Note: 15 -17 have no counterpart in ordinary algebra. n Parallel columns illustrate duality principle. n Other handy identities. » A+AB=A (follows from 2, 14 and 3), A+A’B=A+B (15, 7 and 2) 2. 24 - Jon Turner - 3/17/2018
Verifying Identities Using Truth Tables XY 00 01 10 11 (X + Y ) = X ×Y X+(Y×Z ) = (X+Y )×(X+Z ) (X + Y ) X ×Y XYZ Y×Z X+(Y×Z ) X+Y X+Z (X+Y )×(X+Z ) 1 1 000 0 0 0 001 0 0 0 010 0 0 1 0 0 011 1 1 100 0 1 1 101 0 1 1 110 0 1 1 111 1 1 n Can verify any logical equation with small number of variables using truth tables. n Break large expressions into parts, as needed. 2. 25 - Jon Turner - 3/17/2018
De. Morgan’s Laws for n Variables n We can extend De. Morgan’s laws to 3 variables by applying the laws for two variables. (X + Y + Z ) associative law = (X + (Y + Z )) De. Morgan’s law - by associative law (X×Y×Z) = (X×(Y×Z )) = X ×(Y + Z ) = X ×Y ×Z De. Morgan’s law = X + (Y + Z ) De. Morgan’s law - by = X ×(Y ×Z ) = X + (Y×Z ) 2. 26 - Jon Turner - 3/17/2018 - by associative law - by
Simplification of Boolean Expressions X Y Z F=X YZ +XZ by identity 14 X Y F=X Y (Z +Z )+XZ Z by identity 7 X Y Z 2. 27 - Jon Turner - 3/17/2018 F=X Y× 1+XZ =X Y +XZ by identity 2
The Duality Principle n The dual of a Boolean expression is obtained by interchanging all ANDs and ORs, and all 0 s and 1 s. » example: the dual of A+(B×C )+0 is A×(B+C )× 1 n The duality principle states that if E 1 and E 2 are Boolean expressions then E 1= E 2 dual (E 1)=dual (E 2) where dual(E) is the dual of E. For example, A+(B×C )+0 = (B ×C )+D A×(B+C )× 1 = (B +C )×D » consequently, the pairs of identities (1, 2), (3, 4), (5, 6), (7, 8), (10, 11), (12, 13), (14, 15) and (16, 17) all follow from each other through the duality principle » also, A+AB=A A(A+B)=A & A+A’B=A+B A(A’+B)=AB 2. 28 - Jon Turner - 3/17/2018
The Consensus Theorem. XY +YZ + X Z = XY + X Z Proof. XY +YZ + X Z = XY + (X + X )YZ + X Z = XY + XYZ + X Z 14 = XY(1 + Z ) + X Z(Y + 1) 2, 11, 14 = XY + X Z 3, 2 Example. (A + B )(A + C ) = AA + AC + A B + BC = AC + A B Dual. (X + Y )(Y + Z )(X + Z ) = (X + Y )(X + Z ) 2. 29 - Jon Turner - 3/17/2018 2, 7
Taking the Complement of a Function Method 1. Apply De. Morgan’s Theorem repeatedly. (X(Y Z + YZ )) = X + (Y Z + YZ ) = X + (Y Z ) (YZ ) = X + (Y + Z )(Y + Z ) Method 2. Complement literals and take dual (X (Y Z + YZ )) = dual (X (YZ + Y Z )) = X + (Y + Z )(Y + Z ) 2. 30 - Jon Turner - 3/17/2018
Sum of Products Form n The sum of products is one of two standard forms for Boolean expressions. sum-of-products-expression × ××× × literal = p-term + p-term . . . + p-term = literal × literal » example. X Y Z + XYZ n. A minterm is a term that contains every variable, in either complemented or uncomplemented form. » example. in expression above, X Y Z is minterm, but X Z is not n. A sum of minterms expression is a sum of products expression in which every term is a minterm. » example: X Y Z + X YZ + XYZ is sum of minterms expression that is equivalent to expression above. » shorthand : list minterms numerically, so X Y Z + X YZ + 2. 31 - Jon Turner - 3/17/2018
Simplifying Sum-of-Products Expressions Sum of products forms yield 2 level AND-OR circuits. n Any expression can be put into sum of products form by applying distributive laws. n The simplest sum of products expression yields simplest 2 level AND-OR circuit. n Any Boolean expression can be viewed as a set of minterms. n An expression F covers another expression G, if the minterms in G are a subset of the minterms in F. n » AC covers AB’C, since AC contains minterms 5 and 7 (from the set of 8 minterms on the variables A, B, and C ) and AB’C contains only minterm 5. 2. 32 - Jon Turner - 3/17/2018
General Simplification Procedure Given an expression F (e. g. ABD+A B+BC D +B CD ). Step 1. Let M be the set of minterms covered by F. A B CD A BCD ABCD AB CD Step 2. For each minterm, m, find all maximal terms that cover m and also cover other minterms in M, but no minterms that are not in M. Let T be the resulting set of terms. (T={ A B, BC , BD, CD, A C, B C }) Step 3. Select all terms in T that cover minterms covered by no other terms in T ({ BC , B C }) Step 4. Select additional terms in T until selected terms cover all minterms. At each step, select a term that covers the largest possible number of new minterms. ({ A B, CD }) 2. 33 - Jon Turner - 3/17/2018
Simplification Using Karnaugh Maps Step 1. List all minterms covered by F. CD AB 00 01 11 10 0 01 1 10 0 00 0 1 1 1 1 0 1 Step 2. Find maximal terms. CD AB 00 00 0 01 1 10 0 2. 34 - Jon Turner - 3/17/2018 01 11 10 0 1 1 1 1 0 1 Step 3. Select essential terms. CD AB 00 00 0 01 1 10 0 01 11 10 0 1 1 1 1 0 1 Step 4. Cover remaining minterms. CD AB 00 00 0 01 1 10 0 01 11 10 0 1 1 1 1 0 1
More Karnaugh Maps BC 00 01 11 10 A 0 1 0 1 1 1 F=AB C +ABC +BC F=A+B C +BC n CD AB 00 01 11 10 0 1 1 1 0 0 0 1 1 1 F=A BC +A CD +ABC Covering 0 s gives +AB C D +ABC +AB C complement of function. F=BC +CD + AC+ AD CD 00 01 11 10 AB F = A B C +B C D +A CD 00 0 1 01 1 1 0 1 If we then take the complement of this 11 1 1 expression, we get the product of sums form. 10 1 1 F = (A+B +C )(B +C +D )(A+C +D ) 2. 35 - Jon Turner - 3/17/2018
Don’t Care Conditions n In some situations, we don’t care about the value of a function for certain combinations of the variables. » these combinations may be impossible in certain contexts » or the value of the function may not matter in when the combinations occur n In such situations we say the function is incompletely specified and there are multiple (completely specified) logic functions that can be used in the design. » so we can select a function that gives the simplest circuit n When constructing the terms of T in the simplification procedure, we can choose to either cover or not cover the don’t care conditions. 2. 36 - Jon Turner - 3/17/2018
Map Simplification with Don’t Cares CD 00 01 11 10 AB 00 01 11 10 0 x 1 x 1 0 0 x 1 1 n Alternative 0 1 x 1 F=A C D+B+AC covering. CD 00 01 11 10 AB 00 01 11 10 0 x 1 x 1 0 2. 37 - Jon Turner - 3/17/2018 0 x 1 1 0 1 x 1 F=A B C D+ABC +BC+AC
Product of Sums Form n The product of sums is the second standard form for Boolean expressions. product-of-sums-expression = s-term × s-term . . . × s-term = literal + ××× + literal » example. (X +Y +Z )(X +Y +Z ) n. A maxterm is a sum term that contains every variable, in complemented or uncomplemented form. » example. in exp. above, X +Y +Z is a maxterm, but X +Z is not n. A product of maxterms expression is a product of sums expression in which every term is a maxterm. » example. (X +Y +Z )(X +Y+Z )(X+Y+Z ) is product of maxterms expression that is equivalent to expression above. » shorthand : list maxterms numerically: so, (X +Y +Z )(X +Y+Z ) 2. 38 - Jon(X+Y+Z ) becomes 110+100+001+000 or P M(6, 4, 1, 0) Turner - 3/17/2018
NAND and NOR Gates NAND Gate X Y (X×Y) X Y NOR Gate n In (X+Y) certain technologies (including CMOS), a NAND (NOR) gate is simpler & faster than an AND (OR) gate. n Consequently circuits are often constructed using NANDs and NORs directly, instead of ANDs and ORs. n Alternative gate representations makes this easier. = = = 2. 39 - Jon Turner - 3/17/2018 =
Exclusive Or and Odd Function Pure NAND Implementation EXOR gate A AB A +A B B B EXOR function is defined by A B = AB + A B. n The odd function on n variables is 1 when an odd number of its variables are 1. n The » odd(X, Y, Z ) = XY Z + X Y Z = X Y Z » similarly for 4 or more variables checking circuits use the odd function to provide a simple integrity check to verify correctness of data. n Parity » any erroneous single bit change will alter value of odd function, allowing detection of the change 2. 40 - Jon Turner - 3/17/2018
Integrated Circuits n Digital logic is implemented using transistors in integrated circuits containing many gates. » small-scale integrated circuits (SSI) contain 10 gates or less » medium-scale integrated circuits (MSI) contain 10 -100 gates » large-scale integrated circuits (LSI) contain up to 104 gates » very large-scale integrated circuits (VLSI) contain >104 gates n Improvements in manufacturing lead to ever smaller transistors allowing more per chip. » >107 gates/chip now possible; doubles every 18 -24 months n Variety of logic families. » TTL - transistor-transistor logic » CMOS - complementary metal-oxide semiconductor » ECL - emitter-coupled logic » Ga. As - gallium arsenide 2. 41 - Jon Turner - 3/17/2018
CMOS Logic Gates n CMOS integrated circuits are built using two types of Field Effect Transistors (FET), n-type & p-type. n-FET p-FET off n-FET on n-FET L gate off p-FET on p-FET L H H » the gate (note different meaning) input controls whether current can flow between the other two terminals or not. n Logic gates are constructed by combining transistors in complementary arrangements. inverter A transmission gate NOR NAND B (AB) B A (A+B ) TG 2. 42 - Jon Turner - 3/17/2018
Circuit Delays in CMOS Circuits n n Electronic gates are physical devices X Y Z that take time to operate. Response to instantaneous change at X X is gradual decrease in voltage at Y Y and similar gradual increase at Z. Voltage at Y must drop below logic Z threshold level to be “seen” as a ‘ 0’. This effect can be viewed as delay in propagation of logic values. » t. PLH denotes low-to-high delay » t. PHL denotes high-to-low delay » tpd= max{t. PLH, t. PHL} » relative values of t. PLH and t. PHL depend on relative “strength” of pullup and pull-down transistors in inverters » values vary with operating temperature and manufacturing processes 2. 43 - Jon Turner - 3/17/2018
Closer Look at CMOS Circuit Delays X X Y Y equivalent circuit when X is low Z Z X X goes high, pull-up of first inverter turns off and pull-down turns on. n Decrease of voltage at Y requires transfer of charge from capacitor to ground. Y Z n When » wires and transistor gates act like capacitors » time for transfer depends on size of capacitance and on resistance of pull-down transistor » pull-up & pull-down transistors can have different “on-state” resistance values n Use of two parallel inverters between X and Y can give faster logic transitions. 2. 44 - Jon Turner - 3/17/2018 equivalent circuit when X is high X Y Z
Negative Logic – What’s in a Name? n In positive logic systems, a high voltage is associated with a logic 1, and a low voltage with a logic 0. » positive logic is just one of two conventions that can be used to associate a logic value with a voltage » sometimes it is more convenient to use opposite convention n Circuits often have some signals that are “active low”. » a signal called “enable” may allow some operation to occur only when it is low » it’s good practice to label such signals explicitly to prevent confusion - e. g. enable. L » the name of a signal may determine if it’s viewed as active high or active low (for example enable. L=inhibit. H) ¢ To avoid ambiguity, manufacturers generally specify components in terms of high and low voltage values. 2. 45 - Jon Turner - 3/17/2018
7b5e9a1feb83664239aac698c33fd69d.ppt