CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer...
Transcript of CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer...
![Page 1: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/1.jpg)
CS2630ComputerOrganization
IntrotosynchronousdigitalsystemsBrandonMyers
UniversityofIowa
![Page 2: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/2.jpg)
Wherewearegoing
Instructionsetarchitecture(e.g.,MIPS)
Compiler
Memorysystem I/OsystemProcessor
Datapath&Control
Digitallogic
translatingsourcecode(CorJava)ProgramstoassemblylanguageAndlinkingyourcodetoLibrarycode
HowthesoftwaretalksTothehardware
HowaprocessorrunsMIPSPrograms!
Howswitches(1or0)canbeusedtobuildInterestingfunctions:fromintegerarithmetictoprogrammablecomputers
..thenthisisnext!!
awordonextralayersinJava
![Page 3: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/3.jpg)
A“secret”aboutJava…
![Page 4: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/4.jpg)
lw $t0, 4($r0)addi $t0, $t0, 10sw $t0, 8($r0)
MIPSAssembler
100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000
CCompiler(gcc)
helloworld.c
MIPSprocessorexecutesthebinary
helloworld.java
JavaCompiler(javac)
https://en.wikipedia.org/wiki/Java_bytecode
Javabytecode(.classfiles)
JavaVirtualMachine(JVM)interprets thebytecode
TheJVMitselfistheexecutablefile(whichyoudownloadedfromOracle’swebsite)thatrunsontheprocessor
assemblycode(.sor.asm files)
machinecode(.exefiles)
CompilingandrunningCvs.Java(shownforonlyasinglesourcefile,i.e.ignoringthelinkingstep)
![Page 5: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/5.jpg)
AnotherdetailaboutJava• InterpretingJavabytecodeismuchslowerthanexecutingmachinecode• TheJVMisfancy:for“hot”methods(methodsthatrunmanytimes),theJVMcompiles&assemblesthemintomachinecode• TheJVMonlyknowswhatcodeis“hot”oncetheprogramhasbeenrunningforawhile,sotheJVM’scompilerisknownasaJIT(“just-in-time”)compiler
helloworld.java
JavaCompiler(javac)
Javabytecode(.classfiles)
JavaVirtualMachine(JVM)interprets thebytecode
TheJVMitselfistheexecutablefile(whichyoudownloadedfromOracle’swebsite)thatrunsontheprocessor
![Page 6: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/6.jpg)
Administrivia• HW3duetoday• HW4availablesoon• Lab4:CombinationallogicinLogisim thisweek
![Page 7: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/7.jpg)
Wherewearegoing
Instructionsetarchitecture(e.g.,MIPS)
Compiler
Memorysystem I/OsystemProcessor
Datapath&Control
Digitallogic
translatingsourcecode(CorJava)ProgramstoassemblylanguageAndlinkingyourcodetoLibrarycode
HowthesoftwaretalksTothehardware
HowaprocessorrunsMIPSPrograms!
Howswitches(1or0)canbeusedtobuildInterestingfunctions:fromintegerarithmetictoprogrammablecomputers
done
![Page 8: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/8.jpg)
Conceptmapping• Purpose:illustratethecurrentstructureofCS2630conceptsinyourhead,formnewconceptrelationships
• Groupsof3,findaboardspaceanywhere
• Buildaconceptmap(incomputerscientistspeak,itisagraphnotamap)• eachterm(onthesheet)goesinavertex• connectrelatedtermswithanedge;labeltheedgetodescribetherelationship
• After~10minutes,wewillstopsoyoucantourothergroups’conceptmaps
![Page 9: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/9.jpg)
“Synchronousdigitalsystems”• We’llbedesigningcircuitsusingtwoveryconvenientabstractions ofelectricalcircuits• digital:voltageisquantizedintotwovalues:0and1,allowingustocombinecomponentswithoutincreasingcomplexity• synchronous:timeisdiscrete,thatis,timeadvancesindistinctstepsandthevaluesonallthewireschangesatthesesteps
![Page 10: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/10.jpg)
Digitalabstraction• Composecircuitswithoutthemaffectingeachother• Why?outputsare“perfect”highandlowvoltages
NANDNAND
01
11
1
![Page 11: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/11.jpg)
Synchronousabstraction• timeisdiscrete• timeadvancesindistinctstepsandthevaluesonallthewireschangesatthesesteps
![Page 12: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/12.jpg)
“Synchronousdigitalsystems”• We’llbedesigningcircuitsusingtwoveryconvenientabstractions ofelectricalcircuits• digital:voltageisquantizedintotwovalues:0and1,allowingustocombinecomponentswithoutincreasingcomplexity• synchronous:timeisdiscrete,thatis,timeadvancesindistinctstepsandthevaluesonallthewireschangesatthesesteps
• Twopartstosynchronousdigitalsystems1. combinationallogic(ignoretimeandjustthinkaboutinputs
andoutputs)• e.g.,bitwiseoperationsandarithmeticonbinarynumbers
2. synchronouslogic(we’llincorporatestate,whichwillchangeastimeadvances)• e.g.,memoryandregisters
![Page 13: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/13.jpg)
Combinationallogicrepresentaninputusingaboolean variable
• boolean:domainis{false,true},orthinkofitas{0,1}threebasicoperations:AND,OR,NOT
notation:𝐴 " 𝐵means“trueiff Aistrueand Bistrue”𝐴 + 𝐵 means“trueiff Aistrueor Bistrue”�̅�means“trueifAisnot true”
Combineoperationstogethertobuildmorecomplexexpressions
forexample,readthisexpression:(𝐴 " 𝐵) + (𝐴 " 𝐶)
![Page 14: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/14.jpg)
Truthtables
A B C0 0 00 1 01 0 01 1 1
A B C0 0 0
0 1 11 0 11 1 1
A C0 11 0
A B C D0 0 0 10 0 1 10 1 0 10 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1
𝐶 = 𝐴 " 𝐵
𝐶 = 𝐴 + 𝐵
𝐶 = �̅� 𝐷 = (𝐴 " 𝐵) + (𝐴 " 𝐶)
definesalogicalfunctionbyenumeratingallinputsandthecorrespondingoutput
![Page 15: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/15.jpg)
Anexample:buildacircuitandrunit• Rulesdefinealogiccircuitsymbolically• “If(IgogroceryshoppingandIcook)orIordertake-outthenIeatdinner”
• Declareavariableforeachboolean input• Gistrueiff “Igogroceryshopping”• Cistrueiff “Icook”• Tistrueiff “Iordertake-out”• Eistrueiff “Ieatdinner”
• WritewhetherIeatdinnerintermsoflogicequation• 𝐸 = 𝐺 " 𝐶 + 𝑇
• Now,ifIsettheinputs,Icanevaluatetherightsidetogetananswer• SupposeIwentgroceryshopping,Ididnotcook,andIorderedtake-out• 𝐸 = 𝑡𝑟𝑢𝑒 " 𝑓𝑎𝑙𝑠𝑒 + 𝑡𝑟𝑢𝑒 = false + true = true
![Page 16: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/16.jpg)
Peerinstruction• Whichlogicequationdescribesthistruthtable?
a) 𝐶 = 𝐴 " 𝐵b) 𝐶 = �̅� " 𝐵@c) 𝐶 = 𝐴 + 𝐵d) 𝐶 = 𝐴 " 𝐵
A B C
0 0 1
0 1 1
1 0 1
1 1 0
![Page 17: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/17.jpg)
Thebasiccomponent:aswitch
Currentflowsfromthebatterywhenthereisacompletecircuit
Whentheswitchisclosed(connectsthecircuit),thecurrentflowstothelight
Whentheswitchisopen(disconnectsthecircuit),thecurrentdoesnotflowtothelight
0 10
0 10
AB
![Page 18: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/18.jpg)
Buildinglogicfromswitches
Twoswitchesconnectedinparallel.Atleastonemustbeclosedforthebulbtoturnon
Twoswitchesconnectedinseries.Bothmustbeclosedforthebulbtoturnon
![Page 19: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/19.jpg)
LogicgatesA
B
AB C
C
AB
C
A B
C
Thestateoftheswitchistheinputtothecircuit
![Page 20: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/20.jpg)
PeerinstructionWhatisthetruthtableforthiscircuit?
a
b
c
d
a b c d
![Page 21: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/21.jpg)
Controllingtheswitches• Tocomposetwogates,weneedtobeabletochangethestateoftheswitchesofthesecondgatewiththeoutputofthefirstgate
A
B
C
DE
A
B
C
C DE
(output)
(input)
![Page 22: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/22.jpg)
![Page 23: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/23.jpg)
CS2630ComputerOrganization
Transistors,combinationallogicBrandonMyers
UniversityofIowa
![Page 24: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/24.jpg)
Controllingtheswitches• Tocomposetwogates,weneedtobeabletochangethestateoftheswitchesofthesecondgatewiththeoutputofthefirstgate
A
B
C
DE
A
B
C
C DE
(output)
(input)
![Page 25: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/25.jpg)
Transistors(MOSFET)
pMOS
nMOS
gate
gate
drain
drain
source
source
gate=0Volts gate=1Volt
s
d
s
d
s
d
s
d
off
off on
on
![Page 26: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/26.jpg)
HowdoesnMOS transistorwork?
Madeofasubstrateofp-typematerial(positivebiased).Drainandsourcearen-typematerial(negativebiased).a) gateisgiven0volts:diodesbetweensource/substrateanddrain/substrateare
reversebiasedsonocurrentflows(transistorisOFF)b) gateisgiven1volt:causesanegativechargeinthesubstratenearthegate;thisarea
ofnegativechargeiscalledthechannel.Nowcurrentflowsfromsourcetodrain(transistorisON)
![Page 27: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/27.jpg)
Controllingtheswitches• Youcoulddoitthisway,BUTitturnsoutthatnMOS arebadatpassinghighvoltageandpMOS arebadatpassinglowvoltage
A
B
C
DE
A
B C
C DE
C D
![Page 28: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/28.jpg)
CMOStotherescue• complimentaryMOS
1. everylogicgateismadefrompMOS transistorsconnectedto1(VDD)andoutput,aswellasnMOS transistorsconnectedto0(ground)andoutput
2. pMOS sideisintendedtoproduce1byconnectingoutputtoVDDandnMOS sideisintendedtoproduce0byconnectingoutputtoground.
3. whenpMOS sideisoff,nMOS sideshouldbeon;whenpMOSsideison,nMOS sideshouldbeoff
• CMOSlet’susbuildlargecomplexcircuitsoutofgatesbecausetheoutputisa“perfect”1or0eveniftheinputatthegatesis”imperfect”(i.e.avoltageinbetween)
![Page 29: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/29.jpg)
Peerinstruction
inputA inputB output
fillinthetruthtable
Onclicker,enteradescriptionofwhatitdoes.
![Page 30: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/30.jpg)
Exampleofcomposingmanygates
CMOSlet’susbuildlargecomplexcircuitsoutofgatesbecausetheoutputisa“perfect”1or0eveniftheinputatthegatesis”imperfect”(i.e.avoltageinbetween)
![Page 31: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/31.jpg)
Nowthatweknowhowtoarrangetransistorsinawaythatwecansafelycomposelogicgatestogether,let’sbuildbiggercircuits!
![Page 32: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/32.jpg)
Ingredientsforaprocessor• Combinationallogic• arithmeticandbitwiseoperations• multiplexors(pick1outofofNinputs)• controllogic• branchcalculation• addresscalculation
• Synchronouslogic(we’llgettotheselater)• registers• programcounter,orPC• datamemory• instructionmemory
startlearninghowtobuildthesecombinationallogiccircuits
![Page 33: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/33.jpg)
• Selectbit=0meanspassfirstinputtooutput
• Selectbit=1meanspasssecondinputtooutput
Multiplexor(MUX)picksbetweentwoinputs
select
inputdata output
data
shownareMUXswithadatawidthof3bits
YoucanbuildaMUXwithanydatawidth
![Page 34: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/34.jpg)
HowdowebuildaMUXfromlogicgates?(with1-bitdatawidth)
In0 In1 Select Out0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1
𝐼𝑛0 " 𝐼𝑛1 ⋅ 𝑆𝑒𝑙𝑒𝑐𝑡 + 𝐼𝑛0 "
![Page 35: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/35.jpg)
Truthtabletogates1. Foreach1intheoutput,writeaproductclause(AND).
Connectthemwithsums(OR).
2.Simplifytheexpressionusingalgebraiclaws
𝑠𝑒𝑙𝑒𝑐𝑡 ⋅ 𝐼𝑛0 ⋅ 𝐼𝑛1 + 𝐼𝑛0 ⋅ 𝐼𝑛1 + 𝑠𝑒𝑙𝑒𝑐𝑡 ⋅ (𝐼𝑛0 ⋅ 𝐼𝑛1 + 𝐼𝑛0 ⋅ 𝐼𝑛1)
𝑠𝑒𝑙𝑒𝑐𝑡 ⋅ 𝐼𝑛1 + 𝑠𝑒𝑙𝑒𝑐𝑡 ⋅ 𝐼𝑛0
𝐼𝑛0 " 𝐼𝑛1 ⋅ 𝑆𝑒𝑙𝑒𝑐𝑡 +𝐼𝑛0 " 𝐼𝑛1 ⋅ 𝑆𝑒𝑙𝑒𝑐𝑡 +𝐼𝑛0 ⋅ 𝐼𝑛1 ⋅ 𝑆𝑒𝑙𝑒𝑐𝑡 +𝐼𝑛0 ⋅ 𝐼𝑛1 ⋅ 𝑆𝑒𝑙𝑒𝑐𝑡
In0 In1 Select 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
![Page 36: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/36.jpg)
Reminder:threebasicgates
![Page 37: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/37.jpg)
Truthtabletogates(cont.)
2.𝑠𝑒𝑙𝑒𝑐𝑡 ⋅ 𝐼𝑛1 + 𝑠𝑒𝑙𝑒𝑐𝑡 ⋅ 𝐼𝑛0 (frompreviousslide)3.DrawanANDgateforeachconjunction,usingNOTfor
bars
4. DrawanORgatetocombinetheresultsoftheANDs
![Page 38: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/38.jpg)
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;workin3’s
![Page 39: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/39.jpg)
Howdoweaddtwonumbersaddu $t0,$t1,$t2
Weknow:Thenumbersarephysicallystoredinregistersasbits
Thesumoftwonumbersisafunctionwecanimplementusingcombinationallogic
![Page 40: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/40.jpg)
Startwitha1-bitadder
+SumCarry
AB
Carryin
![Page 41: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_su17/public/...CS 2630 Computer Organization Intro to synchronous digital systems Brandon Myers University of Iowa.](https://reader035.fdocuments.us/reader035/viewer/2022063000/5f1201f8a6475478d0773725/html5/thumbnails/41.jpg)
2-bitadder
+
Sum0
A0B0
Carryin+
A1B1
Sum1
Carry0 Carry1