+ All Categories
Home > Documents > Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... ·...

Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... ·...

Date post: 27-Apr-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
39
Many ways to build logic out of MOSFETs pass transistor logic (most similar to the first switch logic we saw) static CMOS logic (what we saw last time) dynamic CMOS logic Clock=0 precharges X through the pMOS clock=1 gives the two nMOS time to drain charge on X to ground (if A and B turn them on) Wikimedia commons
Transcript
Page 1: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

ManywaystobuildlogicoutofMOSFETs

passtransistorlogic(mostsimilartothefirstswitchlogicwesaw)

staticCMOSlogic(whatwesawlasttime)

dynamicCMOSlogic• Clock=0precharges X

throughthepMOS• clock=1givesthetwo

nMOS timetodrainchargeonXtoground(ifAandBturnthemon)

Wikimediacommons

Page 2: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Switchesotherthantransistors

relays(electro-mechanical)

diodes

ORgate

Wikimediacommons

Page 3: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

CS2630ComputerOrganization

CombinationallogicforarithmeticBrandonMyers

UniversityofIowa

Page 4: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Peerinstruction• Drawthecircuitforthefollowingtruthtable(thisonehas2inputs,2outputs)

In0 In1 Out0 Out1

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

Answerthenumberoflogicgatesusedwhenfinished;workinpairs

Page 5: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Wherewearegoing

Instructionsetarchitecture(e.g.,MIPS)

Compiler

Memorysystem I/OsystemProcessor

Datapath&Control

Digitallogic

translatingsourcecode(CorJava)ProgramstoassemblylanguageAndlinkingyourcodetoLibrarycode

HowthesoftwaretalksTothehardware

HowaprocessorrunsMIPSPrograms!

Howswitches(1or0)canbeusedtobuildInterestingfunctions:fromintegerarithmetictoprogrammablecomputers

Page 6: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Ingredientsforaprocessor• Combinationallogic• arithmeticandbitwiseoperations• multiplexors(pick1outofofNinputs)• controllogic• branchcalculation• addresscalculation

• Synchronouslogic(we’llgettotheselater)• registers• programcounter,orPC• datamemory• instructionmemory

startlearninghowtobuildthesecombinationallogiccircuits

Page 7: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Howdoweaddtwonumbersaddu $t0,$t1,$t2

Weknow:Thenumbersarephysicallystoredinregistersasbits

Thesumoftwonumbersisafunctionwecanimplementusingcombinationallogic

Page 8: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Startwitha1-bitadder

+

Sum

Carryout

A BCarryin

Page 9: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Peerinstruction:2-bitadder

+2-bit

Sum0

Carryout

A0B0Carryin

Sum1

A1B1

NumberofrowsoftruthtableforSum1outputof2-bitadder?

Page 10: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Howmanyrowsinthistruthtable?

4GBmemoryx8bit/byte=32Gbits

32registersx4Bytex8bit/byte=1Kbit

PCregisterx4Bytex8bit/byte=32bits

processortakesonestepfromcurrentstatetonewstate.Howmanyrowsinthetruthtableofbit0?

https://commons.wikimedia.org/wiki/File:Performance_PIPER_die.JPG

currentstate(theinput)

newstate(theoutput)

Page 11: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Administrivia• 2MidtermpracticesareonICON• takethemlikearealexamandthen checkyouranswerswiththesolutions

• DebugYourBrainnextWednesdaywillbededicatedtoreview• extraofficehour4-5pmonMonday2/27,tobededicatedtoHW3

• Reminder:Midterm3/6• opennotesopenbook,nodevices

Page 12: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about
Page 13: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

https://en.wikipedia.org/wiki/Field-programmable_gate_array

Lookuptable(LUT)– aprogrammabletruthtableinhardware!

“3-LUT”means3inputs(somustprogram8rows)

Field-programmablegatearray(FPGA)

1-bitadder

programmableMUXselectsinputs

analternativetomanufacturingyourownsiliconchip

Page 14: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

CS2630ComputerOrganization

AddersandtimingBrandonMyers

UniversityofIowa

Page 15: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Howhumansaddtwonumbers• compute65210 +36710 onpaper

• compute110102 +010112 onpaper

Page 16: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Buildinglargercircuitsoutofcomponents:2-bitadderbuiltfrom1-bitadders

+

Sum0

C1

A0 B00

+

Sum1

C2

A1 B1individualcomponentshavetheirownsmalltruthtables;thenwejustcombinethecomponents

Page 17: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

32-bitadder

+

Sum0

A0 B00

+

Sum1

A1 B1

+

Sum2

A2 B2

+

Sum31

A31 B31

Reflect:WenowhaveacircuitforA+B.WhatisasmallchangewecanmaketogetA-B?

Page 18: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Undertherugofcombinationallogic:computationtime

Page 19: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

