# Gates and Logic: From switches to Transistors , Logic Gates and Logic Circuits

date post

12-Jan-2016Category

## Documents

view

79download

0

Embed Size (px)

description

### Transcript of Gates and Logic: From switches to Transistors , Logic Gates and Logic Circuits

PowerPoint Presentation

Gates and Logic:From switches to Transistors, Logic Gates and Logic CircuitsHakim WeatherspoonCS 3410, Spring 2013Computer ScienceCornell UniversitySee: P&H Appendix C.2 and C.3 (Also, see C.0 and C.1)

iClickerLab0 wasa) Too easyb) Too hardc) Just rightd) Have not done lab yetGoals for TodayFrom Switches to Logic Gates to Logic CircuitsLogic GatesFrom switchesTruth TablesLogic CircuitsIdentity LawsFrom Truth Tables to Circuits (Sum of Products)Logic Circuit MinimizationAlgebraic ManipulationsTruth Tables (Karnaugh Maps) Transistors (electronic switch)

A switchActs as a conductor or insulatorCan be used to build amazing things

The Bombe used to break the German Enigma machine during World War II

Pictures show the Bombe built by Alan Turing to break the enigma machine ciphers.They were Fixed-Program Computers came before stored-program computers (general purpose)The former required re-wiring (e.g. ENIAC took 3 weeks to re-wire).

ABLightOFFOFFABLightOFFOFFOFFONABLightOFFOFFOFFONONOFFABLightOFFOFFOFFONONOFFONONABLightOFFOFFABLightOFFOFFOFFONABLightOFFOFFOFFONONOFFONONABLightABLightBasic Building Blocks: Switches to Logic Gates+--ABABABLightOFFOFFOFFONONOFFTruth Table+Speed and size of a mechanical switchBasic Building Blocks: Switches to Logic GatesEither (OR)

Both (AND)

+--ABLightOFFOFFOFFOFFONONONOFFONONONONABABABLightOFFOFFOFFOFFONOFFONOFFOFFONONONTruth Table+Speed and size of a mechanical switchBasic Building Blocks: Switches to Logic GatesEither (OR)

Both (AND)

--ABABABLightOFFOFFOFFOFFONONONOFFONONONONABLightOFFOFFOFFOFFONOFFONOFFOFFONONONTruth TableORANDSpeed and size of a mechanical switchBasic Building Blocks: Switches to Logic GatesEither (OR)

Both (AND)

--ABABABLight000011101111ABLight000010100111Truth Table0 = OFF1 = ONORANDSpeed and size of a mechanical switchBasic Building Blocks: Switches to Logic GatesDid you know?George Boole Inventor of the idea of logic gates. He was born in Lincoln, England and he was the son of a shoemaker in a low class family.

ABAB

George Boole,(1815-1864)ORANDE.g. logic statements:Jane will only go to the cinema tonight if a good film is on AND she has enough money.Stuart will only go to the birthday party on Sunday if Katie OR Sujit is going too.

TakeawayBinary (two symbols: true and false) is the basis of Logic DesignAdd takeways at end of a block. Possibly build on takeaways throughout lecture10Building Functions: Logic GatesNOT:

AND:

OR:

Logic Gatesdigital circuit that either allows a signal to pass through it or not.Used to build logic functionsThere are seven basic logic gates: AND, OR, NOT, NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later]ABOut000011101111ABOut000010100111AOutABABInFlash DrivesCreate truth table of AND or OR: state what they doBuilding Functions: Logic GatesNOT:

AND:

OR:

Logic Gatesdigital circuit that either allows a signal to pass through it or not.Used to build logic functionsThere are seven basic logic gates: AND, OR, NOT, NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later]ABOut000011101111ABOut000010100111AOut0110ABABInFlash DrivesCreate truth table of AND or OR: state what they do

Did you know? Logic gates allow the computer to do things such as add, divide, multiply, do simple yes and no reasoning in certain situations along with other things.

NOT:

AND:

OR:

Logic Gatesdigital circuit that either allows a signal to pass through it or not.Used to build logic functionsThere are seven basic logic gates: AND, OR, NOT, NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later]Building Functions: Logic GatesABOut000011101111ABOut000010100111AOut0110ABABInABOut001010100110ABOut001011101110ABABNAND:NOR:Flash DrivesCreate truth table of AND or OR: state what they do

