Gates and Logic: From switches to Transistors, Logic Gates ...· Gates and Logic: From switches to Transistors, Logic Gates and Logic Circuits ... (ignoring inverters) minterm a b

  • View
    216

  • Download
    4

Embed Size (px)

Text of Gates and Logic: From switches to Transistors, Logic Gates ...· Gates and Logic: From switches to...

  • GatesandLogic:FromswitchestoTransistors,LogicGatesandLogicCircuits

    HakimWeatherspoonCS3410,Spring2013ComputerScienceCornellUniversity

    See:P&HAppendixC.2andC.3(Also,seeC.0andC.1)

  • iClickerLab0wasa)Tooeasyb)Toohardc)Justrightd)Havenotdonelabyet

  • GoalsforTodayFromSwitchestoLogicGatestoLogicCircuitsLogicGates

    Fromswitches TruthTables

    LogicCircuits IdentityLaws FromTruthTablestoCircuits(SumofProducts)

    LogicCircuitMinimization AlgebraicManipulations TruthTables(Karnaugh Maps)

    Transistors(electronicswitch)

  • Aswitch

    Actsasaconductor orinsulator

    Canbeusedtobuildamazingthings

    TheBombeusedtobreaktheGermanEnigmamachineduringWorldWarII

  • A B LightOFF OFFA B LightOFF OFFOFF ON

    A B LightOFF OFFOFF ONON OFF

    A B LightOFF OFFOFF ONON OFFON ON

    A B LightOFF OFFA B LightOFF OFFOFF ON

    A B LightOFF OFFOFF ONON OFFON ON

    A B Light

    A B Light

    BasicBuildingBlocks:SwitchestoLogicGates

    +

    A

    B

    A

    B

    A B LightOFF OFFOFF ONON OFF

    TruthTable

    +

  • BasicBuildingBlocks:SwitchestoLogicGates

    Either(OR)

    Both(AND)

    +

    A B LightOFF OFF OFFOFF ON ONON OFF ONON ON ON

    A

    B

    A

    B

    A B LightOFF OFF OFFOFF ON OFFON OFF OFFON ON ON

    TruthTable

    +

  • BasicBuildingBlocks:SwitchestoLogicGates

    Either(OR)

    Both(AND)

    A

    B

    A

    B

    A B LightOFF OFF OFFOFF ON ONON OFF ONON ON ON

    A B LightOFF OFF OFFOFF ON OFFON OFF OFFON ON ON

    TruthTable

    OR

    AND

  • BasicBuildingBlocks:SwitchestoLogicGates

    Either(OR)

    Both(AND)

    A

    B

    A

    B

    A B Light0 0 00 1 11 0 11 1 1

    A B Light0 0 00 1 01 0 01 1 1

    TruthTable

    0=OFF1=ONOR

    AND

  • BasicBuildingBlocks:SwitchestoLogicGates

    Didyouknow?GeorgeBooleInventoroftheideaoflogicgates.HewasborninLincoln,Englandandhewasthesonofashoemakerinalowclassfamily.

    A

    B

    A

    B

    George Boole,(1815-1864)

    OR

    AND

  • TakeawayBinary(twosymbols:trueandfalse)isthebasisofLogicDesign

  • BuildingFunctions:LogicGatesNOT:

    AND:

    OR:

    LogicGates digitalcircuitthateitherallowsasignaltopassthroughitornot. Usedtobuildlogicfunctions Therearesevenbasiclogicgates:

    AND,OR,NOT,NAND (notAND),NOR (notOR),XOR,andXNOR (notXOR)[later]

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A B Out

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A Out

    A

    B

    A

    B

    In

  • BuildingFunctions:LogicGatesNOT:

    AND:

    OR:

    LogicGates digitalcircuitthateitherallowsasignaltopassthroughitornot. Usedtobuildlogicfunctions Therearesevenbasiclogicgates:

    AND,OR,NOT,NAND (notAND),NOR (notOR),XOR,andXNOR (notXOR)[later]

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A B Out

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A Out

    0 1

    1 0

    A

    B

    A

    B

    In

  • NOT:

    AND:

    OR:

    LogicGates digitalcircuitthateitherallowsasignaltopassthroughitornot. Usedtobuildlogicfunctions Therearesevenbasiclogicgates:

    AND,OR,NOT,NAND (notAND),NOR (notOR),XOR,andXNOR (notXOR)[later]

    BuildingFunctions:LogicGates

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A B Out

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A Out

    0 1

    1 0

    A

    B

    A

    B

    In

    A B Out

    0 0 1

    0 1 0

    1 0 0

    1 1 0

    A B Out

    0 0 1

    0 1 1

    1 0 1

    1 1 0

    A

    B

    A

    B

    NAND:

    NOR:

  • Fillinthetruthtable,giventhefollowingLogicCircuitmadefromLogicAND,OR,andNOTgates.Whatdoesthelogiccircuitdo?

    Activity#1.A:LogicGates

    a b Out

    a

    bOut

  • XOR:out =1ifa orb is1,butnotboth;out =0otherwise.

    out =1,onlyifa =1ANDb =0ORa =0ANDb =1

    Activity#1.A:LogicGates

    a b Out

    0 0 0

    0 1 1

    1 0 1

    1 1 0a

    bOut

  • XOR:out =1ifa orb is1,butnotboth;out =0otherwise.

    out =1,onlyifa =1ANDb =0ORa =0ANDb =1

    Activity#1.A:LogicGates

    a b Out

    0 0 0

    0 1 1

    1 0 1

    1 1 0a

    bOut

  • Activity#1:LogicGatesFillinthetruthtable,giventhefollowingLogicCircuitmadefromLogicAND,OR,andNOTgates.Whatdoesthelogiccircuitdo?

    a

    b

    d Out

    a b d Out

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

  • Activity#1:LogicGatesMultiplexor:select(d)betweentwoinputs(a andb)andsetoneastheoutput(out)?

    out =a,ifd =0out =b,ifd =1

    a b d Out

    0 0 0 0

    0 0 1 0

    0 1 0 0

    0 1 1 1

    1 0 0 1

    1 0 1 0

    1 1 0 1

    1 1 1 1

    a

    b

    d Out

  • GoalsforTodayFromSwitchestoLogicGatestoLogicCircuitsLogicGates

    Fromswitches TruthTables

    LogicCircuits IdentityLaws FromTruthTablestoCircuits(SumofProducts)

    LogicCircuitMinimization AlgebraicManipulations TruthTables(Karnaugh Maps)

    Transistors(electronicswitch)

  • NextGoalGivenaLogicfunction,createaLogicCircuitthatimplementstheLogicFunctionand,withtheminimumnumberoflogicgates

    Fewergates:Acheaper($$$)circuit!

  • NOT:

    AND:

    OR:

    XOR:

    Logic Equations

    Constants:true=1,false=0Variables:a,b,out,Operators(above):AND,OR,NOT,etc.

    LogicGates

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A B Out

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A Out

    0 1

    1 0

    A

    B

    A

    B

    In

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 0

    A

    B

  • NOT:

    AND:

    OR:

    XOR:

    Logic Equations

    Constants:true=1,false=0Variables:a,b,out,Operators(above):AND,OR,NOT,etc.

    LogicGates

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A B Out

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A Out

    0 1

    1 0

    A

    B

    A

    B

    In

    A B Out

    0 0 0

    0 1 1

    1 0 1

    1 1 0

    A

    B

    A B Out

    0 0 1

    0 1 0

    1 0 0

    1 1 0

    A B Out

    0 0 1

    0 1 1

    1 0 1

    1 1 0

    A

    B

    A

    B

    NAND:

    NOR:

    A B Out

    0 0 1

    0 1 0

    1 0 0

    1 1 1

    A

    B

    XNOR:

  • LogicEquationsNOT:

    out= =!a=a

    AND: out=ab=a&b=a b

    OR: out=a+b=a|b=a b

    XOR: out=a b=ab +b

    LogicEquations Constants:true=1,false=0 Variables:a,b,out, Operators(above):AND,OR,NOT,etc.

  • LogicEquationsNOT:

    out= =!a=a

    AND: out=ab=a&b=a b

    OR: out=a+b=a|b=a b

    XOR: out=a b=ab +b

    LogicEquations Constants:true=1,false=0 Variables:a,b,out, Operators(above):AND,OR,NOT,etc.

    NAND: out=ab =!(a&b)= (a b)

    NOR: out=a b =!(a|b)= (a b)

    XNOR: out=ab =ab +ab

    .

  • IdentitiesIdentitiesusefulformanipulatinglogicequations

    Foroptimization&easeofimplementation

    a+0=a+1=a+=

    a0=a1=a=

  • IdentitiesIdentitiesusefulformanipulatinglogicequations

    Foroptimization&easeofimplementation

    a+0=a+1=a+=

    a0=a1=a=

    a11

    0a0

    a

    b

    a

    b

  • Identitiesusefulformanipulatinglogicequations Foroptimization&easeofimplementation

    =

    =

    a+ab =

    a(b+c)=

    =

    Identities

  • Identitiesusefulformanipulatinglogicequations Foroptimization&easeofimplementation

    =

    =

    a+ab =

    a(b+c)=

    =

    Identities

    +

    a

    ab +ac

    +

    A

    B

    A

    B

    A

    B

    A

    B

  • Activity#2:Identities

    a+0=a+1=a+=a0=a1=a=

    ==

    a+ab=a(b+c)=

    =

    a110a0

    +aab +ac+

    ShowthattheLogicequationsbelowareequivalent.

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

    (a+b)(a+c) =

  • Activity#2:Identities

    a+0=a+1=a+=a0=a1=a=

    ==

    a+ab=a(b+c)=

    =

    a110a0

    +aab +ac+

    ShowthattheLogicequationsbelowareequivalent.

    (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

  • LogicManipulation functions:gatestruthtablesequations Example:(a+b)(a+c)=a+bc

    a b c

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

  • a b c

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

    a+b a+c LHS

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    1 1 1

    1 1 1

    1 1 1

    1 1 1

    bc RHS

    0 0

    0 0

    0 0

    1 1

    0 1

    0 1

    0 1

    1 1

    LogicManipulation functions:gatestruthtablesequations Example:(a+b)(a+c)=a+bc

  • TakeawayBinary(twosymbols:trueandfalse)isthebasisofLogicDesign

    MorethanoneLogicCircuitcanimplementsameLogicfunction.UseAlgebra(Identities)orTruthTablestoshowequivalence.

  • GoalsforTodayFromSwitchestoLogicGatestoLogicCircuitsLogicGates

    Fromswitches TruthTables

    LogicCircuits IdentityLaws FromTruthTablestoCircuits(SumofProducts)

    LogicCircuitMinimization AlgebraicManipulations TruthTables(Karnaugh Maps)

    Transistors(electronicswitch)

  • NextGoalHowtostandardizeminimizinglogiccircuits?

  • LogicMinimizationHowtoimplementadesiredlogicfunction?

    a b c out0 0 0 00 0 1 10 1 0 00 1 1 11 0 0 01 0 1 11 1 0 01 1 1 0

  • LogicMinimizationHowtoimplementadesiredlogicfunction?

    a b c out0 0 0 00 0 1 10 1 0 00 1 1 11 0 0 01 0 1 11 1 0 01 1 1 0

    1) Write minterms2) sumofproducts: ORofallminte