Gates and Logic!Hakim&Weatherspoon&CS&3410,&Spring&2011&Computer)Science)Cornell)Universty)See:)P&H)Appendix)C.0,)C.1,)C.2)Gates and Logic!See:)P&H)Appendix)C.0,)C.1,)C.2)h@p://www.xkcd.com/74/)3)Announcements!Class)newsgroup)created)• Posted)on)webJpage)• Use)it)for)partner)finding)First)assignment)is)to)find)partners)SecNons)start)next)week)• Use)this)weeks)secNon)to)find)a)partner)Note)about)class)• No)Verilog)or)VHDL)• Clickers)not)required,)but)will)use)them)from)NmeJtoJNme)4)A switch!• Acts)as)a)conductor)or)insulator)• Can)be)used)to)build)amazing)things…)5)Better Switch!• One)current)controls)another)(larger))current)• StaNc)Power:)– Keeps)consuming)power)when)in)the)ON)state)• Dynamic)Power:)– Jump)in)power)consumpNo n )when)switching)6)e&N&P&N&P&N&P&N&P&N&P&N&P&N&P&e&e&e&e&e&e&e&e&e&e&e&e&e&hole)Atoms!7)B&e&e&e&e&Si&e&e&e&Silicon) Phosphorus)Boron)e&P&e&e&e&e&Elements!8)e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&e&Si&e&e&e&Silicon)Silicon Crystal!9)e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&NJType:)Silicon)+)Phosphorus)e&P&e&e&e&e&e&P&e&e&e&e&e&P&e&e&e&e&e&P&e&e&e&e&Phosphorus Doping!10)B&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&PJType:)Silicon)+)Boron)B&e&e&e&B&e&e&e&B&e&e&e&Boron Doping!11)Semiconductors!Insulator)nJtype)(Si+Phosphorus))has)mobile)electrons:)pJtype)(Si+Boron))has)mobile)holes:)low)voltage)(mobile)electrons))))))))))→)conductor)high)voltage)(depleted))))))))))→)insulator)low)voltage)(depleted))))))))))→)insulator)high)voltage)(mobile)holes))))))))))→)conductor)12)PJType) NJType)e&e&e&e&e&e&e&e&e&e&e&e&e&e&Bipolar Junction!low)v)→)conductor)high)v)→)insulator)low)v)→)insulator)high)v)→)conductor)13)PJType) NJType)e&e&e&e&e&e&e&e&e&e&e&e&e&+ – Reverse Bias!low)v)→)conductor)high)v)→)insulator)low)v)→)insulator)high)v)→)conductor)e&14)PJType) NJType)e&e&e&e&e&e&e&e&e&e&e&e&e&e& e&e&e&e&e&e&e&e&e&e&e&e&e&e&– + Forward Bias!low)v)→)conductor)high)v)→)insulator)low)v)→)insulator)high)v)→)conductor)15)Diodes)))pJtype)))nJtype)PN)JuncNon)“Dio de”)ConvenNons:)vdd)=)vcc)=)+1.2v)=)+5v)=)hi)vss)=)vee)=)0v)=)gnd)16)PNP)JuncNon)))pJtype)))pJtype)))nJtype)17)Bipolar)JuncNon)Transistors)• SolidJstate)switch:)The)most)amazing)invenNon)of)the)1900s)Emi@er)=)“input”,)Base)=)“switch”,)Collector)=)“output”)p) n) p)C)E=vdd)B)E)C)B)vdd)p)n)vss=E)C)B)C)E)B)vss)n)PNP)Transistor) NPN)Transistor)18)Field)Effect)Transistors)P<type&FET&• Connect)Source)to)Drain)when)Gate)=)lo)• Drain)must)be)vdd,)or)connected)to)source)of)another)PJtype)transistor)N<type&FET&• Connect)Source)to)Drain)when)Gate)=)hi)• Source)must)be)vss,)or)connected)to)drain)of)another)NJtype)transistor)Drain)=)vdd)Source)Gate)Drain)Source)=)vss)Gate)19)MulNple)Transistors)In) Out)voltage)Gate)delay)• transistor)switching)Nme)• voltage,)propagaNon,)fanout,)temperature,)…)CMOS)design)(complementaryJsymmetry)metal–oxide–semiconductor)) Power)consumpNon)=))dynamic)+)leakage)in) out)Vdd)Vss)t)0v)+5v)20)Digital)Logic)In) Out)+5v)0v)0v)+5v)voltage)in) out)Vdd)Vss)t)0v)+5v)+2v)+0.5v)In) Out)truth)table)ConvenNons:)vdd)=)vcc)=)+1.2v)=)+5v)=)hi)=)true)=)1)vss)=)vee)=)0v)=)gnd)=)false)=)0)21)NOT)Gate)(Inverter))In) Out)0&1&1&0&in) out)Truth)table)FuncNon:)NOT) Symbol:)in) out)Vdd)Vss)22)NAND Gate!A) B) out)0) 0)1)0) 1)1)1) 0)1)1) 1)0)b)a)out)A)out)Vdd)Vss)B)B)A)Vdd)FuncNon:)NAND) Symbol:)23)NOR Gate!b)a)out)A)out)Vss)Vdd)B)B)A)Vss)FuncNon:)NOR) Symbol:)A) B) out)0) 0)1)0) 1)0)1) 0)0)1) 1)0)24)Building Functions!• AND:))))• OR:))))• NOT:)25)Universal Gates!NAND)is)universal)(so)is)NOR))• Can)implement)any)funcNon)with)just)NAND)gates)– De)Morgan’s)laws)are)helpful)(pushing)bubbles))• useful)for)manufacturing)E.g.:)XOR)(A,)B))=)A)or)B)but)not)both)(“exclusive)or”)))Proof:)?)26)Logic Equations!Some)notaNon:)• constants:)true)=)1,)false)=)0)• variables:)a,)b,)out,)…)• operators:)• AND(a,)b))))=)a)b) )=))a)&)b) )=))a)∧ b)• OR(a,)b)) )=)a)+)b))=)a)|)b) )=)a)∨ b)• NOT(a)) )=)ā) )=)!a) )=)¬a))27)Identities!IdenNNes)useful)for)manipulaNng)logic)equaNons)– For)opNmizaNon)&)ease)of)implementaNon))a)+)0)=))a)+)1)=))a)+)ā)=))a)0)=))a)1)=))a)ā)=))(a)+)b))=))(a)b))=))a)+)a)b)=))a(b+c))=))a(b+c))=)))a))1))1))0))a))0))a)b))a)+)b))a))ab)+)ac))a)+)bc)28)Logic Manipulation!• funcNons:)gates)↔)truth)tables)↔)equaNons)• 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&29)Logic Manipulation!• funcNons:)gates)↔)truth)tables)↔)equaNons)• 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& 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&30)Logic Minimization!• A common problem is how to implement a desired function most efficiently!• One can derive the equation from the truth table!• How does one find the most efficient equation?!– Manipulate algebraically until satisfied!– Use Karnaugh maps (or K maps)!a! b! c! minterm!0! 0! 0! abc!0! 0! 1! abc!0! 1! 0! abc!0! 1! 1! abc!1! 0! 0! abc!1! 0! 1! abc!1! 1! 0! abc!1! 1! 1! abc!for all outputs that are 1, take the corresponding minterm Obtain the result in “sum of products” formMultiplexer!• A multiplexer selects between multiple inputs!– out = a, if d = 0!– out = b, if d = 1!• Build truth table!• Minimize diagram!• Derive logic diagram!a b d 0Multiplexer Implementation!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!
View Full Document