Did you know? Logic gates allow the computer to do things such as add, divide, multiply, do simple yes and no reasoning in certain situations along with other things.

Fill in the truth table, given the following Logic Circuit made from Logic AND, OR, and NOT gates.What does the logic circuit do?Activity#1.A: Logic GatesabOutabOutFill out table

Put, NOT, AND, OR labels in box14XOR: out = 1 if a or b is 1, but not both; out = 0 otherwise.out = 1, only if a = 1 AND b = 0 OR a = 0 AND b = 1Activity#1.A: Logic GatesabOut000011101110abOutFill out table15XOR: out = 1 if a or b is 1, but not both; out = 0 otherwise.out = 1, only if a = 1 AND b = 0 OR a = 0 AND b = 1Activity#1.A: Logic GatesabOut000011101110abOutFill out table

Remove instructions16Activity#1: Logic GatesFill in the truth table, given the following Logic Circuit made from Logic AND, OR, and NOT gates.What does the logic circuit do?abdOutabdOut000001010011100101110111Fill out table17Activity#1: Logic GatesMultiplexor: select (d) between two inputs (a and b) and set one as the output (out)?out = a, if d = 0out = b, if d = 1abdOut00000010010001111001101011011111abdOutFill out tableAsk rows in audience to fill in different rows of tabel18Goals for TodayFrom Switches to Logic Gates to Logic CircuitsLogic GatesFrom switchesTruth TablesLogic CircuitsIdentity LawsFrom Truth Tables to Circuits (Sum of Products)Logic Circuit MinimizationAlgebraic ManipulationsTruth Tables (Karnaugh Maps) Transistors (electronic switch)

Next GoalGiven a Logic function, create a Logic Circuit that implements the Logic Functionand, with the minimum number of logic gates

Fewer gates: A cheaper ($$$) circuit!

Can get logic circuit from truth tableMinimize logic circuit through algebraic reductions or Karnaugh Maps20NOT:

AND:

OR:

XOR:

Logic EquationsConstants: true = 1, false = 0Variables: a, b, out, Operators (above): AND, OR, NOT, etc.Logic GatesABOut000011101111ABOut000010100111AOut0110ABABInABOut000011101110ABXOR is not a basic Logic Gate since it can be created from AND and OR gates, but it is often used as a basic Logic OperatorNOT:

AND:

OR:

XOR:

Logic EquationsConstants: true = 1, false = 0Variables: a, b, out, Operators (above): AND, OR, NOT, etc.Logic GatesABOut000011101111ABOut000010100111AOut0110ABABInABOut000011101110ABABOut001010100110ABOut001011101110ABABNAND:NOR:ABOut001010100111ABXNOR:XOR is not a basic Logic Gate since it can be created from AND and OR gates, but it is often used as a basic Logic OperatorLogic EquationsApologize that there are three ways to represent the same logic equation

XOR is not a basic Logic Gate since it can be created from AND and OR gates, but it is often used as a basic Logic OperatorAND is productOR is sumRead outloudLogic EquationsApologize that there are three ways to represent the same logic equation

XOR is not a basic Logic Gate since it can be created from AND and OR gates, but it is often used as a basic Logic OperatorAND is productOR is sumRead outloudIdentitiesIdentities useful for manipulating logic equationsFor optimization & ease of implementation

a + 0 = a + 1 = a + =

a 0 = a 1 = a = Minimization activityMaybe use picture to go through

Complement a+=1 and a=0IdentitiesIdentities useful for manipulating logic equationsFor optimization & ease of implementation

a + 0 = a + 1 = a + =

a 0 = a 1 = a = a 1 1

0 a 0

ababMinimization activityMaybe use picture to go through

Complement a+=1 and a=0IdentitiesIdentitiesABABABABActivity #2: IdentitiesShow that the Logic equationsbelow are equivalent.

(a+b)(a+c)= a + bc

(a+b)(a+c)=Minimization activityActivity #2: IdentitiesShow that the Logic equationsbelow are equivalent.

