380 likes | 528 Views
Gates – Part 1. drain. drain. drain. no current flows. gate. 3 volts. 0 volts. current flows. source. source. source. Gates are Built With Transistors. nFet. nFetOn. nFetOff. N-type field-effect transistor = nFet. source. source. source. no current flows. gate. 0 volts.
E N D
Gates – Part 1 Sistem Komputer NAROTAMA
drain drain drain nocurrentflows gate 3 volts 0 volts currentflows source source source Gates are Built With Transistors nFet nFetOn nFetOff N-type field-effect transistor = nFet Sistem Komputer NAROTAMA
source source source nocurrentflows gate 0 volts 3 volts currentflows drain drain drain Gates are Built With Transistors pFet pFetOn pFetOff P-type field-effect transistor = pFet Sistem Komputer NAROTAMA
x x’ Complement Also known as invert or not. This is a schematic symbol. It is a graphical representationof a circuit which implementsthe operation. Sistem Komputer NAROTAMA
FET-Based Inverter Vcc=3V Vcc=3V Vcc=3V off on 3V Vin Vout 3V 0V 0V on off GND=0V GND=0V GND=0V Sistem Komputer NAROTAMA
A Q A B Q B AND and OR Gates Sistem Komputer NAROTAMA
Boolean Expressions and Gates Each Boolean expression has a corresponding realization with logic gates. F = A’ + B C A’ F B C Sistem Komputer NAROTAMA
NAND Gates AND NAND A Q B Q is true iff A AND B are true NAND A Q A B Q B Q is false iff A AND B are true Sistem Komputer NAROTAMA
Vcc Vcc GND GND FET-Based NAND Gate Vcc A B 1 1 1 0 off off off on F 0 1 A 1 1 on on B 1 0 on off GND Sistem Komputer NAROTAMA
NOR Gates OR NOR A Q B Q is true if A OR B is true NOR A Q A B Q B Q is false if A OR B is true Sistem Komputer NAROTAMA
A B F A B FET-Based NOR Gate Can you complete the truth table? Sistem Komputer NAROTAMA
FET-Based Gates • P-type FETs must be on top of gate • N-type FETs must be on bottom of gate • Due to electrical characteristics of the two FET types • Output is driven to either ‘1’ or ‘0’ • never both • never neither Sistem Komputer NAROTAMA
Exclusive-OR (XOR) Output is true iff inputs are different. A Q = A B = A’B + AB’ B Another definition: C is true if A /= B ECEn/CS 224
Exclusive-OR Theorems The first 4 are important, the others are used less infrequently Sistem Komputer NAROTAMA
Equivalence Operation denotes equivalence (also written as X==Y) Output is true iff inputs are equal X Q = (X==Y) = X’Y’ + XY Y Sistem Komputer NAROTAMA
XOR and EQUIV are Complements !! Equivalence – alternate symbol Bubble means NOT Gate often called exclusive NOR or XNOR Sistem Komputer NAROTAMA
Vcc A B C Vcc F A B A F B A C B GND GND Multi-Input Gates Which one will be slower/faster? Sistem Komputer NAROTAMA
Alternative Gate Symbols The symbolic meaning of the circuit should be clear from what you draw… Sistem Komputer NAROTAMA
Alternative Gate Symbols A A Q Q B B Q is true if A is false OR B is false A Q A B Q B Q is true iff A is false AND B is false Sistem Komputer NAROTAMA
Alternative Gate Symbols Turn on sprinklers if it is not a holiday and it is not a weekend or? The problem statement uses AND, so use the AND symbol Sistem Komputer NAROTAMA
Alternative Gate Symbols Turn off the sprinklers if it is a holiday or it is a weekend or? The problem statement uses OR, so use the OR symbol Sistem Komputer NAROTAMA
Another Example • Design a circuit to determine whether the bits of a 4-bit wire are all zero This is the appropriate symbol to use… Sistem Komputer NAROTAMA
Mixed Symbols • Such a gate doesn’t likely exist • Build from AND gate and inverter • Simplifies schematics • enhanced readability A Q B Q is true iff A is false AND B is true Sistem Komputer NAROTAMA
Single Gate Conversion Rules • Change symbol • AND to OR • OR to AND • Invert all inputs and outputs • No change in behavior – merely a symbol change A A Q Q B B Q is true iff A is false AND B is true Q is false if A is true OR B is false Sistem Komputer NAROTAMA
Alternative Gate Symbols - Summary • Use the symbol that matches the problem statement • Clarity • Documentation • Maintennance • If function is correct but symbol is wrong • your schematic is wrong Sistem Komputer NAROTAMA
Positive vs. Negative Logic Sistem Komputer NAROTAMA
Positive Logic and Negative Logic v1 Logic Gate v2 vout v3 Sistem Komputer NAROTAMA
Positive Logic Let: 0 volts => 0 5 volts => 1 The circuit is a logical AND gate Sistem Komputer NAROTAMA
Negative Logic Let: 0 volts => 1 5 volts => 0 The same circuit is a logical OR gate Sistem Komputer NAROTAMA
Positive/Negative Logic • The most common mapping is:+V 1 0V 0 • Different systems have used different mappings in the past Sistem Komputer NAROTAMA
Multi-Level Logic Sistem Komputer NAROTAMA
Levels of a Network Maximum number of gates between an input and the output 5 Levels • In general: • - the more levels • - the slower the circuit 3 Levels Sistem Komputer NAROTAMA
Number of Levels • Number of levels can be increased by factoring • Number of levels can be decreased by multiplying out G = AB + ACDE + ACF = A(B+CDE+CF) G = A(B+CDE+CF) = AB + ACDE + ACF Sistem Komputer NAROTAMA
Example Levels = 2 #Gates = 4 Delay = tAND4 + tOR3 #Inputs = 12#transistors = 24 Largest gate = 4 inputs G = AB + ACDE + ACF A B Area Calculations: - each input to a gate costs ~2 transistors - area # of transistors Delay Calculations: - find slowest path from inputs to output tdelay = tAND4 + tOR3 - the 4-input AND is likely slower than the other AND gates A C G D E A C F Sistem Komputer NAROTAMA
factor C D E C G F A B Change the number of levels by factoring G = ACDE + ACF + AB = A(CDE + CF + B) Levels = 3 #Gates = 4 Delay = tAND3 + tOR3 + tAND2 #Inputs = 10#transistors = 20 Largest gate = 3 inputs This is a 3-level circuit… Sistem Komputer NAROTAMA
factor A G B D C E F Factor Again G = A(CDE + CF + B) = A[B+C(F+DE)] Levels = 5 #Gates = 5 Delay = 3 x tAND2 + 2 x tOR2 #Inputs = 10#transistors = 20 Largest gate = 2 inputs This is a 5-level circuit… Sistem Komputer NAROTAMA
Changing the number of levels Three alternative solutions for same function… Each has different area/speed characteristics Sistem Komputer NAROTAMA
Two-Level vs. Multi-Level • In general: • two-level is fastest • multi-level can be smaller • Exploring by hand to find just the right solution can be difficult • We will focus on two-level • easy to get from truth table • minimization techniques in later chapters focus on it Sistem Komputer NAROTAMA