ENGG32AHomeworkAssignments(fromthe5theditionofthetextbook)
HW1--Ch1:7,10,11,15,16,and25.
Ch3:52,54,and55.
HW2--Ch2:1,2,6,7,8,and9.
Ch3:16and17.
UseCircuitVerse,adigitalsimulator,tocreatethetestcircuitsandtruthtablesof3-inputOR,AND,NAND,NOR,XOR,andXNORgates.(Note:Needtosubmitall8inputpatternsforeachgateinyourreport.Thismeansthattherewillbeatotalof48simulationcircuitsforthese8gates.Yourreportwillalsoincludeonetruthtablesummarizingtheoutputsofthe8circuitsofeverygate.)
Afterward,createthetestcircuitsandtruthtablesinordertoprovetheDeMorganâstheoremofđđđ$$$$$$ = đ$ + đ$ + ďż˝Ě ďż˝andđ´ + đľ + đś + đˇ$$$$$$$$$$$$$$$$$$$ = ďż˝Ě ďż˝ â đľ$ â ďż˝Ě ďż˝ â đˇ-inp.7ofLectureNote#2.(Note:AllIneedarejustonesimulationcircuitforleftsideandonesimulationcircuitfortherightsideofeachoneofthetwoexpressions.Then,yourreportshowsthatthetruthtablesoftheleft-sidecircuitandright-sidecircuitoftheexpressionareidenticalinordertoprovethetheorem.)
HW3--Ch2:10,15,17,18,20,22,and26.
UseCircuitVersetocreatethetestcircuitsandtruthtablesinordertoprovetheConsensusTheoremofđđ + đ$đ + đđ = đđ + đ$đand(đ + đ)(đ$ + đ)(đ + đ) =(đ + đ)(đ$ + đ)inp.9ofLectureNote#2.(Note:AllIneedarejustonesimulationcircuitforleftsideandonesimulationcircuitfortherightsideofeachoneofthetwoexpressions.Then,yourreportshowsthatthetruthtablesoftheleft-sidecircuitandtheright-sidecircuitoftheexpressionareidenticalinordertoprovethetheorem.)
Afterward, create the test circuits and truth tables to prove that the 4-NAND-gate circuit in p. 14 of Lecture Note #2 is identical to a 2-input XOR gate. (Note: Need to submit 4 simulation circuits with the four input patterns to the 4-NAND-gate circuit. Then, your report shows that the truth table is identical to that of the XOR gate.)
Simulatethe8-biteven-paritygeneratorandcheckerinp.16ofLectureNote#2.(Note:Givefourexamplesoftheinputpatternstothesimulationcircuitstoshowthatthegeneratorandcheckerareworkingasexpected.Notruthtableisneeded.)
HW4--Ch3:1,2,8,10,29,44,46,47,and48.
UseCircuitVersetocreatetheBCDdecoderand7-segmentdisplaycircuitusingtheequationinp.10ofLectureNote3.[First,selectâNewCircuit+âundertheCircuitmenu.Then,buildtheBCDdecoderwith4âinputindicatorsâasinputsand8âoutputindicatorsâasoutputs.Afterward,addtheBCDcircuitasasub-circuitbyselectingâMain,ââInsertSubCircuitâundertheCircuitmenu,andfinallyselecttheâBCDdecoderâcircuit.Add4âinputindicatorsâastheinputsanda7-segmentdisplayastheoutputsofthesubcircuit.Showfoursimulationcircuitswith4differentBCDinputpatternsinyourreport.]
UseCircuitVersetocreatethe4-bitAdder-Subtractorinp.27ofLectureNote3.(UsetheSubCircuitfeaturetobuildoneFullAdderfirst.Then,connectfourFullAdderinachaintocreatea4-bitAddersubcircuit.Finally,createthe4-bitAdder-Subtractorbyusingthis4-bitAddersubcircuit.Showthesimulationcircuitswithoneexampleofadditionandoneexampleofsubtractioninyourreport.)
HW5âCh4:4,6,7,9,10,11,26,and33.
UseCircuitVersetocreatethepositive-edge-triggeredDflip-flopinp.7ofLectureNote4asasubcircuit.ConnecttheâinputindicatorsâtotheDandclockinputsandtheâoutputindicatorâtotheQoutput.TestthecircuittomakesurethatthecontentofD-inputisstoredandshowsupattheQ-outputwheneverthereisarisingedgeintheclockinput.
Afterward,usethesubcircuitsofyourâpositive-edge-triggeredDflip-flopâandâBCD-to-7-segmentconverterâ(fromHW4)tocreatetheSequenceGeneratorinpp.25-27ofLectureNote4.SelecttheâClockâintheâSequentialElementsâmenuofCircuitVerseandconnectittotheclockinputsofthethreeDflip-flops.SettheClockTimeofthecircuitto1,000ms.Youshouldseethedigits0,1,4,2,and6cyclingthroughthe7-segmentdisplay,onedigitpersecond.
(Important:TheABCDinputsofyourâBCD-to-7-segmentconverterâisoppositetotheABCDinputsoftheâBCDdecoderâinp.27.Youwillneedtoreversetheconnectionsinthegeneratorcircuit.)
Includethescreenshotsofthesimulationcircuitsoftheâpositive-edge-triggeredDflip-flopâandtheSequencewiththedigits4and2onthe7-segmentdisplayGeneratorinyourreport.
HW6âCh6:5,11,12,15,16,andrepeat#16withTandalsoJKflip-flops.
Followthestepsinpp.20&21ofLectureNote5toimplementa2-digitaldecadecounterusingDflip-flops(notTflip-flops).YouwillneedtocreatefournewcolumnsinthestatetablefortheinputequationsoftheDflip-flops(toreplacethoseoftheTflip-flops).Afterward,applyK-maps(usingdonâtcaresintheunusedstates)toobtainthesimplestexpressionsofthefourinputequations.
UseCircuitVersetoimplementthefourinputequationsoftheDflip-flopsandtheexternaloutputequationYwithlogicgatesandfourDflip-flops,similartowhatyouhavedoneinHW5.
Totestyourcircuit,settheClockto1Hz(i.e.,1cyclepersecond=periodof1second).Then,the2-digitaldecadecountercancount100secondsfrom0to99repeatedly.Ifyousettheclockto100Hz(i.e.,100cyclepersecond=periodof10ms),itcancountevery1/100ofasecondandupto1second,potentiallyusefulasastopwatch.
Inyourreport,includethecompletedstatetable(withdonâtcaresintheunusedstates),fourinputequations,thesimulationcircuit,andthescreenshot(useâshiftââprintscreenâtocapture)withthenumber89displayed.
HW7âCh5:4,7,8,10,11,and13.
Ch7:1,8,and9.
Asadesignproject,asimple4-bitcentralprocessingunit(CPU)willbebuiltandsimulatedafterHW8.Beforethat,youneedtobuildthenecessarycomponentsasâsubcircuitsâinthisandnextassignment.Theyarethe2x4decoder(p.11ofLectureNote3),2x1MUX(p.20;donâtneedtheEnableinput),4x1MUX(p.19),4-bitparallelloadregister(p.3ofLectureNote5;usingfourofyourDflip-flopsubcircuit),and4-bitparalleladder(usingtheoneyoubuiltinHW4).
Buildthemassubcircuitsandtestthemcompletelytomakesurethattheyworkasexpected.Includeallthesesimulationcircuitsinyourreport.Includetwoscreenshotsofeachdeviceinthesubcircuitformwithtwodifferentinputcombinationstoshowthattheyworkproperly.
Foryourreference,belowaretheCircuitVersescreenshotsofthesimulationcircuits.
2x1Mux
4x1MUX 2x4Decoder
4-bitParallelLoadRegister
HW8--Ch6:19,20,22,24(usea4x1MUX),and31.
Ch8:4,5,9,10,and11.
Continuetobuildthenecessarycomponentsasâsubcircuitsâforyour4-bitCPUproject.Theyarethe4-bit2x1MUX,4-bit4x1MUX,1-bitlogiccircuit(p.18ofLectureNote7),and4-bitarithmeticcircuit(p.20ofLectureNote7;usingyour4-bitaddersubcircuit).
The4-bit2x1MUXsubcircuitisbuiltbyconnectingtheselectioninputSoffourofyour2x1MUXsubcircuittogetherasonecommonselectioninputSsothatthefinalsubcircuitissimilartop.21inLectureNote3buthereusingfourofyour2x1MUXsubcircuits.Makesuretolabeltheselectioninput,8datainputs,and4dataoutputsinyoursubcircuitproperly.Similarly,the4-bit4x1MUXisbuiltbyconnectingthetwoselectioninputsS1S0offourofyour4x1MUXsubcircuittogetherastwocommonselectioninputsS1S0.Makesuretolabelthetwoselectioninputs,16datainputs,and16dataoutputsinyoursubcircuitproperly.
Buildthemassubcircuitsandtestthemcompletelytomakesurethattheyworkasexpected.Includeallthesesimulationcircuitsinyourreport.Includetwoscreenshotsofeachdeviceinthesubcircuitformwithtwodifferentinputcombinations.
Foryourreference,belowaretheCircuitVersescreenshotsofthesimulationcircuits.
1-BitLogicCircuit
4-Bit4x1MUX 4-Bit2x1MUX
4-BitArithmeticCircuit
FinalProject:Asimple4-bitcentralprocessingunitwillbebuiltandsimulated.Thiswillaccountforthe8%ofyourgrade.
Continuetobuildthenecessarycomponentsasâsubcircuitsâforyour4-bitCPUproject.Theyarethe4-bitlogiccircuit(usingfourofyourâ1-stagelogiccircuitâsubcircuit)and4-bitALU(pp.17ofLectureNote7;usingyourâ4-bitarithmeticcircuitâsubcircuit,andone4-bit2x1MUXsubcircuit).Theinternalconfigurationofthis4-bitALUisshowninp.18,whichonlyshowstheconnectionofonestage(i.e.,onebit).Youhavetomakeit4stagesforthe4-bitALU.
Buildthemassubcircuitsandtestthemcompletelytomakesurethattheyworkasexpected.Includethesesimulationcircuitsinyourreport.Includetwoscreenshotsofeachdeviceinthesubcircuitformwithtwodifferentinputcombinations.
Foryourreference,belowaretheCircuitVersescreenshotsofthesimulationcircuits.
4-BitLogicCircuit
4-bitALU
This4-bitALUcanperformthefollowingmicro-operationsbysettingS2S1S0Cinaccordingly.
18
Now,connectyoursubcircuitsaccordingtothefollowingdiagramofthe4-bitCPU.Groupalltheinputsandoutputstogetherforeaseofcontrolandtesting.(Notetheclockinputandexternaldatainputs.)
Foryourreference,theCircuitVersescreenshotoftheCPUisshowninnextpage.Payattentiontohowalltheinputsandoutputsaregroupedtogether.
A B D F
n = 4
22
4
2
Input datan
I3 I2 I1 I0
O3 O2 O1 O0
n=4
Input indicators
output indicators
Input indicator
Input indicator A
Input indicator F
Input indicator B
Input indicator D
This4-bitCPUiscontrtolledbythebitsofâAMUXselect,ââBMUXselect,ââDdestinationselect,âandâFoperationselect.âTheyaregroupedtogethertoformthecontrolword.
Controlword:
Toexecuteaninstruction(ormicro-operation)ofauserprogram,thecorrespondingcontrolwordwillbestoredintoanInstructionRegister(IR),whoseoutputsareconnectedtotheselectioninputsofthetwoMUXes,decoderofthethreeregisters,andALU(e.g.,seetheupperrightcornerofthesimulationcircuit).
A B D F
n = 4
22
4
2
Input datan
I3 I2 I1 I0
O3 O2 O1 O0
n=4
Input indicators
output indicators
Input indicator
Input indicator A
Input indicator F
Input indicator B
Input indicator D
A1 A0 B1 B0 D1 D0 S2 S1 S0 Cin
ThefollowingtablessummarizehowthesourceanddestinationregistersandtheALUoperationsareselectedbysettingthebitsatA,B,D,andFsectionsofthecontrolword.
A B D00 R0 R0 R001 R1 R1 R110 R2 R2 R211 input input --
S2S1S0 Cin=0 Cin=1000 F=A F=A+1001 F=A+B F=A+B+1010 F=A+đľ F=A-B011 F=A-1 F=A100 F=AandB 101 F=AorB 110 F=AxorB 111 F=đ´
Toexecuteonemicro-operation(orinstructionofauserprogram),youfirstloadthecontrolwordintotheIR.Inthesimulation,thisisdonebysettingtheinputindicatorsoftheIRaccordingtothebitpatternofthecontrolword.
Forexamples,themicro-operationsandcontrolwordstosetR0=4andR1=3:
first,setexternalinput=0100 firstsetexternalinput=0011Microoperation: R0Ăinput R1ĂinputField: A B D F A B D FSymbol: input -- R0 A input -- R1 AControlword: 11 11 00 0000 11 11 01 0000Microoperation: R2ĂR0orR1 R2ĂR0-R1Field: A B D F A B D FSymbol: R0 R1 R2 AorB R0 R1 R2 A-BControlword: ? ? ? ? 00 01 10 0101Microoperation: R1ĂR0 R2ĂR0+R1Field: A B D F A B D FSymbol: R0 -- R1 A R0 R1 R2 A+BControlword: ? ? ? ? ? ? ? ?--=donâtcarecondition.Forsimplicity,hereletitbe11.
Wehavecoveredtheworkingprincipleofthe4-bitALU.Nowisthetimetotestyoursimulationcircuit.Youaregoingtoperformthefollowingtests,whichincludeonelogicoperation(i.e.,or),onesubtraction(i.e.,4-3),andonemultiplication(i.e.,4x3):
1. Loadaninteger4(i.e.,0100)fromtheexternalinputintoR0inoneclockcycle.(Warning:Tosimulateoneclockcycle,youneedtoclicktheclockinputindicatorfrom0to1andthenbackto0(onetimeonly)togeneratearisingedgeattheclockinputoftheregisters.Onlydothis0-1-0clockcycleonceforeachmicro-operation.)Youshouldseetheresult,CoutF3F2F1F0=00100,atthefiveoutputindicatorsconnectingtotheALUoutputandthedigitâ4âonthe7-segmentdisplay.
2. Loadaninteger3(i.e.,0011)fromtheexternalinputintoR1inanotherclockcycle(i.e.,0-1-0clockcycleonce.)YoushouldseeCoutF3F2F1F0=0011andthedigitâ3â.
3. PerformâR0orR1âandstoretheresultintoR2inoneclockcycle.YoushouldseeCoutF3F2F1F0=00111anddigitâ7â.)
4. PerformâR0-R1âandstoretheresultintoR2inoneclockcycle.(Youshouldseetheresult,10001,atthefiveoutputindicatorsconnectingtotheALUoutput.DonâtworryabouttheCout=1,whichmeansthesumispositivewhenperformsubtraction.)
5. TransferthecontentofR0toR1.(Note:Steps5-7willperformthe4x3multiplication.)
6. performâR0+R1âandstoretheresultintoR2inoneclockcycle.(Youshouldseetheresult,01000(=8),atthefiveoutputindicatorsconnectingtotheALUoutput.)
7. performâR0+R2âagainandstoretheresultintoR1inoneclockcycle.(Youshouldseetheresult,01100(=12),atthefiveoutputindicatorsconnectingtotheALUoutput.)
Writeyourprogram(i.e.,controlwords)inthefollowingtable(nextpage)andthenexecutethemonebyone.FirstsettheinputindicatorsI3I2I1I0tothebitpatternoftheexternalinputandthentheinputindicatorsattheIRtothebitpatternofthecontrolword.
Afterward,clicktheclockinputindicatorfrom0to1andthenbackto0togeneratearisingedgeattheclockinputoftheregisters.(Warning:Onlydo0-1-0onceattheclockinputforeachcontrolword.)Then,youhavecompletedtheexecutionofonecontrolword.
Theresultisshownatthe4outputindicatorsconnectingtotheALUoutput.Recordthebitpatternofthe4outputindicatorsinthetable.
Micro-Operations ExternalInput(I3I2I1I0)
ControlWords ALUOutput(CoutF3F2F1F0)afterone0-1-0clockcycle
R0Ăinput(0100) 0100 1111000000 00100R1Ăinput(0011) 0011 R2ĂR0vR1 -- R2ĂR0-R1 -- 10001R1ĂR0 -- 00100R2ĂR0+R1 -- R1ĂR0+R2 --
Includethesimulationcircuitsofthe4-bitlogiccircuitandALUinyourreport.Includetwoscreenshotsofeachdeviceinthesubcircuitformwithtwodifferentinputcombinations.
Includingtheabovetableinthereport.Alsoincludethescreenshotsofthewhole4-bitCPUwiththeALUoutputshowingthe(correct)resultsofthemicro-operationsinthetable.