(a+b)(a+c)= a + bc

(a+b)(a+c)= aa + ab + ac + bc= a + a(b+c) + bc= a(1 + (b+c)) + bc= a + bc

Minimization activityLogic Manipulationfunctions: gates truth tables equationsExample: (a+b)(a+c) = a + bcabc000001010011100101110111(a+b)(a+c)= aa + ab + ac + bc= a + a(b+c) + bc= a(1 + (b+c)) + bc= a + bcabc000001010011100101110111a+ba+cLHS000010100111111111111111bcRHS0000001101010111Logic Manipulationfunctions: gates truth tables equationsExample: (a+b)(a+c) = a + bc

(a+b)(a+c)= aa + ab + ac + bc= a + a(b+c) + bc= a(1 + (b+c)) + bc= a + bcTakeawayBinary (two symbols: true and false) is the basis of Logic Design

More than one Logic Circuit can implement same Logic function. Use Algebra (Identities) or Truth Tables to show equivalence.Add takeways at end of a block. Possibly build on takeaways throughout lecture33Think-Pair-Share: Why does minimization matterGoals for TodayFrom Switches to Logic Gates to Logic CircuitsLogic GatesFrom switchesTruth TablesLogic CircuitsIdentity LawsFrom Truth Tables to Circuits (Sum of Products)Logic Circuit MinimizationAlgebraic ManipulationsTruth Tables (Karnaugh Maps) Transistors (electronic switch)

Next GoalHow to standardize minimizing logic circuits?Logic MinimizationHow to implement a desired logic function?

abcout00000011010001111000101111001110Draw circuit and go through out=true casesHave not done cheaply yetLogic MinimizationHow to implement a desired logic function?

abcout00000011010001111000101111001110Write mintermssum of products:OR of all minterms where out=1minterma b ca b ca b ca b ca b ca b ca b ca b cShow what out equalsLogic MinimizationHow to implement a desired logic function?

abcout00000011010001111000101111001110corollary: any combinational circuit can be implemented in two levels of logic (ignoring inverters)minterma b ca b ca b ca b ca b ca b ca b ca b ccoutbaShow what out equalsKarnaugh MapsHow does one find the most efficient equation?Manipulate algebraically until?Use Karnaugh maps (optimize visually)Use a software optimizer

For large circuitsDecomposition & reuse of building blocks

abcout00000011010001111001101111001110Minimization with Karnaugh maps (1)abcout000000110100011110011011110011100001110100 01 11 1001cabMinimization with Karnaugh maps (2)abcout000000110100011110011011110011100001110100 01 11 1001cabMinimization with Karnaugh maps (2)Karnaugh Minimization Tricks (1)0111001000 01 11 1001cab1111001000 01 11 1001cabKarnaugh Minimization Tricks (1)0111001000 01 11 1001cab1111001000 01 11 1001cabKarnaugh Minimization Tricks (2)100100000000100100 01 11 100001abcd1110000010011001000000 01 11 100001abcd1110Karnaugh Minimization Tricks (2)100100000000100100 01 11 100001abcd1110000010011001000000 01 11 100001abcd1110Karnaugh Minimization Tricks (3)100x0xx00xx0100100 01 11 100001abcd111000001xxx1xx1000000 01 11 100001abcd1110Karnaugh Minimization Tricks (3)100x0xx00xx0100100 01 11 100001abcd111000001xxx1xx1000000 01 11 100001abcd1110MultiplexerA multiplexer selects between multiple inputsout = a, if d = 0out = b, if d = 1

Build truth tableMinimize diagramDerive logic diagramabdabdout000001010011100101110111What is the truth tableMultiplexer Implementationabdout00000010010001111001101011011111abdMultiplexer Implementationabdout00000010010001111001101011011111Build the Karnaugh map

abd00 01 11 1001dabMultiplexer Implementationabdout00000010010001111001101011011111Build the Karnaugh map

abd0011011000 01 11 1001dabMultiplexer Implementationdoutba00 01 11 1001dab00110110abdout00000010010001111001101011011111abdTakeawayBinary (two symbols: true and false) is the basis of Logic Design

More than one Logic Circuit can implement same Logic function. Use Algebra (Identities) or Truth Tables to show equivalence.