PropagationdelaythroughlogicgatesResistor-capacitor(RC)modelofNOTgatewhengiveninput0

1à0 0à1

inputchanges

R

C

1à0 0à1

Page 20: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

ChargingacapacitorinanRCcircuit

https://www.quora.com/How-does-a-RC-circuit-work-especially-the-charges-on-the-capacitor

Page 21: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

PropagationdelaythroughlogicgatesResistor-capacitor(RC)modelofNOTgatewhengiveninput0

1à0 0à1

inputchanges

R

C

Whentheinputchangesfrom1to0,thereisadelaybeforetheoutputoftheNOTgatereaches1

drainingthecapacitorwheninputgoes0à1

0à1

1à0 0à1

Page 22: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Backuptotheleveloflogicgates• InCS2630,whenwethinkaboutdelay,we’llusethefollowingsimplifiedmodel• propagationdelayishigherformorecomplexgates• propagationdelayincreaseswiththenumberofinputstoagate

• e.g.,2-inputORgateisfasterthana3-inputORgate• propagationdelayofasequenceofgatesisadditive• allinputsmustbeavailablebeforelogicgatebeginscomputing

T=0 T=0.5 T=1 T=1.5

Example:assumedelayofinverteris0.5ns

Page 23: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Delayofaddercircuit

+

Sum0

A0 B00

+

Sum1

A1 B1

+

Sum2

A2 B2

+

Sum31

A31 B31

1-bitadderdelay:sum=21-bitadderdelay:carry=1

Peerinstruction:delaytogetSum31?

Page 24: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Delayofaddercircuit

+

Sum0

A0 B00

+

Sum1

A1 B1

+

Sum2

A2 B2

+

Sum31

A31 B31

1-bitadderdelay:sum=21-bitadderdelay:carry=1

Thisadderiscalled“ripplecarryadder”

Page 25: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Next…• Wenowknowhowonekindofadderworksandhowlongittakestocomputetheresult• Canwebuildfasteradders?Yes!Usehierarchy/trees

Page 26: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Administrivia• Reminders:• extraofficehour4-5pmtodayforHW3• DYBthisweekdedicatedtoreview• MidtermonMonday3/6:opennoteopenbook,nodevices

Page 27: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Carry-selectadder

Page 28: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Peerinstruction

WhatisthedelayfromthetimeAandBareavailabletowhenSumisavailable?

delays:sum:1carry:1mux:1

Page 29: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Administrivia• Reminders:• DYBtonight6-7pmdedicatedtoreview

• bringyourprioritizedlistofspecificproblemsorquestionsthatyou’dliketoreview

• itwillbemostusefulifyoutakethepracticeexam(s)first• MidtermonMonday3/6:opennoteopenbook,nodevices

Page 30: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Peerinstruction

WhatisthedelayfromthetimeAandBareavailabletowhenSumisavailable?

delays:sum:1carry:1mux:1

1

1

22

3

3

1

1

11

2

4

4

timesignalisavailableshowninred/bold

Page 31: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

http://www-inst.eecs.berkeley.edu/~cs150/sp13/agenda/lec/lec20-adders.pdf

computecarries

usecarriestofinishthesums

Bestcasedelayofadders?O(logn)pmeans“propagateacarry”gmeans“generateacarry”

important:pandgarenotfunctionsofc

Page 32: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Bestcasedelayofadders?O(logn)

http://www-inst.eecs.berkeley.edu/~cs150/sp13/agenda/lec/lec20-adders.pdf

computecarries

usecarrys tofinishthesums

criticalpath

Page 33: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Multiplication• Evaluate50110 x42210 onpaper

• Evaluate11002 x10012 onpaper

Page 34: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Aside:usefullogiccircuitnotation

Page 35: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Shiftingbyaconstant

Page 36: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Variableshifter:firstattemptwith1-bitmuxes

Page 37: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Variableshifter,similardesignwith8-bitmux

Canyouthinkofadesignthatavoidsusingahuge8-bitx8-choicemux?

e.g.,usingonly8-bitx2-choicemuxes andhardwiredshifters?

hardwiredshiftsbyeachpossibleshiftamount

pickwhichoneusingtheshiftamount

Page 38: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Multi-stageshifterusingthemagicofbinarydecision-making• Hint:RecalltheenvelopesfromHW1

anothersolution(butusesmore2-inputMUXs)istobuildthe8-inputMUXonthepreviousslideusing2-inputMUXs,likeasoccertournamentwith8teamsandonechampion

Page 39: Many ways to build logic out of MOSFETshomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 2017. 3. 1. · Back up to the level of logic gates •In CS2630, when we think about

Peerinstruction• Builda2-bitmultiplier(4-bitoutput)• youmayuseanynumberof

• exampletestcases:• 01*01=0001• 10*01=0010• 10*11=0110• 11*11=1001


Recommended