Any logic function can be implemented as sum of products. Karnaugh Maps minimize number of gates.Add takeways at end of a block. Possibly build on takeaways throughout lecture55Goals for TodayFrom Transistors to Gates to Logic CircuitsLogic GatesFrom transistorsTruth TablesLogic CircuitsIdentity LawsFrom Truth Tables to Circuits (Sum of Products)Logic Circuit MinimizationAlgebraic ManipulationsTruth Tables (Karnaugh Maps) Transistors (electronic switch)

Activity#1 How do we build electronic switches?Transistors:6:10 minutes (watch from from 41s to 7:00)http://www.youtube.com/watch?v=QO5FgM7MLGg

Fill our Transistor Worksheet with info from Video Everything that we have shown them can be constructed in silicon.57NMOS Transistor

Connect source to drain when gate = 1N-channelVDVS = 0 VVGVG = VSVG = 0 VNMOS and PMOS TransistorsPMOS Transistor

Connect source to drain when gate = 0P-channelVSVD = 0 VVGVG = VSVG = 0 VNMOS Transistor

Connect source to drain when gate = 1N-channelVDVS = 0 VVGVG = 1VG = 0NMOS and PMOS TransistorsPMOS Transistor

Connect source to drain when gate = 0P-channelVSVD = 0 VVGVG = 1VG = 0InverterInOut0110Function: NOTCalled an inverterSymbol:

Useful for taking the inverse of an input

CMOS: complementary-symmetry metaloxidesemiconductorinoutTruth tableinoutVsupply (aka logic 1)01(ground is logic 0)InverterInOut0110Function: NOTCalled an inverterSymbol:

Useful for taking the inverse of an input

CMOS: complementary-symmetry metaloxidesemiconductorinoutTruth tableinoutVsupply10Vsupply (aka logic 1)(ground is logic 0)InverterAOut0110Function: NOTCalled an inverterSymbol:

Useful for taking the inverse of an input

CMOS: complementary-symmetry metaloxidesemiconductorinoutTruth tableA = 0Out = 1A = 1Out = 0inoutVsupplyVsupply (aka logic 1)(ground is logic 0)NAND GateABout0011 01011110Function: NANDSymbol:

baoutAoutVsupplyBBAVsupply11110NOR GateABout001100010110Function: NORSymbol:

baoutAoutVsupplyBBA00001ExampleBuilding Functions (Revisited)NOT:

AND:

OR:

NAND and NOR are universalCan implement any function with NAND or just NOR gatesuseful for manufacturingFlash DrivesCreate truth table of AND or OR: state what they doBuilding Functions (Revisited)NOT:

AND:

OR:

NAND and NOR are universalCan implement any function with NAND or just NOR gatesuseful for manufacturingbabaaFlash DrivesCreate truth table of AND or OR: state what they doLogic GatesOne can buy gates separatelyex. 74xxx series of integrated circuitscost ~$1 per chip, mostly for packaging and testing

Cumbersome, but possible to build devices using gates put together manually

Then and NowThe first transistoron a workbench at AT&T Bell Labs in 1947Bardeen, Brattain, and Shockley

An Intel Westmere1.17 billion transistors240 square millimetersSix processing cores

http://www.theregister.co.uk/2010/02/03/intel_westmere_ep_preview/John BardeenWalter BrattainWilliam ShockleyBig Picture: AbstractionHide complexity through simple abstractionsSimplicityBox diagram represents inputs and outputsComplexityHides underlying NMOS- and PMOS-transistors and atomic interactionsinoutVddVssinoutoutadbabdoutSummaryMost modern devices are made from billions of on /off switches called transistorsWe will build a processor in this course!Transistors made from semiconductor materials:MOSFET Metal Oxide Semiconductor Field Effect TransistorNMOS, PMOS Negative MOS and Positive MOSCMOS Complimentary MOS made from PMOS and NMOS transistorsTransistors used to make logic gates and logic circuitsWe can now implement any logic circuitCan do it efficiently, using Karnaugh maps to find the minimal terms requiredCan use either NAND or NOR gates to implement the logic circuitCan use P- and N-transistors to implement NAND or NOR gates