• 2.47 MB
  • 2022-04-22 11:30:58 发布

数字设计 第四版 英文 (Mano Ciletti 马诺 著) 电子工业出版社 课后答案

  • 295页
  • 当前文档由用户上传发布,收益归属用户
  1. 1、本文档共5页,可阅读全部内容。
  2. 2、本文档内容版权归属内容提供方,所产生的收益全部归内容提供方所有。如果您对本文有版权争议,可选择认领,认领后既往收益都归您。
  3. 3、本文档由用户上传,本站不保证质量和数量令人满意,可能有诸多瑕疵,付费之前,请仔细先通过免费阅读内容等途径辨别内容交易风险。如存在严重挂羊头卖狗肉之情形,可联系本站下载客服投诉处理。
  4. 文档侵权举报电话:19940600175。
'课后答案网:www.hackshp.cn若侵犯了您的版权利益,敬请来信告知!课后答案网您最真诚的朋友www.hackshp.cn网团队竭诚为学生服务,免费提供各门课后答案,不用积分,甚至不用注册,旨在为广大学生提供自主学习的平台!课后答案网:www.hackshp.cn视频教程网:www.efanjy.comPPT课件网:www.ppthouse.com ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1SOLUTIONSMANUALDIGITALDESIGN课后答案网FOURTHEDITIONwww.hackshp.cnM.MORRISMANOCaliforniaStateUniversity,LosAngelesMICHAELD.CILETTIUniversityofColorado,ColoradoSpringsrev01/21/2007DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2CHAPTER11.1Base-10:1617181920212223242526272829303132Octal:2021222324252627303132333435363740Hex:101112131415161718191A1B1C1D1E1F20Base-13ABC10111213141516171819232425261.2(a)32,768(b)67,108,864(c)6,871,947,6743211.3(4310)5=4*5+3*5+1*5=58010210(198)12=1*12+9*12+8*12=26010210(735)8=7*8+3*8+5*8=47710210(525)6=5*6+2*6+5*6=197101.414-bitbinary:11_1111_1111_111114Decimal:2-1=16,38310Hexadecimal:3FFF161.5Letb=base课后答案网(a)14/2=(b+4)/2=5,sob=6(b)54/4=(5*b+4)/4=b+3,so5*b=52–4,andb=8www.hackshp.cn(c)(2*b+4)+(b+7)=4b,sob=11221.6(x–3)(x–6)=x–(6+3)x+6*3=x-11x+22Therefore:6+3=b+1msob=8Also,6*3=(18)10=(22)81.768BE=0110_1000_1011_1110=110_100_010_111_110=(64276)81.8(a)Resultsofrepeateddivisionby2(quotientsarefollowedbyremainders):43110=215(1);107(1);53(1);26(1);13(0);6(1)3(0)1(1)Answer:1111_10102=FA16(b)Resultsofrepeateddivisionby16:43110=26(15);1(10)(Faster)Answer:FA=1111_10101.9(a)10110.01012=16+4+2+.25+.0625=22.3125(b)16.516=16+6+5*(.0615)=22.3125(c)26.248=2*8+6+2/8+4/64=22.3125DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.332(d)FAFA.B16=15*16+10*16+15*16+10+11/16=64,250.6875(e)1010.10102=8+2+.5+.125=10.6251.10(a)1.100102=0001.10012=1.916=1+9/16=1.56310(b)110.0102=0110.01002=6.416=6+4/16=6.2510Reason:110.0102isthesameas1.100102shiftedtotheleftbytwoplaces.1011.111.11101|111011.000010101001101100110110001010110Thequotientiscarriedtotwodecimalplaces,giving1011.11Checking:课后答案网1110112/1012=5910/510@1011.112=58.75101.12(a)10000and11011110111011+www.hackshp.cn101x10110000=161010111011110111=5510(b)62hand958h2Eh0010_11102Eh+34h0011_0100x34h362h0110_0010=9810B828A958h=2392101.13(a)Convert27.315tobinary:IntegerRemainderCoefficientQuotient27/2=13+½a0=113/26+½a1=16/23+0a2=03/21+½a3=1½0+½a4=1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.42710=110112IntegerFractionCoefficient.315x2=0+.630a-1=0.630x2=1+.26a-2=1.26x2=0+.52a-3=0.52x2=1+.04a-4=1.31510@.01012=.25+.0625=.312527.315@11011.01012(b)2/3@.6666666667IntegerFractionCoefficient.6666_6666_67x2=1+.3333_3333_34a-1=1.3333333334x2=0+.6666666668a-2=0.6666666668x2=1+.3333333336a-3=1.3333333336x2=0+.6666666672a-4=0.6666666672x2=1+.3333333344a-5=1.3333333344x2=0+.6666666688a-6=0.6666666688x2=1+.3333333376a-7=1.3333333376x2=0+.6666666752a-8=0.6666666667课后答案网10@.101010102=.5+.125+.0313+..0078=.664110.101010102=.1010_10102=.AA16=10/16+10/256=.664110(Sameas(b)).1.14(a)1000_0000(b)0000_0000(c)1101_10101scomp:0111_11111scomp:1111_11111scomp:0010_01012scomp:1000_00002swww.hackshp.cncomp:0000_00002scomp:0010_0110(d)0111_0110(e)1000_0101(f)1111_11111scomp:1000_10011scomp:0111_10101scomp:0000_00002scomp:1000_10102scomp:0111_10112scomp:0000_00011.15(a)52,784,630(b)63,325,6009scomp:47,215,3699scomp:36,674,39910scomp:47,215,37010scomp:36,674,400(c)25,000,000(d)00,000,0009scomp:74,999,9999scomp:99,999,99910scomp:75,000,00010scomp:00,000,0001.16B2FAB2FA:1011_0010_1111_101015scomp:4D051scomp:0100_1101_0000_010116scomp:4D062scomp:0100_1101_0000_0110=4D061.17(a)3409ç03409ç96590(9scomp)ç96591(10scomp)06428–03409=06428+96591=03019(b)1800ç01800ç98199(9scomp)ç98200(10comp)125–1800=00125+98200=98325(negative)Magnitude:1675Result:125–1800=1675DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.5(c)6152ç06152ç93847(9scomp)ç93848(10scomp)2043–6152=02043+93848=95891(Negative)Magnitude:4109Result:2043–6152=-4109(d)745ç00745ç99254(9scomp)ç99255(10scomp)1631-745=01631+99255=0886(Positive)Result:1631–745=8861.18Note:Considersignextensionwith2scomplementarithmetic.(a)10001(b)1000111scomp:011101scomp:1011100withsignextension2scomp:011112scomp:1011101100110100010Diff:000101111111signbitindicatesthattheresultisnegative00000012scomplement-000001result(c)101000(d)101011scomp:10101111scomp:1101010withsignextension2scomp:10110002scomp:1101011001001110000Diff:1100001(negative)课后答案网0011011signbitindicatesthattheresultispositive0011111(2scomp)Check:48-21=27www.hackshp.cn-011111(diffis-31)1.19+9286ç009286;+801ç000801;-9286ç990714;-801ç999199(a)(+9286)+(_801)=009286+000801=010087(b)(+9286)+(-801)=009286+999199=008485(c)(-9286)+(+801)=990714+000801=991515(d)(-9286)+(-801)=990714+999199=9899131.20+49ç0_110001(Needsleadingzeroindicate+value);+29ç0_011101(Leading0indicates+value)-49ç1_001111;-29ç1_100011(a)(+29)+(-49)=0_011101+1_001111=1_101100(1indicatesnegativevalue.)Magnitude=0_010100;Result(+29)+(-49)=-20(b)(-29)+(+49)=1_100011+0_110001=0_010100(0indicatespositivevalue)(-29)+(+49)=+20(c)Mustincreasewordsizeby1(signextension)toaccomodateoverflowofvalues:(-29)+(-49)=11_100011+11_001111=10_110010(1indicatesnegativeresult)Magnitude:1_001110=7810Result:(-29)+(-49)=-78DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.61.21+9742ç009742ç990257(9"scomp)ç990258(10s)comp+641ç000641ç999358(9"scomp)ç999359(10s)comp(a)(+9742)+(+641)ç010383(b)(+9742)+(-641)ç009742+999359=009102Result:(+9742)+(-641)=9102(c)-9742)+(+641)=990258+000641=990899(negative)Magnitude:009101Result:(-9742)+(641)=-9101(d)(-9742)+(-641)=990258+999359=989617(Negative)Magnitude:10383Result:(-9742)+(-641)=-103831.228,723BCD:1000_0111_0010_0011ASCII:0_011_1000_011_0111_011_0010_011_00011.23100001000010(842)0101课后答案网00110111(+537)11010111100101100001001101110101(1,379)www.hackshp.cn1.24(a)(b)6311Decimal6421Decimal000000000000011000110010200102010030011301104(or0101)0100401115010151000610006(or0110)10107(or1001)10017101181010811009101191.25(a)5,13710BCD:0101_0011_0111(b)Excess-3:1000_0100_0110_1010(c)2421:1011_0001_0011_0111(d)6311:0111_0001_0100_10011.265,1379sComp:4,8622421code:0100_1110_1100_10001scomp:1011_0001_0011_0111sameas(c)in1.25DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.71.27Foradeckwith52cards,weneed6bits(32<52<64).Letthemsb"sselectthesuit(e.g.,diamonds,hearts,clubs,spadesareencodedrespectivelyas00,01,10,and11.Theremainingfourbitsselectthe"number"ofthecard.Example:0001(ace)through1011(9),plus101through1100(jack,queen,king).Thisajackofspadesmightbecodedas11_1010.(Note:only52outof64patternsareused.)1.28G(dot)(space)Boole01000111_11101111_01101000_01101110_00100000_11000100_11101111_111001011.29BillGates1.3073F4E576E54AEF627373:0_111_0011sF4:1_111_0100tE5:1_110_0101e76:0_111_0110vE5:1_110_0101e4A:0_100_1010jEF:1_110_1111o62:0_110_0010b73:0_111_0011s1.3162+32=94printingcharacters课后答案网1.32bit6fromtheright1.33(a)897www.hackshp.cn(b)564(c)871(d)2,1991.34ASCIIfordecimaldigitswithoddparity:(0):10110000(1):00110001(2):00110010(3):10110011(4):00110100(5):10110101(6):10110110(7):00110111(8):00111000(9):101110011.35(a)abcafbcgfg1.36abafbgfgDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.8CHAPTER22.1(a)xyzx+y+z(x+y+z)"x"y"z"x"y"z"xyz(xyz)(xyz)"x"y"z"x"+y"+z"000011111000011111001101100001011101010101010010011011011101000011011001100100110100010111101100100101010101110100010110010011111100000111100000(b)(c)xyzx+yz(x+y)(x+z)(x+y)(x+z)xyzx(y+z)xyxzxy+xz00000000000000001001000100000100100010000001111110110000100课后答案网111110000001011111101101111011111101101111www.hackshp.cn11111111111(c)(d)xyzxy+zx+(y+z)(x+y)(x+y)+zxyzyzx(yz)xy(xy)z0000000000000000010110100100000100111101000000110111101110001001011110000001011111110100001101111111000101111111111111112.2(a)xy+xy"=x(y+y")=x(b)(x+y)(x+y")=x+yy"=x(x+y")+y(x+y")=xx+xy"+xy+yy"=x(c)xyz+x"y+xyz"=xy(z+z")+x"y=xy+x"y=y(d)(A+B)"(A"+B")=(A"B")(AB)=(A"B")(BA)=A"(B"BA)=0(e)xyz"+x"yz+xyz+x"yz"=xy(z+z")+x"y(z+z")=xy+x"y=y(f)(x+y+z")(x"+y"+z)=xx"+xy"+xz+x"y+yy"+yz+x"z"+y"z"+zz"==xy"+xz+x"y+yz+x"z"+y"z"=x§y+(x§z)"+(y§z)"2.3(a)ABC+A"B+ABC"=AB+A"B=BDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.9(b)x"yz+xz=(x"y+x)z=z(x+x")(x+y)=z(x+y)(c)(x+y)"(x"+y")=x"y"(x"+y")=x"y"(d)xy+x(wz+wz")=x(y+wz+wz")=x(w+y)(e)(BC"+A"D)(AB"+CD")=BC"AB"+BC"CD"+A"DAB"+A"DCD"=0(f)(x+y"+z")(x"+z")=xx"+xz"+x"y"+y"z"+x"z"+z"z"=z"+y"(x"+z")=z"+x"y"2.4(a)A"C"+ABC+AC"=C"+ABC=(C+C")(C"+AB)=AB+C"(b)(x"y"+z)"+z+xy+wz=(x"y")"z"+z+xy+wz=[(x+y)z"+z]+xy+wz==(z+z")(z+x+y)+xy+wz=z+wz+x+xy+y=z(1+w)+x(1+y)+y=x+y+z(c)A"B(D"+C"D)+B(A+A"CD)=B(A"D"+A"C"D+A+A"CD)=B(A"D"+A+A"D(C+C")=B(A+A"(D"+D))=B(A+A")=B(d)(A"+C)(A"+C")(A+B+C"D)=(A"+CC")(A+B+C"D)=A"(A+B+C"D)=AA"+A"B+A"C"D=A"(B+C"D)(e)ABCD+A"BD+ABC"D=ABD+A"BD=BD2.5(a)课后答案网xyFwww.hackshp.cnsimplifiedF(b)xyFsimplifiedF(c)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.10xyzFsimplifiedF(d)AB0FsimplifiedF课后答案网(e)xyzFwww.hackshp.cnsimplifiedF(f)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.11xyzFFsimplified2.6(a)ABC课后答案网FFwww.hackshp.cnsimplified(b)xyzFFsimplified(c)xyFFsimplifiedDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.12(d)wxyzFFsimplified(e)ABCDF=0simplified课后答案网F(f)www.hackshp.cnwxyzFFsimplified2.7(a)ABCDFFsimplifiedDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.13(b)wxyzFFsimplified(c)ABCD课后答案网FFsimplified(d)www.hackshp.cnABCDFFsimplifiedDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.14(e)ABCDFFsimplified2.8F"=(wx+yz)"=(wx)"(yz)"=(w"+x")(y"+z")FF"=wx(w"+x")(y"+z")+yz(w"+x")(y"+z")=0F+F"=wx+yz+(wx+yz)"=A+A"=1withA=wx+yz2.9(a)F"=(xy"+x"y)"=(xy")"(x"y)"=(x"+y)(x+y")=xy+x"y"(b)F"=[(A"B+CD)E"+E]"=[(A"B+CD)+E]"=(A"B+CD)"E"=(A"B)"(CD)"E"课后答案网F"=(A+B")(C"+D")E"=AC"E"+AD"E"+B"C"E"+B"D"E"(c)F"=[(x"+y+z")(x+y")(x+z)]"=(x"+y+z")"+(x+y")"+(x+z)"=F"=xy"z+x"y+x"z"www.hackshp.cn2.10(a)F1+F2=Sm1i+Sm2i=S(m1i+m2i)(b)F1F2=SmiSmjwheremimj=0ifiòjandmimj=1ifi=j2.11(a)F(x,y,z)=S(1,4,5,6,7)(b)F(x,y,z)=S(0,2,3,7)F=xy+xy"+y"zF=x"z"+yzxyzFxyzF00000001001100100100010101100111100110001011101011011100111111112.12A=1011_0001B=1010_1100(a)AANDB=1010_0000(b)AORB=1011_1101(c)AXORB=0001_1101DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.15(d)NOTA=0100_1110(e)NOTB=0101_00112.13(a)ABCY=A+B+B"(a+C")(b)ABCDY=A(BxorD)+C"(c)课后答案网ABCDwww.hackshp.cnY=A+CD+ABC(d)ABCY=(AxorC)"+B(e)ABCDY=(A"+B")C+D")(f)ABCDY=(A+B")C"+D)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.162.14(a)xyzF=xy+x"y"+y"z(b)xyzF=xy+x"y"+y"z课后答案网=(x"+y")"+(x+y)"+(y+z")"(c)www.hackshp.cnxyzF=xy+x"y"+y"z=[(xy)"(x"y")"(y"z)"]"(d)xyzF=xy+x"y"+y"z=[(xy)"(x"y")"(y"z)"]"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.17(e)xyzF=xy+x"y"+y"z=(x"+y")"+(x+y)"+(y+z")"2.15(a)T1=A"B"C"+A"B"C+A"BC"=A"B"(C"+C)+A"C"(B"+B)=A"B"+A"C"=A"(B"+C")(b)T2=T1"=A"BC+AB"C"+AB"C+ABC"+ABC=BC(A"+A)+AB"(C"+C)+AB(C"+C)=BC+AB"+AB=BC+A(B"+B)=A+BCƒ=(3,5,6,7)P(0,1,2,4)T=A"B"C"+A"B"C+A"BC"T=A"BC+AB"C"+AB"C+ABC"+ABC12A"B"A"C"AC"ACT=A"B"A"C"=A"(B"+C")1课后答案网BCT=AC"+BC+AC=A+BC22.16(a)F(A,B,C)=A"B"C"+A"B"C+A"BC"+A"BC+AB"C"+AB"C+ABC"+ABCwww.hackshp.cn=A"(B"C"+B"C+BC"+BC)+A((B"C"+B"C+BC"+BC)=(A"+A)(B"C"+B"C+BC"+BC)=B"C"+B"C+BC"+BC=B"(C"+C)+B(C"+C)=B"+B=1nn(b)F(x1,x2,x3,...,xn)=Smihas2/2mintermswithx1and2/2mintermswithx"1,whichcanbefactoredn-1n-1n-1andremovedasin(a).Theremaining2producttermswillhave2/2mintermswithx2and2/2mintermswithx"2,whichandbefactoredtoremovex2andx"2.continuethisprocessuntilthelasttermisleftandxn+x"n=1.Alternatively,byinduction,FcanbewrittenasF=xnG+x"nGwithG=1.SoF=(xn+x"n)G=1.2.17(a)(xy+z)(y+xz)=xy+yz+xyz+xz=S(3,5,6,7)=P(0,1,2,4)(b)(A"+B)(B"+C)=A"B"+A"C+BC=S(0,1,3,7)=P(2,4,5,6)(c)y"z+wxy"+wxz"+w"x"z=S(1,3,5,9,12,13,14)=P(0,2,4,6,7,8,10,11,15)(d)(xy+yz"+x"z)(x+z)=xy+xyz"+xyz+x"z=S(1,3,9,11,14,15)=P(0,2,4,5,6,7,8,10,12,13)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.182.18(a)wxyzFF=xy"z+x"y"z+w"xy+wx"y+wxyF=S(1,5,6,7,9,1011,13,14,15)00000000110010000110010000101101101011111000010011101011011111000110111110111111(b)xy"5-Three-inputANDgatesz2-Three-inputORgatesx"Alternative:1-Five-inputORgatey"课后答案网4-Inverterszw"xywwww.hackshp.cnx"ywxFy(c)F=xy"z+x"y"z+w"xy+wx"y+wxy=y"z+xy+wy=yÅz+y(w+x)(d)F=y"z+yw+yx)=S(1,5,9,13,10,11,13,15,6,7,14,15)=S(1,5,6,7,9,10,11,13,14,15)(e)y"zFyxw1–Inverter,2–Two-inputANDgates,2–Two-inputORgatesDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.192.19F=B"D+A"D+BDABCDABCDABCD-B"-DA"--D-B-D0001=10001=10101=50011=30011=30111=71001=90101=51101=131011=110111=71111=15F=S(1,3,5,7,9,11,13,15)=P(0,2,4,6,8,10,12,14)2.20(a)F(A,B,C,D)=S(3,5,9,11,15)F"(A,B,C,D)=S(0,1,2,4,6,7,8,10,12,13,14)(b)F(x,y,z)=P(2,4,5,7)F"=S(2,4,5,7)2.21(a)F(x,y,z)=S(2,5,6)=P(0,1,3,4,7)(b)F(A,B,C,D)=P(0,1,2,4,7,9,12)=S(3,5,6,8,10,11,13,14,15)2.22(a)(AB+C)(B+C"D)=AB+BC+ABC"D+CC"D=AB(1+C"D)+BC课后答案网=AB+BC(SOPform)=B(A+C)(POSform)(b)x"+x(x+y")(y+z")=(x"+x)[x"+(x+y")(y+z")]==(x"+x+y")(x"+y+z")www.hackshp.cn=xÅ+y+zÅ2.23(a)B"C+AB+ACDABCDFDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.20(b)(A+B)(C+D)(A"+B+D)ABCDF(c)(AB+A"B")(CD"+C"D)ABCD课后答案网Fwww.hackshp.cn(d)A+CD+(A+D")(C"+D)ABCDF2.24x§y=x"y+xy"and(x§y)"=(x+y")(x"+y)Dualofx"y+xy"=(x"+y)(x+y")=(x§y)"2.25(a)x|y=xy"òy|x=x"yNotcommutative(x|y)|z=xy"z"òx|(y|z)=x(yz")"=xy"+xzNotassociativeDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.21(b)(x§y)=xy"+x"y=y§x=yx"+y"xCommutative(x§y)§z=ƒ(1,2,4,7)=x§(y§z)Associative2.26NANDNORGate(Positivelogic)(Negativelogic)xyzxyzxyzLLH001110LHH011100HLH101010HHL110001NORNANDGate(Positivelogic)(Negativelogic)xyzxyzxyzLLH001110LHL010101HL课后答案网L100011HHL1100012.27f1=a"b"c+a"bc+abc"+abcf2=a"bc"+a"bc+ab"c"+ab"c+abc"www.hackshp.cna"b"c"a"bcafb1c"abca"bf2c"ab"c"ab"cDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.222.28(a)y=a(bcd)"e=a(b"+c"+d")ey=a(b"+c"+d")e=ab’e+ac’e+ad’e=S(17,19,21,23,25,27,29)abcdeyabcdey00000010000000001010001100010010010000011010011100100010100000101010101100110010110000111010111100010000110000010010110011010100110100010110110111011000111000011010111011011100111100011110111110(b)y1=a课后答案网§(c+d+e)=a"(c+d+e)+a(c"d"e")=a"c+a"d+a"e+ac"d"e"y2=b"(c+d+e)f=b"cf+b"df+b"efy1=a(c+d+e)=a"(c+d+e)+a(c"d"e")=a"c+a"d+a"e+ac"d"e"www.hackshp.cny=b"(c+d+e)f=b"cf+b"df+b"ef2a"-c---a"--d--a"---e-a-c"d"e"-001000=8000100=8000010=2100000=32001001=9000101=9000011=3100001=33001010=10000110=10000110=6110000=34001011=11000111=11000111=7110001=35001100=12001100=12001010=10001101=13001101=13001011=11001110=14001110=14001110=14001111=15001111=15001111=15-b"c--f-b"-d-f-b"--ef011000=24010100=20010010=18001001=9001001=9000011=3011001=25010101=21010011=19001011=11001011=11000111=7011010=26010110=22010110=22001101=13001101=13001011=11011011=27010111=23010111=23001111=15001111=15001111=15101001=41101001=41100011=35011100=28011100=28011010=26101011=43101011=43100111=39011101=29011101=29011001=27101101=45101101=45101011=51011110=30011110=30011110=30011111=31011111=31011111=31101111=47101111=47101111=55DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.23y=S(2,3,6,7,8,9,10,11,12,13,14,15,18,19,22,23,24,25,26,27,28,129,30,31,32,33,34,35)y=S(3,7,9,13,15,35,39,41,43,45,47,51,55)2abcdefyyabcdefyyabcdefyyabcdefyy12121212000000000100000010000010110000000000010001000100100001101100010000001010010010101000101011001000000011110100111010001111110011010001000001010000100100001101000000010100010101001001010011010100000110100101101010011000110110000001111101011110100111011101110100100010011000101010000011100000001001110110011010100101111001000010101001101010101010001110100000101110011011101010110111101100001100100111001010110000111100000011011101110110101101011111010000111010011110101011100011111000001111课后答案网11011111101011110111111100www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.24Chapter33.1yzyyzyxx0001111000011110mmmmmmmm013201320110111mmmmmmmm45764576x111x111zz(a)F=xy+x’z"(b)F=z"+x"yyzyyzyxx0001111000011110mmmmm0m1m3m201320111101mmmmm4m5m7m64576x1课后答案网1x1111zz(c)www.hackshp.cnF=x"+yz(d)F=xy+xz+yz3.2yzyyzyxx0001111000011110mmmmmmmm013201320110111mmmmmmmm45764576x111x111zz(a)F=x"y"+xz(b)F=y+x"zyzyyzyxx0001111000011110mmmmm0m1m3m201320110111mmmmm4m5m7m64576x111x111zz(c)F=x"y"+xy(d)F=y"+x"zDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.25yzyyzyxx0001111000011110mmmmm0m1m3m2013201101mmmmm4m5m7m64576x111x11111zz(e)F=z(f)F=x+y"z3.3yzyyzyxx0001111000011110mmmmmmmm0132013201101111mmmmmmmm45764576x111x11zz(a)课后答案网F=xy+x"y"z"+x"yz"(b)F=x"y"+yz+x"yz"F=xy+x"z"F=x"+yzyzwww.hackshp.cnyyzyxx0001111000011110mmmmm0m1m3m20132011101mmmmm4m5m7m64576x111x111zz(c)F=x"y+yz"+y"z"(d)F=xyz+x"y"z+xyz"F==x"y+z"F=x"y"z+xyDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.263.4CDCAB00011110mmmm013200mmmmyzy457601111x00011110mmmmm12m13m15m14B0132011111mmmmAm8m9m11m104576x11110zD(a)F=y(b)F=BCD+A"BD"CDCyzyABwx0001111000011110mmmmmmmm013201320010011mmmmmmmm4576457601101课后答案网mmmmBmmmmx121315141213151411111111111Ammmmwmmmm89111089111010www.hackshp.cn110Dz(c)F=CD+ABD+ABC(d)F=w"x"y+wxyzyyzywxwx0001111000011110mmmmmmmm013201320010011mmmmmmmm45764576011111011mmmmxmmmmx121315141213151411111wmmmmwmmmm891110891110101011zz(e)F=w"x+w"y"z(f)F=x"y"+w"y"zDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.273.5yzyCDCwxAB0001111000011110mmmmmmmm01320132001001mmmmmmmm4576457601111011mmmmxmmmmB1213151412131514111111111wmmmmAmmmm8911108911101010111zD(a)F=xz"+w"y"z+wxy(b)F=A"C+A"C"D+B"C"DyzyCDCwxAB0001111000011110mmmmmmmm0132013200110011mmmmmmmm4576457601课后答案网1111011111mmmmxmmmmB1213151412131514111111wmmmmAmmmm89111089111010www.hackshp.cn111011zD(c)F=w"y"+wx"y"+w"xy(d)F=BD+A"B+B"D"or=BD+B"D"+A"D"3.6CDCyzyABwx0001111000011110mmmmmmmm0132013200110011mmmmmmmm4576457601110111mmmmBmmmmx121315141213151411111111Ammmmwmmmm891110891110101110111Dz(a)F=B"D"+A"BD+ABC"(b)F=xy"+x"z+wx"yDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.28CDCCDCABAB0001111000011110mmmmmmmm0132013200110011mmmmmmmm4576457601111011mmmmBmmmmB12131514121315141111111AmmmmAmmmm89111089111010111011DD(d)F=A"B"D"+BC"D+ACD"+AB"C(c)F=B"D"+BCD+A"BD+A"BC3.7yzyCDCwxAB0001111000011110mmmmmmmm013201320011100111mmmmmmmm4576457601课后答案网11011mmmmxmmmmB121315141213151411111111wmmmmAmmmm89111089111010www.hackshp.cn11110111zD(a)F=z+x"y(b)F=C"D+B"C+ABC"CDCyzyABwx0001111000011110mmmmmmmm01320132001110011mmmmmmmm457645760111011mmmmBmmmmx12131514121315141111111111Ammmmwmmmm891110891110101111011Dz(c)F=B"D"+AC+A"BD+CD(orB"C)(d)F=wx+x"y+yzDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.293.8(a)F(x,y,z)=S(3,5,6,7)yzyx00011110mmmm013201mmmm4576x1111z(b)F=S(1,3,5,9,12,13,14)CDCAB00011110mmmm01320011mmmm4576011mmmmB课后答案网1213151411111Ammmm891110www.hackshp.cn101D(c)F=S(0,1,2,3,11,12,14,15)ywx00011110mmmm0132001111mmmm457601mmmmx1213151411111wmmmm891110101zDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.30(d)F=S(3,4,5,7,11,12)CDCAB00011110mmmm0132001mmmm457601111mmmmB12131514111Ammmm891110101D3.9(a)(b)yzyCDCwxAB0001111000011110mmmmmmmm01320132001100111mmmmmmmm4576457601课后答案网11110111mmmmxmmmmB121315141213151411111111wmmmmAmmmm8www.hackshp.cn91110891110101110111zDEssential:xz,x"z"Essential:B"D",AC,A"BDNon-essential:w"x,w"z"Non-essential:CD,B"CF=xz+x"z"+(w"xorw"z")F=B"D"+AC+A"BD+(CDORB"C)(c)(d)CDCyzyABwx0001111000011110mmmmmmmm0132013200110011mmmmmmmm4576457601110111mmmmBmmmmx1213151412131514111111111111Ammmmwmmmm89111089111010111011DzEssential:BC",AC,A"B"DEssential:wy",xy,w"x"zF=BC"+AC+A"B"DF=wy"+xy+w"x"zDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.31(e)(f)CDCyzyABwx0001111000011110mmmmmmmm01320132001110011mmmmmmmm457645760111011mmmmBmmmmx12131514121315141111111111Ammmmwmmmm8911108911101011110111DzEssential:BD,B"C,B"C"D"Essential:wy",wx,x"z",xyzF=BD+B"C+B"C"D"F=wy"+wx+x"z"+xyz3.10(a)课后答案网(b)yzyCDCwxAB0001111000011110mmmmmmmm01320132001www.hackshp.cn100111mmmmmmmm457645760111110111mmmmxmmmmB121315141213151411111111wmmmmAmmmm891110891110101110111zDEssential:xz,w"x,x"z"Essential:AC,B"D",CD,A"BDF=xz+w"x+x"z"F=AC+B"D"+CD+A"BDDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.32(c)(d)CDCyzyABwx0001111000011110mmmmm0m1m3m2013200110011mmmmm4m5m7m6457601110111mmmmBmmmmx1213151412131514111111111111Ammmmwmmmm89111089111010111011zDEssential:BC",ACEssential:wy",xyNon-essential:AB,AÅBÅD,BÅCD,AÅCÅDNon-essential:wx,x"y"z,w"wz,w"x"zF=BCÅ+AC+AÅBÅDF=wy"+xy+w"x"z(e)(f)CDCyzyABwx00课后答案网01111000011110mmmmm0m1m3m2013200110011mmmmm4m5m7m6457601www.hackshp.cn11011mmmmBmmmmx12131514121315141111111111Ammmmwmmmm8911108911101011110111zDEssential:BD,B"C,AB"CEssential:wy",wx,xyz,x"yz"Non-essential:CDF=wy"+wx+xyz+x=yz"F=BD+B"C+AB"CDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.333.11(a)F(A,B,C,D,E)=ƒ(0,1,4,5,16,17,21,25,29F=AÅBÅDÅ+ADÅE+BÅCÅDÅm0:A"B"C"D"E"=00000m1:A"B"C"D"E=00001m4:A"B"CD"E"=00100m5:A"B"CD"E=00101m16:AB"C"D"E"=10000m17:AB"C"D"E=10001m21:AB"CD"E=10101m25:ABC"D"E=11001m29:ABCD"E=11101A=0DDEBC00011110AB"D"00110111C11B课后答案网10B"C"D"Ewww.hackshp.cnA=1DDEBC00011110AD"E0011011C111B101EDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.34(b)F(A,B,C,D,E)=A"B"CE"+B"C"D"E"+A"B"D"+B"CD"+A"CD+A"BDF(A,B,C,D,E)=A"B"D"+B"D"E"+B"CD"+A"CD+A"BDA"B"CE":AB"CDE"+A"B"CD"E"B"C"D"E":AB"C"D"E"+A"B"C"D"E"A"B"D":A"B"CD"E+A"B"CD"E"+A"B"C"D"E+A"B"C"D"E"B"CD":AB"CD"E+AB"CD"E"+A"B"CD"E+A"B"CD"E"A"CD:A"BCDE+A"BCDE"+A"B"CDE+A"B"CDE"A"BD:A"BCDE+A"BCDE"+A"BC"DE+A"BC"DE"A"B"D"A=0DB"D"E"DEBC00011110B"CD"0011A"CD011111C1111B课后答案网1011A"BDEwww.hackshp.cnA=1DDEBC000111100010111C11B10EDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.353.12(a)yzyyzywxwx0001111000011110mmmmmmmm0132013200111000mmmmmmmm4576457601101000mmmmxmmmmx121315141213151411111000wmmmmwmmmm89111089111010111000zzF=S(0,1,2,5,8,10,13)F"=yz+xz"+xy+wx"zF=x"z"+w"x"y"+w"y"zF=(y"+z")(x"+z)(x"+y")(w"+x+z")(b)CDCF=P(1,3,5,7,13,15)ABF"=A"D+B"D00011110mmmm0132F=(A+DÅ)(BÅ+DÅ)00课后答案网00F=C"D"+AB"+CD"mmmm45760100mmmmB1213151411www.hackshp.cn00Ammmm89111010D(c)CDCAB00011110F=P(1,3,6,9,11,12,14)mmmm0132F"=B"D+BCD"+ABD"0000F=(B+D")(B"+C"+D)(A"+B"+D)mmmmF=BD+B"D"+A"C"D"4576010mmmmB121315141100Ammmm8911101000DDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.363.13(a)F=xy+zÅ=(x+zÅ)(y+zÅ)(b)CDCCDCABAB0001111000011110mmmmmmmm01320132000100000100mmmmmmmm45764576010100010100mmmmBmmmmB1213151412131514111110111110AmmmmAmmmm891110891110101111101111DDF=AC"+AD+C"D+AB"CF"A"D"+A"C+BCD"F=(A+D)(A+C")(B"+C"+D)(c)CDCCDCABAB0001111000011110mmmmmmmm0132013200000111课后答案网m4m5m7m6m4m5m7m601001111mmmmBmmmmB121315141213151411001111Awww.hackshp.cnmmmmAmmmm89111089111010000101DDF=(A+C"+D")(A"+B"+D")(A"+B+D")(A"+B+C")F"=A"CD+ABD+AB"D+AB"CF=A"C+A"D"+BD"+C"D"F"=AD+CD+AB"CF=(A"+D")(C+D")(A"+B+C")DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.37(d)CDCCDCABAB0001111000011110mmmmmmmm0132013200000000mmmmmmmm4576457601101000mmmmBmmmmB121315141213151411111110AmmmmAmmmm89111089111010111000DDF=ABC"+AB"D+BCDF"=A"C"+A"B"+CD"+B"C"D"F=AD+ABC"+BCDF=(A+C)(A+B)(C"+D)(B+C+D)3.14CDCCDCABAB0001111000011110mmmmmmmm0132013200100000课后答案网m4m5m7m6m4m5m7m601110100mmmmBmmmmB121315141213151411111000Awww.hackshp.cnmmmmAmmmm89111089111010111000DDSOPform(using1s):F=B"C"D"+AB"D"+BC"D+A"BDF=B"D"(A+C")+BD(A"+C")POSform(using0s):F"=BD"+B"D+A"CD"+ACDF=[(B"+D)(B+D")][(A+C"+D)(A"+C"+D")]AlternativePOS:F"=BD"+B"D+A"CD"+A"B"CF=[(B"+D)(B+D")][(A+C"+D)(A"+B+C)]DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.383.15(a)(b)CDCAB00011110mmmm0132001xyzym4m5m7m6x01x100011110m0m1m3m2mmmmB121315140xx111111m4m5m7m6Ammmm891110x11x11101xzDF=1F=B"D"+ABC"DF=S(0,1,2,3,4,5,6,7)F=S(0,2,6,8,10,13,14)(c)(d)CDCCDCABAB0001111000011110mmmmmmmm课后答案网0132013200x00x11xmmmmmmmm457645760111101mmmmBmmmmBwww.hackshp.cn12131514121315141111x1111AmmmmAmmmm89111089111010xx101x1DDF=BC"+BD+ABF=B"D"+A"B"+ABCDF=S(4,5,7,12,13,14,15)F=F=S(0,1,2,3,8,10,15)3.16(a)CDCAB00011110m0m1m3m2F=A+A"B"001111F=(A"(A"B")")"mmmm457601A"mmmmBF12131514111111A"Ammmm891110B"101111DDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.39(b)CDCAB00011110m0m1m3m2F=BC+AB+A"B"C"D001F=((BC)"(AB)"(A"B"C"D)")"mmmm45760111BCmmmmB12131514111111AFBAmmmm89111010A"B"DC"D"(c)CDCAB00011110mmmmF"=A"B"D01320011F=(A"B"D)"课后答案网A"mmmm4576011111B"FBDmmmm12131514www.hackshp.cn111111Ammmm891110101111D(d)BCBA00011110mmmmF=AC+AB01320F=((AC)"(AB)")"mmmm4576A1111ACFACB3.17DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.40CDCCDCABAB0001111000011110mmmmmmmm0132013200111100mmmmmmmm4576457601101mmmmBmmmmB121315141213151411111AmmmmAmmmm891110891110101110DDF=A"B"+C"D"+B"C"F"=BC+AC+BDF=(BC)"(AC)"(BD)"ACBF"D课后答案网BC3.18F=(A§www.hackshp.cn)B"(C§D)=(AB"+A"B)(CD"+C"D)=AB"CD"+AB"C"D+A"BCD"+A"BC"DCDCAB00011110m0m1m3m2A00Bm4m5m7m6A"0111B"FmmmmB12131514C11DAmmmm891110C"1011D"DF=AB"CD"+AB"C"D+A"BCD"+A"BC"DandF"=A"B"+AB+C"D"+CDF=(A"B")"(AB)"(C"D")"(CD)"=(A+B)(A"+B")(C"+D")(C+D)F"=[(A+B)(A"+B")]"+[(C"+D")(C+D)]"F=([(A+B)(A"+B")]"+[(C"+D")(C+D)]")"F=([(A+B)"+(A"+B")"]+[(C"+D")"+(C+D)"])"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.413.19(a)F=(w+zÅ)(xÅ+zÅ)(wÅ+xÅ+yÅ)yzywx00011110mmmm01320011yzmmmm45760111wxmmmmxF12131514111wwmmmmz891110101111zF=y"z"+wx"+w"z"F=[(y+z)"+(w"+x)"+(w+z)"]F"=[(y+z)"+(w"+x)"+(w+z)"]"(b)yzywx00011110m0m1m3m2w"0011xm4课后答案网m5m7m6w01x"Fmmmmx12131514y"1111z"wm8www.hackshp.cnm9m11m10y10zzF=S(1,2,13,14)F"=w"x+wx"+y"z"+yz=[(w+x")(w"+x)(y+z)(y"+z")]"F=(w+x")"+(w"+x)"+(y+z)"+(y"+z")(c)F=[(x+y)(x"+z)]"=(x+y)"+(x"+z)"F"=[(x+y)"+(x"+z)"]"xyF"x"z3.20Multi-levelNOR:F=(AB"+CD")E+BC(A+B)F"=[(AB"+CD")E+BC(A+B)]"F"=[[(AB"+CD")"+E"]"+[(BC)"+(A+B)"]"]"F"=[[((A"+B)"+(C"+D)")"+E"]"+[(B"+C")"+(A+B)"]"]"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.42A"BC"DFE"B"C"ABMulti-levelNAND:F=(AB"+CD")E+BC(A+B)F"=[(AB"+CD")E]"[BC(A+B)]"F"=[((AB")"(CD")")"E]"[BC(A"B")"]"课后答案网AB"www.hackshp.cnCD"FEBCA"B"3.21F=w(x+y+z)+xyzF"=[w(x+y+z)]"[xyz]"=[w(x"y"z")")]"(xyz)"xyzx"Fy"z"wDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.433.22zDCyBxwA3.23CDCAB课后答案网00011110mmmm013200x1A"m4m5m7m6B"0111www.hackshp.cnC"FmmmmB12131514D111xAmmmm89111010xx1DF=AC"+A"D"+B"CD"F"=D+ABCF=[D+ABC]"=[D+(A"+B"+C"]")]"3.24CDCAB00011110mmmm0132001mmmm4576011mmmmB121315141111Ammmm891110101111D(a)F=C"D"+AB"+AD"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.44F"=(C"D")"(AB")"(AD")"AND-NAND:C"D"AFB"AD"(b)F"=[C"D"+AB"+AD"]"AND-NOR:C"D"AF’B"AD"(c)F=C"D"+AB"+AD"=(C+D)"+(A"+B)"+(A"+D)"F"=(C"D")"(AB")"(AD")"=(C+D)(A"+B)(A"+D)F=[(C+D)(A"+B)(A"+D)]"OR-NAND:课后答案网CDA"FBwww.hackshp.cnA"D(d)F=C"D"+AB"+AD"=(C+D)"+(A"+B)"+(A"+D)"NOR-OR:CDA"FBA"D3.25AABBABCDA+B+C+DCCDDAND-ANDANDOR-ORORDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.45AABB(ABCD)"(A+B+C+D)"CCDDAND-NANDNANDOR-NORNORAABB(A"B"C"D")"[(AB)"+(C"D")]"CCDA+B+C+DABCDDNOR-NANDORNAND-NORANDA"B"AABBA"B"C"D"A"+B"+C"+D"CCD(A+B+C+D)"(A+B+C+D)"C"D"DNOR-ANDNORNAND-ORNANDThedegenerateformsuse2-inputgatestoimplementthefunctionalityof4-inputgates.课后答案网3.26g=(a+b+c"+d")(b"+c"+d)(a"+c+d")f=abc"+c"d+a"cd"+b"cd"g"=a"b"cd+bcd"+ac"dcdccdcabwww.hackshp.cnab0001111000011110mmmmmmmm013201320011001101mmmmmmmm457645760111011110mmmmbmmmmb12131514121315141111111010ammmmammmm8911108911101011101011ddfg=ac"d+abc"d+b"cd"3.27x§y=x"y+xy";Dual=(x"+y)(x+y")=(x§y)"3.28xyxyPCzzP(a)3-bitoddparitygenerator(b)4-bitoddparitygeneratorDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.463.29D=A§B§CE=A"BC+AB"C=(A§B)CF=ABC"+(A"+B")C=ABC"+(AB)"C=(AB)§CG=ABCABASSD=ABCHalf-AdderHalf-AdderCBCCE=(AB)CSF=(AB)CHalf-AdderCG=ABCAB3.30F=AB"CD"+A"BCD"+AB"C"D+A"BC"DF=(A§B)CD"+(A§B)C"D=(A§B)(C§D)ABF课后答案网CD3.31Note:Itisassumedthatacomplementedinputisgeneratedbyanothercircuitthatisnotpartofthecircuitthatistobedescribed.www.hackshp.cn(a)moduleFig_3_22a_gates(F,A,B,C,C_bar,D);outputF;inputA,B,C,C_bar,D;wirew1,w2,w3,w4;and(w1,C,D);or(w2,w1,B);and(w3,w2,A);and(w4,B,C_bar);or(F,w3,w4);endmodule(b)moduleFig_3_22b_gates(F,A,B,C,C_bar,D);outputF;inputA,B,C,C_bar,D;wirew1,w2,w3,w4;not(w1_bar,w1);not(B_bar,B);not(w3_bar,w3);not(w4_bar,w4);nand(w1,C,D);or(w2,w1_bar,B_bar);nand(w3,w2,A);nand(w4,B,C_bar);or(F,w3_bar,w4_bar);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.47(c)moduleFig_3_23a_gates(F,A,A_bar,B,B_bar,C,D_bar);outputF;inputA,A_bar,B,B_bar,C,D_bar;wirew1,w2,w3,w4;and(w1,A,B_bar);and(w2,A_bar,B);or(w3,w1,w2);or(w4,C,D_bar);or(F,w3,w4);endmodule(d)moduleFig_3_23b_gates(F,A,A_bar,B,B_bar,C_bar,D);outputF;inputA,A_bar,B,B_bar,C_bar,D;wirew1,w2,w3,w4;nand(w1,A,B_bar);nand(w2,A_bar,B);not(w1_bar,w1);not(w2_bar,w2);or(w3,w1_bar,w2_bar);or(w4,C,D_bar);not(w5,C_bar);not(w6,D);nand(F_bar,w5,w6);课后答案网not(F,F_bar);endmodule(e)moduleFig_3_26_gates(F,A,B,C,D,E_bar);outputF;www.hackshp.cninputA,B,C,D,E_bar;wirew1,w2,w1_bar,w2_bar,w3_bar;not(w1_bar,w1);not(w2_bar,w2);not(w3_bar,E_bar);nor(w1,A,B);nor(w2,C,D);nand(F,w1_bar,w2_bar,w3_bar);endmodule(f)moduleFig_3_27_gates(F,A,A_bar,B,B_bar,C,D_bar);outputF;inputA,A_bar,B,B_bar,C,D_barwirew1,w2,w3,w4,w5,w6,w7,w8,w7_bar,w8_bar;not(w1,A_bar);not(w2,B_bar);not(w3,A);not(w4,B_bar);not(w7_bar,w7);not(w8_bar,w8);and(w5w1,w2);and(w6,w3,w4);nor(w7,w5,w6);nor(w8,C,D_bar);and(F,w7_bar,w8_bar);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.483.32Note:Itisassumedthatacomplementedinputisgeneratedbyanothercircuitthatisnotpartofthecircuitthatistobedescribed.(a)moduleFig_3_22a_CA(F,A,B,C,C_bar,D);outputF;inputA,B,C,C_bar,D;wirew1,w2,w3,w4;assignw1=C&D;assignw2=w1|B;assignw3=w2&A);assignw4=B&C_bar);assignF=w3|w4);endmodule(b)moduleFig_3_22b_CA(F,A,B,C,C_bar,D);outputF;inputA,B,C,C_bar,D;wirew1,w2,w3,w4;assignw1_bar=~w1;assignB_bar=~B;assignw3_bar=~w3;assignw4_bar=~w4;assignw1=~(C&D);assignw2=w1_bar|B_bar;assignw3=~(w2&A);课后答案网assignw4=~(B&C_bar);assignF=w3_bar|w4_bar;endmodule(c)moduleFig_3_23a_CA(F,A,A_bar,B,B_bar,C,D_bar);www.hackshp.cnoutputF;inputA,A_bar,B,B_bar,C,D_bar;wirew1,w2,w3,w4;assignw1=A&B_bar;assignw2=A_bar&B;assignw3=w1|w2);assignw4=C|D_bar;assignF=w3|w4;endmodule(d)moduleFig_3_23b_CA(F,A,A_bar,B,B_bar,C_bar,D);outputF;inputA,A_bar,B,B_bar,C_bar,D;wirew1,w2,w3,w4;assignw1=~(A&B_bar);assignw2=~(A_bar&B);assignw1_bar=~w1;assignw2_bar=~w2;assignw3=w1_bar|w2_bar;assignw4,C|D_bar;assignw5=~C_bar;assignw6=~D;assignF_bar=~(w5&w6);assignF=~F_bar;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.49(e)moduleFig_3_26_CA(F,A,B,C,D,E_bar);outputF;inputA,B,C,D,E_bar;wirew1,w2,w1_bar,w2_bar,w3_bar;notw1_bar=~w1;notw2_bar=~w2;notw3_bar=~E_bar;norw1=(A|B;norw2=(C|D;nandF=~(w1_bar&w2_bar&w3_bar);endmodule(f)moduleFig_3_27_CA(F,A,A_bar,B,B_bar,C,D_bar);outputF;inputA,A_bar,B,B_bar,C,D_barwirew1,w2,w3,w4,w5,w6,w7,w8,w7_bar,w8_bar;notw1=~A_bar;notw2=~B_bar;notw3=~A;notw4=~B_bar;notw7_bar=~w7;notw8_bar=~w8;assignw5=w1&w2;assignw6=w3&w4;assignw7=~(w5|w6);课后答案网assignw8=~(C|D_bar);assignF=w7_bar&w8_bar;endmodule3.32(a)www.hackshp.cnxw3w1F=xywyw4Initially,withxy=00,w1=w2=1,w3=w4=0andF=0.w1shouldchangeto04nsafterxychangesto01.w4shouldchangeto18nsafterxychangesto01.Fshouldchangefrom0to110nsafterw4changesfrom0to1,i.e.,18nsafterxychangesfrom00to01.(b)`timescale1ns/1psmoduleProb_3_33(outputF,inputx,y);wirew1,w2,w3,w4;and#8(w3,x,w1);not#4(w1,x);and#8(w4,y,w1);not#4(w2,y);or#10(F,w3,w4);endmodulemodulet_Prob_3_33();regx,y;wireF;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.50Prob_3_33M0(F,x,y);initial#200$finish;initialforkx=0;y=0;#20y=1;joinendmodule(c)Tosimulatethecircuit,itisassumedthattheinputsxy=00havebeenappliedsufficientlylongforthecircuittobestablebeforexy=01isapplied.Thetestbenchsetsxy=00att=0ns,andxy=1att=10ns.Thesimulatorassumesthatxy=00hasbeenappliedlongenoughforthecircuittobeinastablestateatt=0ns,andshowsF=0asthevalueoftheoutputatt=0.Thewaveformsshowtheresponsetoxy=01appliedatt=10ns.0.000ns39.290ns78.580ns117.870nsNamexw1yw2w3w4课后答案网Fwww.hackshp.cnt=28nst=18nsNote:inputchangeoccursatt=10ns.t=14nst=10nsD=18ns3.34moduleProb_3_34(Out_1,Out_2,Out_3,A,B,C,D);outputOut_1,Out_2,Out_3;inputA,B,C,D;wireA_bar,B_bar,C_bar,D_bar;assignA_bar=~A;assignB_Bar=~B;assignC_bar=~C;assignD_bar=~D;assignOut_1=~((C|B)&(A_bar|D)&B);assignOut_2=((C*B_bar)|(A&B&C)|(C_bar&B))&(A|D_bar);assignOut_3=C&((A&D)|B)|(C&A_bar);endmodule3.35moduleExmpl-3(A,B,C,D,F)//Line1inputsA,B,C,OutputD,F,//Line2outputB//Line3andg1(A,B,B);//Line4not(D,B,A),//Line5OR(F,B;C);//Line6DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.51endofmodule;//Line7Line1:Dashnotallowed,useunderscore:Exmpl_3.Terminatelinewithsemicolon(;).Line2:inputsshouldbeinput(nosattheend).Changelastcomma(,)tosemicolon(;).Outputisdeclaredbutdoesnotappearintheportlist,andshouldbefollowedbyacommaifitisintendedtobeinthelistofinputs.IfOutputisamispellingofoutputandistodeclareoutputports,Cshouldbefollowedbyasemicolon(;)andFshouldbefollowedbyasemicolon(;).Line3:Bcannotbedeclaredasinput(Line2)andoutput(Line3).Terminatethelinewithasemicolon(;).Line4:AcannotbeanoutputoftheprimitiveifitisaninputtothemoduleLine5:Toomanyentriesforthenotgate(onlytwoallowed).Line6:ORmustbeinlowercase:changeto“or”.Line7:endmodule课后答案网ismispelled.Removesemicolon(nosemicolonafterendmodule).3.36(a)BCxdwww.hackshp.cnDFzwaAy(b)A1A0B1B0w1w6A_lt_Bw2w7w3A_gt_Bw4A_eq_Bw5(c)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.52aby1y23.37UDP_Majority_4(y,a,b,c,d);outputy;inputa,b,c,d;table//abcd:y0000:0;0001:0;0010:0;0011:0;0100:0;0101:0;0110:0;0111:1;1000:0;课后答案网1001:0;1010:0;1011:0;1100:0;1101:0;www.hackshp.cn1110:1;1111:1;endtableendprimitive3.38modulet_Circuit_with_UDP_02467;wireE,F;regA,B,C,D;Circuit_with_UDP_02467m0(E,F,A,B,C,D);initial#100$finish;initialforkA=0;B=0;C=0;D=0;#40A=1;#20B=1;#40B=0;#60B=1;#10C=1;#20C=0;#30C=1;#40C=0;#50C=1;#60C=0;#70C=1;#20D=1;joinendmodule//Verilogmodel:User-definedPrimitiveprimitiveUDP_02467(D,A,B,C);outputD;inputA,B,C;//TruthtableforD=f(A,B,C)=S(0,2,4,6,7);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.53table//ABC:D//Columnheadercomment000:1;001:0;010:1;011:0;100:1;101:0;110:1;111:1;endtableendprimitive//Verilogmodel:CircuitinstantiationofCircuit_UDP_02467moduleCircuit_with_UDP_02467(e,f,a,b,c,d);outpute,f;inputa,b,c,d;UDP_02467M0(e,a,b,c);and(f,e,d);//OptiongateinstancenameomittedendmoduleName0306090AB课后答案网CDEwww.hackshp.cnFDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.54CHAPTER44.1(a)T1=B"C,T2=A"B,T3=A+T1=A+B"C,T4=D§T2=D§(A"B)=A"BD"+D(A+B")=A"BD"+AD+B"DF1=T3+T4=A+B"C+A"BD"+AD+B"DWithA+AD=AandA+A"BD"=A+BD":F1=A+B"C+BD"+B"DAlternativecover:F1=A+CD"+BD"+B"DF2=T2+D=A"B+DABCDTTTTFF123412CDC0000000000000111100001000111m0m1m3m20010101010001110011101111mmmm01000145760111011101010100010110010111m12m13m15m14B0111010001111111Ammmm1000001891110010101111100100111110101010101011课后答案网101111D11000010101101001111F1=A+B"C+B"D+BD"11100010101111www.hackshp.cn001111CDCCDCABAB0001111000011110mmmmmmmm01320132001100111mmmmmmmm457645760111110111mmmmBmmmmB12131514121315141111111111AAmmmmmmmm8911108911101011101111DDF=A"B+D2F=A+CD"+B"D+BD"1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.554.2[(A"D)"A"]"=A+DA"AFBBC+A"CBCGD(A"D)"=A+D’F=(A+D)(A"+BC)=A"D+ABC+BCD+=A"D+ABCF=(A+D")(A"+BC)=A"D"+ABC+BCD"=A"D"+ABCCDCCDCABAB0001111000011110mmmmmmmm0132013200110011mmmmmmmm4576457601110111mmmmBmmmmB121315141213151411111111AmmmmAmmmm课后答案网8911108911101010DDF=A"D+ABC+BCD=A"D+ABCwww.hackshp.cnG=A"D"+ABC+BCD"=A"D"+ABC4.3(a)Yi=(AiS"+BiS)E"fori=0,1,2,3(b)1024rowsand14columns4.4(a)xyzFyzy0001x000111100011mmmmx"013201010111y"0110mmmmF10004576x1x"1010y"11001110zF=x"y"+x"z"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.56(b)xyzFyzy0000x000111100011mmmm013201000110110zFmmmm100045761010x11111001110zF=z4.5xyzABCAyzy000010x00011110001011mmmmx"0132010100011y011101mmmmA1000014576x11y101010z110011111100zA=x"y+yzyzBy课后答案网x00011110mmmmx0132011y"mmmm4576www.hackshp.cnx111y"BzxzyB=x"y"+y"z+xyz"z"Cyzyx00011110mmmm0132011xmmmmC4576zx111zC=x"z+xz"4.6xyzFAyzy0000x000111100010mmmmx0132010001z0111ymmmmzF100045761011x1111xy11011111zF=xz+yz+xyDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.57moduleProb_4_6(outputF,inputx,y,z);assignF=(x&z)|(y&z)|(x&y);endmodule4.7(a)ABCDwxyzCDCCDC00000000AB000111100001111000010001mmmmmmmm0132013200110010000000100011mmmmmmmm0110010045764576010111110111010101010110mmmmBmmmmB12131514121315140100011111111111AmmmmAmmmm11001000891110891110101111101111110110011111101011101011DD10101100x=AB"+A"B=AB10111101w=A10011110课后答案网10001111CDCCDCABAB0001111000011110mmmmmmmm01320132www.hackshp.cn00110011mmmmmmmm4576457601110111mmmmBmmmmB121315141213151411111111AmmmmAmmmm89111089111010111011DDy=A"B"CA"BC"+ABC+AB"C"z=ABCD=A"(AB)+A(BC)"=yD=ABC=XCAwxByCzD(b)moduleProb_4_7(outputw,x,y,z,inputA,B,C,D);always@(A,B,C,D)case({A,B,C,D})4"b0000:{w,x,y,z}=4"b0000;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.584"b0001:{w,x,y,z}=4"b1111;4"b0010:{w,x,y,z}=4"b1110;4"b0011:{w,x,y,z}=4"b1101;4"b0100:{w,x,y,z}=4"b1100;4"b0101:{w,x,y,z}=4"b1011;4"b0110:{w,x,y,z}=4"b1010;4"b0111:{w,x,y,z}=4"b1001;4"b1000:{w,x,y,z}=4"b1000;4"b1001:{w,x,y,z}=4"b0111;4"b1010:{w,x,y,z}=4"b0110;4"b1011:{w,x,y,z}=4"b0101;4"b1100:{w,x,y,z}=4"b0100;4"b1101:{w,x,y,z}=4"b0011;4"b1110:{w,x,y,z}=4"b0010;4"b1111:{w,x,y,z}=4"b0001;endcaseendmoduleAlternativemodel:moduleProb_4_7(outputw,x,y,z,inputA,B,C,D);assignw=A;assignx=A^B);assigny=x^C;assignz=y^D;课后答案网endmodule4.8ABCDwxyzCDCCDC00000000www.hackshp.cnAB000111100001111000010001mmmmmmmm013201320011001000xxx00xxx00100011mmmmmmmm0110010045764576010110111010101010110mmmmBmmmmB12131514121315140100011111xx1x11xxxAmmmmAmmmm1100100089111089111010110111110110011111101011101011DD1010110010111101CDC10011110AB1000111100011110mmmm013200xxxw=AB+AC"D"x=B"C+B"D+BC"D"mmmm4576y=CD"+C"D0111z=DmmmmB1213151411xxxAmmmm8911101011DDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.59Alternativemodel:moduleProb_4_8(outputw,x,y,z,inputA,B,C,D);assignw=(A&B)|(A&(~C))&(~D);assignx=((~B)&C)|((~B)&D)|(B&(~C))&(~D);assigny=C^D;assignz=D;endmodule4.9CDCCDCABCDabcdefgABAB0001111000011110mmmmmmmm0000111111001320132000101100000011100111100101101101mmmmmmmm457645760011111100101111011101000110011mmmmBmmmmB01011011011121315141213151401101011111111101111110000AmmmmAmmmm891110891110100011111111011101110011111011DD课后答案网a=A"C+A"BD+B"C"D"+AB"C"b=A"B"+A"C"D"+A"CD+AB"C"CDCCDCABAB0001111000011110mmmmmmmm01320132www.hackshp.cn0011100111mmmmmmmm457645760111110111mmmmBmmmmB12131514121315141111AmmmmAmmmm89111089111010111011DDc=A"B+A"D+B"C"D"+AB"C"d=A"CD"+A"B"C+B"C"D"+AB"C"+A"BC"DCDCCDCCDCABABAB000111100001111000011110mmmmmmmmmmmm01320132013200110010011mmmmmmmmmmmm4576457645760110111101111mmmmBmmmmBmmmmB121315141213151412131514111111AmmmmAmmmmAmmmm89111089111089111010110111011DDDe=A"CD"+B"C"D"f=A"BC"+A"C"D"+A"BD+AB"C"g=A"CD"+A"B"C+A"BC"+AB"C"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.604.10ABCDwxyzCDCCDC00000000AB000111100001111000011111mmmmmmmm0132013200101110001110011100111101mmmmmmmm01001100457645760111110110101101101101001mmmmBmmmmB12131514121315140111100011111AmmmmAmmmm1000100089111089111010110111100101111010011010110101DD11000100w=A"(B+C+D)+AB"C"D"x=B"(C+D)+CB"D"11010011=A(B+C+D)=B(C+D)1110001011110001CDCCDCABAB0001111000011110mmmmmmmm01320132课后答案网00110011mmmmmmmm4576457601110111mmmmBmmmmB1213151412131514www.hackshp.cn11111111AmmmmAmmmm89111089111010111011DDz=Dy=CD"+C"D=CDFora5-bit2"scomplementerwithinputEandoutputv:v=E(A+B+C+D)4.11(a)AAAA32101xyxyxyxyHalfAdderHalfAdderHalfAdderHalfAdderCSCSCSCSNote:5-bitoutputDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.61(b)A111AAA13210xyxyxyxyFullAdderFullAdderFullAdderHalfAdderBDBDBDBDNote:Todecrementthe4-bitnumber,add-1tothenumber.In2"scomplementformat(addF)tohthenumber.Anattempttodecrement0willasserttheborrowbit.Forwaveforms,seesolutiontoProblem4.52.4.12(a)xyBD0000D=x"y+xy"0111B=x"y课后答案网10011100(b)xyBBDin00000www.hackshp.cnDiff=xyz00111B=x"y+x"z+yz11out01001110100011010011000111114.13SumCV(a)110101(b)000111(c)010010(d)101101(e)1111004.14xorANDORXOR10+5+5+10=30nsDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.624.15C4=G3+P3C3=G3+P3(G2+P2G1+P2P1G0+P2P1P0C0)=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C04.16(a)(C"G"i+p"i)"=(Ci+Gi)Pi=GiPi+PiCi=AiBi(Ai+Bi)+PiCi=AiBi+PiCi=Gi+PiCi=AiBi+(Ai+Bi)Ci=AiBi+AiCi+BiCi=Ci+1(PiG"i)§Ci=(Ai+Bi)(AiBi)"§Ci=(Ai+Bi)(A"i+B"i)§Ci=(A"iBi+AiB"i)§Ci=Ai§Bi§Ci=Si(b)OutputofNORgate=(A0+B0)"=P"0OutputofNANDgate=(A0B0)"=G"0S1=(P0G"0)§C0C1=(C"0G"0+P"0)"asdefinedinpart(a)4.17(a)(C"iG"i+P"i)"=(Ci+Gi)Pi=GiPi+PiCi=AiBi(Ai+Bi)+PiCi课后答案网=AiBi+PiCi=Gi+PiCi=AiBi+(Ai+Bi)Ci=AiBi+AiCi+BiCi=Ci+1(PiG"i)§Ci=(Ai+Bi)(AiBi)"§Ci=(Ai+Bi)(A"i+B"i)§Ciwww.hackshp.cn=(A"iBi+AiB"i)§Ci=Ai§Bi§Ci=Si(b)OutputofNORgate=(A0+B0)"=P"0OutputofNANDgate=(A0B0)"=G"0S0=(P0G"0)§C0C1=(C"0G"0+P"0)"asdefinedinpart(a)4.18InputsOutputsABCDwxyz00001001d(A,b,c,d)=S(10,11,12,13,14,15)000110000010011100110110010001010101010001100011011100101000000110010000DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.63CDCCDCABAB0001111000011110mmmmmmmm0132013200110011mmmmmmmm45764576010111mmmmBmmmmB121315141213151411xxxx11xxxxAmmmmAmmmm89111089111010xx10xxDDw=A"B"C"x=BC"+B"C=BCCDCCDCAB0001111000011110mmmmmmmm0132013200110011mmmmmmmm45764576011101111mmmmBmmmmB121315141213151411xxxx11xxxxmmmmAmmmm课后答案网89111089111010xx101xxDDwww.hackshp.cny=Cz=D"4.19Mode=0FORAddBBBBMode=1forSubtract32109"sComplementer(SeeProblem4.18)SelectSelect=1Select=0AAAA3210Quadruple2x1MUXCinBCDAdder(SeeFig.4.14)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.644.20Combinethefollowingcircuitwiththe4-bitbinarymultipliercircuitofFig.4.16.CCCCCCCA65432103BBBB3210Cout4-bitAdderAugendDDDDDDDD765432104.21A0B0A1B1xA2B2课后答案网A3B3x=(AB)"(AB)"(AB)"(AB)"001122334.22www.hackshp.cnXS-3BinaryABCDwxyz00110000010000010101001001100011011101001000010110010110101001111011100011001001DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.65CDCCDCABAB0001111000011110mmmxmmmm013013200xx00XXXmmmmmmmm4576457601011mmmmBmmmmB1213151412131514111xxx11xxxAmmmmAmmmm89111089111010110111DDw=AB+ACDx=B"C"+B"D"+BCDy=C"D+CD"z=D"4.23A1A0D0=(A1+A0+E")"=A"1A"0ED=(A+A"+E")"=A"AE11010D=(A"+A+E")=AA"E课后答案网21010D=(A"+A"+E")"=AAE31010E4.24www.hackshp.cnCDCAB00011110mmmx01300DDDD0132Inputs:A,B,C,DmmmmOutputs:D0,D1,...D94576D0=A"B"C"D"D5=BC"D01D4D5D7D6D=A"B"C"DD=BCD"B16mmmmD=B"CD"D=BCD121315142711xxxxD=B"CDD=AD"38D=BC"D"D=ADAmmm4989m101110DDxx89DDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.664.25A803x8AD-D1Decoder07A2E83x8D-DDecoder8150EA20312x4Decoder2813x8A2D-D4Decoder16233E83x8D-DDecoder2431课后答案网E4.26A20402x4D-Dwww.hackshp.cn1Decoder03A21E2042x4D-D21Decoder470EA20212x4Decoder220412x4A2D-D31Decoder81132E2042x4D-D1Decoder12152EDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.674.270F=S(2,4,7)1122A23x813B2DecoderF=S(0,3)042C256F=S(0,2,3,4,7)73(F"=S(1,5,6))34.28(a)F1=x(y+y")z=x"y"z"=S(0,5,7)F2=xy"z"+x"y+x"y(z+z")=S(2,3,4)F3=x"y"z+xy(z+z")=S(1,6,7)0F11课后答案网x2223x813y2DecoderF042z25www.hackshp.cn6F73(b)yzyyzyxx0001111000011110mmmmmmmm0132013201011mmmmmmmm45764576x111x1111zzF=y"z+xz=S(1,5,7)F=y"z"+xy"+yz"=S(0,2,4,5,6)120yFyz11x0001111022m0m1m3m2x23x801113y2Decoder4F2mmmm04576z2x11567F3zF=x"z+yz=S(1,3,7)3DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.684.29InputsOutputsDDD110DDDDXYZ3210DD0001111032mmmm01320000xx000xxxx1001mmmmxx100114576011x100101D1000111mmmm212131514111D3mmmm891110101D0v=D+D+D+D0123DDD110DD0001111032mmmm0132D0x00x1D1mmmm4576011yDmmmm2D121315142课后答案网11D0D1D3mmmmz891110D21011Dwww.hackshp.cn3D0y=D"D+D"D"01024.30InputsOutputsDDDDDDDDxyzV012345670000000xxx00100000000010x10000000110xx1000001010xxx100001110xxxx10010010xxxxx1010110xxxxxx110010xxxxxxx11111IfD=1,D=1,allothers=026Outputxyz=100andV=1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.694.31s0s0s1s1s2s2s300118x122MUX3344556677s2x1y0MUX1s0s1s280918x1102MUX113124135146课后答案网1574.32(a)F=S(0,2,5,7,11,14)InputsFwww.hackshp.cnABCD00001F=D"0001000101AsF=D000110Bs101000CsF=D201011001100F=DD1F0111128x1YMUX100003F=01001041010005F=010110611000F=D71101111101F=D"11110DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.70(b)F=P(3,8,12)=(A"+B"+C+D)(A+B"+C"+D")(A+B+C"+D")F"=ABC"D"+A"BCD+A"B"CD=S(12,7,3)F=S(0,1,2,4,5,6,8,9,10,11,13,14,15)InputsFABCD00001F=10001100101AsF=D"000110Bs101001CsF=12010111001101F=D"1F01110D28x1YMUX100013F=1100114101015F=110111611000F=D71101111101F=1111114.33x0S(x,y,z)=S(1,2,4,7)课后答案网1C(x,y,z)=S(3,5,6,7)2S3DualSIwww.hackshp.cn0I1I2I3CI0I1I2I34x1YMUXx"0123x"012300Cx4567x45671xx"x"x0x"x"1213yz4.34(a)ABCDFCDCAB0001111001101mmmmI=1013230111100110101I5=110111m4m5m7m6011100000I=D000011mmmmB1213151410000111I=D410011Ammmm11001891110I6=D"1011111010DOtherminterms=0sinceI=I=I=0F(A,B,C,D)=S(1,6,7,9,10,11,12)127(b)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.71ABCDFCDCAB00011110I=000100m0m1m3m2100110001101000I=0mmmm2457601010011101101I3=1B01111m12m13m15m141110111111I=1711111Ammmm89111010000I=D10141001100001I0=D"00010D11001I=D"611010F(A,B,C,D)=S(0,1,6,7,9,13,14,15)Otherminterms=0sinceI=I=0124.35(a)InputsFABCD0000000011AB=00课后答案网00100F=DAs000111sB101001AB=010101004x1F=C"D"01100CMUX=(C+D)"1www.hackshp.cn01110DYF21000010010AB=10310100F=CD10111111001AB=1111011F=11110111111(b)InputsFABCDA0000000011AB=00B00101F=C"D+CD"s000110s101001AB=010101004x1F=C"D"+CD01100CMUX101111DYF21000110011AB=10310101F=111011111000AB=1111011F=D1110011111DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.724.36modulepriority_encoder_gates(outputx,y,V,inputD0,D1,D2,D3);//V2001wirew1,D2_not;not(D2_not,D2);or(x,D2,D3);or(V,D0,D1,x);and(w1,D2_not,D1);or(y,D3,w1);endmoduleNote:SeeProblem4.45fortestbench)4.37moduleAdd_Sub_4_bit(output[3:0]S,outputC,input[3:0]A,B,inputM);wire[3:0]B_xor_M;wireC1,C2,C3,C4;assignC=C4;//outputcarryxor(B_xor_M[0],B[0],M);xor(B_xor_M[1],B[1],M);xor(B_xor_M[2],B[2],M);课后答案网xor(B_xor_M[3],B[3],M);//Instantiatefulladdersfull_adderFA0(S[0],C1,A[0],B_xor_M[0],M);full_adderFA1(S[1],C2,A[1],B_xor_M[1],C1);full_adderFA2(S[2],C3,A[2],B_xor_M[2],C2);www.hackshp.cnfull_adderFA3(S[3],C4,A[3],B_xor_M[3],C3);endmodulemodulefull_adder(outputS,C,inputx,y,z);//SeeHDLExample4.2wireS1,C1,C2;//instantiatehalfaddershalf_adderHA1(S1,C1,x,y);half_adderHA2(S,C2,S1,z);orG1(C,C2,C1);endmodulemodulehalf_adder(outputS,C,inputx,y);//SeeHDLExample4.2xor(S,x,y);and(C,x,y);endmodulemodulet_Add_Sub_4_bit();wire[3:0]S;wireC;reg[3:0]A,B;regM;Add_Sub_4_bitM0(S,C,A,B,M);initial#100$finish;initialfork#10M=0;#10A=4"hA;#10B=4"h5;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.73#50M=1;#70B=4"h3;joinendmodule050100NameA[3:0]xaB[3:0]x53MS[3:0]xf57C4.38modulequad_2x1_mux(//V2001input[3:0]A,B,//4-bitdatachannelsinputenable_bar,select,//enable_barisactive-low)output[3:0]Y//4-bitmuxoutput);//assignY=enable_bar?0:(select?B:A);//GroundsoutputassignY=enable_bar?4"bzzzz:(select?B:A);//Three-stateoutputendmodule课后答案网//Notethatthismuxgroundstheoutputwhenthemuxisnotactive.modulet_quad_2x1_mux();reg[3:0]A,B,C;//4-bitdatachannelsregwww.hackshp.cnenable_bar,select;//enable_barisactive-low)wire[3:0]Y;//4-bitmuxquad_2x1_muxM0(A,B,enable_bar,select,Y);initial#200$finish;initialforkenable_bar=1;select=1;A=4"hA;B=4"h5;#10select=0;//channelA#20enable_bar=0;#30A=4"h0;#40A=4"hF;#50enable_bar=1;#60select=1;//channelB#70enable_bar=0;#80B=4"h00;#90B=4"hA;#100B=4"hF;#110enable_bar=1;#120select=0;#130select=1;#140enable_bar=1;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.74Name070140A[3:0]a0fB[3:0]50afenable_barselectY[3:0]0a0f050af0Withthree-stateoutput:070140NameA[3:0]a0fB[3:0]50afenable_barselectY[3:0]za0fz50afz4.39//Verilog1995moduleCompare课后答案网(A,B,Y);input[3:0]A,B;//4-bitdatainputs.output[5:0]Y;//6-bitcomparatoroutput.reg[5:0]Y;//EQ,NE,GT,LT,GE,LEalways@(Awww.hackshp.cnorB)if(A==B)Y=6"b10_0011;//EQ,GE,LEelseif(A>>3;//endmodulemoduleshift_right_by_3_V1995(outputreg[31:0]sig_out,input[31:0]sig_in);always@(sig_in)sig_out={sig_in[31],sig_in[31],sig_in[31],sig_in[31:3]};endmodule课后答案网modulet_shift_right_by_3();wire[31:0]sig_out_V1995;wire[31:0]sig_out_V2001;www.hackshp.cnreg[31:0]sig_in;//shift_right_by_3_V2001M0(sig_out_V2001,sig_in);shift_right_by_3_V1995M1(sig_out_V1995,sig_in);integerk;initial#1000$finish;initialbeginsig_in=32"hf000_0000;#100sig_in=32"h8fff_ffff;#500sig_in=32"h0fff_ffff;endendmodule609619629639Namesig_in[31:0]00001111111111111111111111111111sig_out_V1995[31:0]0000000111111111111111111111111134445464Namesig_in[31:0]11110000000000000000000000000000sig_out_V1995[31:0]11111110000000000000000000000000DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.934.59//moduleshift_left_by_3_V2001(output[31:0]sig_out,input[31:0]sig_in);//assignsig_out=sig_in<<<3;//endmodulemoduleshift_left_by_3_V1995(outputreg[31:0]sig_out,input[31:0]sig_in);always@(sig_in)sig_out={sig_in[28:0],3"b0};endmodulemodulet_shift_left_by_3();wire[31:0]sig_out_V1995;//wire[31:0]sig_out_V2001;reg[31:0]sig_in;//shift_left_by_3_V2001M0(sig_out_V2001,sig_in);shift_left_by_3_V1995M1(sig_out_V1995,sig_in);integerk;initial#500$finish;initialbegin#100sig_in=32"h0000_000f;endendmodule课后答案网050100150Namewww.hackshp.cnsig_in[31:0]xxxxxxxx0000000fsig_out_V1995[31:0]xxxxxxxx000000784.60moduleBCD_to_Decimal(outputreg[3:0]Decimal_out,input[3:0]BCD_in);always@(BCD_in)beginDecimal_out=0;case(BCD_in)4"b0000:Decimal_out=0;4"b0001:Decimal_out=1;4"b0010:Decimal_out=2;4"b0011:Decimal_out=3;4"b0100:Decimal_out=4;4"b0101:Decimal_out=5;4"b0110:Decimal_out=6;4"b0111:Decimal_out=7;4"b1000:Decimal_out=8;4"b1001:Decimal_out=9;default:Decimal_out=4"bxxxx;endcaseendendmodule4.61moduleEven_Parity_Checker_4(outputP,C,inputx,y,z);xor(w1,x,y);xor(P,w1,z);xor(C,w1,w2);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.94xor(w2,z,P);endmoduleSeeProblem4.62fortestbenchandwaveforms.4.62moduleEven_Parity_Checker_4(outputP,C,inputx,y,z);assignw1=x^y;assignP=w1^z;assignC=w1^w2;assignw2=z^P;endmodule0140280420NamexyzPCCHAPTER5课后答案网5.1(a)R=D"Cwww.hackshp.cnDQCPCQ"S=DC(b)R=(D+C")"=D"CDQCQ"s=(D"+C")"=DC(c)S=(DC)"=D"+C"DQCPCQ"R=((DC)"C)"=DC+C"=(D+C")=(D"C)"DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.955.22x1D=JQ"+K"QmuxJ0QYDQK1sC5.3Q"(t+1)=(JQ"+K"Q)"=(J"+Q)(K+Q")=J"Q"+KQKQKJ00011110mmmm013200100mmmm4576J11101Q5.4(a)PNQ(t+1)(b)PNQ(t)Q(t+1)0000000课后答案网01Q(t)001010Q"(t)0100111011110011010www.hackshp.cn11011111NQNP00011110mmmm013201mmmm4576P1111QQ(t+1)=PQ"+NQ(c)Q(t)Q(t+1)PN(d)ConnectPandNtogether.000x011x10x011x15.5Thetruthtabledescribesacombinationalcircuit.Thestatetabledescribesasequentialcircuit.Thecharacteristictabledescribestheoperationofaflip-flop.Theexcitationtablegivesthevaluesofflip-flopinputsforagivenstatetransition.Thefourequationscorrespondtothealgebraicexpressionofthefourtables.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.965.6(a)xxy"+xAAyDQCBzDQCP(b)(c)00/010/000/1PresentstateInputsNextstateOutput11/010/1ABxyABz000000011/1000110000010010000001100001000110101111011000101110011000000100110001/000/000/101/11010110101111011课后答案网00011110111111101111111111101110/0www.hackshp.cn01/111/010/101/011/15.700/001/001/010/0PresentstateInputsNextstateOutput10/111/011/1QxyQS000000010101010010111000/110001101101101011111S=x§y§QQ(t+1)=xy+xQ+yQDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.975.8Acounterwitharepeatedsequenceof00,01,10.FF0001PresentstateNextstateInputsABABTTAB000001011011100010110011T=A+BAT=A"+BBRepeatedsequence:11100001105.90000010A(t+1)=JA"+K"A=xA"+BAAB(t+1)=JB"+K"B=xB"+A"BBB课后答案网111www.hackshp.cn0,11110DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.985.10(a)JA=Bx+B"y"JB=A"xKA=B"xy"KB=A+xy"z=Axy+Bx"y"(b)(c)xyxFFABOutputs00011110PresentstateInputsNextstateOutputJKJJmmmm0132ABxyABzAAAB001100001001000mmmm00010000000457600101101111011100110100010Bmmmm12131514010001100001111110101010000001101001010Ammmm8911100111110101010111100010010011001100000110100001101y1011100000111001010001A(t+1)=Ax"+Bx+Ay+A"B"y"1101100000111101001001xyx11111011001AB00011110mmmm0132课后答案网0011mmmm4576A01111mmmmB12131514www.hackshp.cn11mmmm89111010yB(t+1)=A"B"x+A"B"(x"+y)5.11Presentstate:000001000111000111100001111010Input:010110111011110Output:001001000100001Nextstate:0001000111000111100001111010005.12NextPresentstateOutputstate0101afb00bda00dga10ffb11ggd01DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.995.13(a)State:afbcedghgghaInput:01110010011Output:01000111010(b)State:afbabdgdggdaInput:01110010011Output:010001110105.14PresentNextstatestateOutputABCx=0x=1x=1x=0a00000000100b00101101000c01100001000d01011001001e110000010015.15DQ=QÅJ+QKÅPresentNextInputsstate课后答案网stateJKJQJKQQ00011110mmmm01320000Nochange0110010Resetto0www.hackshp.cnmmmm0101Setto14576Q1110111Complement1001Nochange1010Resetto0K1101Setto11110ComplementQ(t+1)=DQ+Q"J+QK"JDQQKclkQ"Q"5.16(a)DA=AxÅ+BxDB=AÅx+BxÅDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.100BxBPresentNextInputAstatestate00011110mmmmABxAB01320100000mmmm457600101A11110100101111x10010D=Ax"+Bx10100A11011BxB11110A00011110mmmm01320111mmmm4576A11xD=A"x+Bx"B(b)DA=A"x+Ax"课后答案网DB=AB+Bx"BxBPresentNextInputAstatestate00011110mmmmABxAB0132www.hackshp.cn01100000mmmm457600111A1110100101110x10010D=A"x+Ax"10100A11011BxB11101A00011110mmmm0132011mmmm4576A111xD=AB+Bx"B5.17Theoutputis0forall0inputsuntilthefirst1occurs,atwhichtimetheoutputis1.Thereafter,theoutputisthecomplementoftheinput.Thestatediagramhastwostates.Instate0:output=input;instate1:output=input".DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.101DQxyclkreset_b0/1PresentstateInputNextstateOutput0/0reset_b1/0AxAy0000010111101111101/1D=A+xAy=Ax"+A"x5.18Binaryup-downcounterwithenableE.PresentNextInputFlip-flopinputsstatestate课后答案网ABxABJAKAJBKB0001000x0x0001000x0x0010111x1x0011010x1xwww.hackshp.cn0100010xx00101010xx00110010xx10111101xx1100010x010100110x010101001x1x1101111x0x1110011x0x0110111x0x011101110x1111111x1x1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.102ExECxCABAB0001111000011110mmmm0132mmmm013200100xxxxm4m5m7m6mmmm457601101xxxmmmmBmmmmB121315141213151411xxxx111AmmmmAmmmm89111089111010xxxx101xxJ=(Bx+B"x")EK=(Bx+B"x")EAAExEExEABAB0001111000011110mmmmmmmm01320132001100xxxxmmmmmmmm4576457601xxxx0111mmmmEmmmmE1213151412131514课后答案网11xxxx1111AmmmmAmmmm891110891110www.hackshp.cn101110xxxxxxJ=EK=EBB5.19(a)Unusedstates(seeFig.P5.19):101,110,111.PresentNextInputOutputstatestateABCxABCy00000110000110010010001000111001010001000101000101100010011101011000010010010111d(A,B,C,x)=S(10,11,12,13,14,15)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.103CxCCxCABAB0001111000011110mmmm0132mmmm01320011001m4m5m7m6mmmm4576010111mmmmBmmmmB121315141213151411xxxx11xxxxAmmmmAmmmm89111089111010xx1011xxxxD=A"B"xDB=A+C"x"+BCxACxCCxCABAB0001111000011110mmmmmmmm0132013200110011mmmmmmmm457645760110111mmmmBmmmmB1213151412131514课后答案网11xxxx11xxxxAmmmmAmmmm891110891110www.hackshp.cn101xx10xxxxD=Cx"+Ax+A"B"x"y=A"xCThemachineisself-correcting,i.e.,theunusedstatestransitiontoknownstates.1111011100/00/00/01/01/01/0011010DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.104(b)WithJKflip=flops,thestatetableisthesameasin(a).Flip-flopinputsJKJKJKAABBCC0x1x1xJ=B"xK=11x0x0xAAJ=A+C"x"K=C"x+Cx"0x0xx0BBJ=Ax+A"B"x"K=x1x0xx1CCy=A"x0xx00xThemachineisself-correcting0xx10xbecauseK=1.0xx1x0A0xx0x1x11x0xx11x1x5.20Fromstatetable5.4:课后答案网TA(A,B,x)=S(2,3,6),TB(A,B,x)=S(0,3,4,6).BxBBxBAA0001111000011110m0m1m3m2m0m1m3m2www.hackshp.cn011011m4m5m7m6m4m5m7m6A11A111xxT=A"B+Bx"T=B"x"+A"x+A"BxAB5.21Thestatementsassociatedwithaninitialkeywordexecuteonce,insequence,withtheactivityexpiringafterthelaststatmentcompetesexecution;thestatementsassocatedwiththealwayskeywordexecuterepeatedly,subjecttotimingcontrol(e.g,#10).5.22(a)(b)t0204060801001201401605.23(a)RegA=125,RegB=125(b)RegA=125,RegB=30DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1055.24(a)moduleDFF(outputregQ,inputD,clk,preset,clear);always@(posedgeclk,negedgepreset,negedgeclear)if(preset==0)Q<=1"b1;elseif(clear==0)Q<=1"b0;elseQ<=D;endmodulemodulet_DFF();wireQ;regclk,preset,clear;regD;DFFM0(Q,D,clk,preset,clear);initial#160$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#10preset=0;#20preset=1;#50clear=0;#80clear=1;#10D=1;#100D=0;#200D=1;join课后答案网endmodulewww.hackshp.cnName060120clkpresetclearDQ(b)moduleDFF(outputregQ,inputD,clk,preset,clear);always@(posedgeclk)if(preset==0)Q<=1"b1;elseif(clear==0)Q<=1"b0;elseQ<=D;endmodule060120NameclkpresetclearDQDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1065.25moduleDual_Input_DFF(outputregQ,inputD1,D2,select,clk,reset_b);always@(posedgeclk,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=select?D2:D1;endmodulemodulet_Dual_Input_DFF();wireQ;regD1,D2,select,clk,reset_b;Dual_Input_DFFM0(Q,D1,D2,select,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialforkselect=0;#30select=1;#60select=0;joininitialfork#2reset_b=1;#3reset_b=0;#4reset_b=1;D1=0;D2=1;joinendmodule课后答案网0306090Nameclkwww.hackshp.cnreset_bselectD1D2Q5.26(a)Q(t+1)=JQÅ+KÅQWhenQ=0,Q(t+1)=JWhenQ=1,Q(t+1)=KÅmoduleJK_Behavior_a(outputregQ,inputJ,K,CLK,reset_b);always@(posedgeCLK,negedgereset_b)if(reset_b==0)Q<=0;elseif(Q==0)Q<=J;elseQ<=~K;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.107(b)moduleJK_Behavior_b(outputregQ,inputJ,K,CLK,reset_b);always@(posedgeCLK,negedgereset_b)if(reset_b==0)Q<=0;elsecase({J,K})2"b00:Q<=Q;2"b01:Q<=0;2"b10:Q<=1;2"b11:Q<=~Q;endcaseendmodulemodulet_Prob_5_26();wireQ_a,Q_b;regJ,K,clk,reset_b;JK_Behavior_aM0(Q_a,J,K,clk,reset_b);JK_Behavior_bM1(Q_b,J,K,clk,reset_b);initial#100$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;J=0;K=0;课后答案网#20beginJ=1;K=0;end#30beginJ=1;K=1;end#40beginJ=0;K=1;end#50beginJ=1;K=1;endjoinwww.hackshp.cnendmodule04080Nameclkreset_bJKQ_aQ_b5.27//MealyFSMzerodetector(SeeFig.5.16)moduleMealy_Zero_Detector(outputregy_out,inputx_in,clock,reset);reg[1:0]state,next_state;parameterS0=2"b00,S1=2"b01,S2=2"b10,S3=2"b11;always@(posedgeclock,negedgereset)//statetransitionif(reset==0)state<=S0;elsestate<=next_state;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.108always@(state,x_in)//Formthenextstatecase(state)S0:beginy_out=0;if(x_in)next_state=S1;elsenext_state=S0;endS1:beginy_out=~x_in;if(x_in)next_state=S3;elsenext_state=S0;endS2:beginy_out=~x_in;if(~x_in)next_state=S0;elsenext_state=S2;endS3:beginy_out=~x_in;if(x_in)next_state=S2;elsenext_state=S0;endendcaseendmodulemodulet_Mealy_Zero_Detector;wiret_y_out;regt_x_in,t_clock,t_reset;Mealy_Zero_DetectorM0(t_y_out,t_x_in,t_clock,t_reset);initial#200$finish;initialbegint_clock=0;forever#5t_clock=~t_clock;endinitialforkt_reset=0;#2t_reset=1;#87t_reset=0;#89t_reset=1;#10t_x_in=1;课后答案网#30t_x_in=0;#40t_x_in=1;#50t_x_in=0;#52t_x_in=1;#54t_x_in=0;www.hackshp.cn#70t_x_in=1;#80t_x_in=1;#70t_x_in=0;#90t_x_in=1;#100t_x_in=0;#120t_x_in=1;#160t_x_in=0;#170t_x_in=1;joinendmoduleNote:SimulationresultsmatchFig.5.22.Name64686126166t_clockt_resetstate[1:0]01301001013201t_x_int_y_outDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1095.28(a)moduleProb_5_28a(outputA,inputx,y,clk,reset_b);parameters0=0,s1=1;regstate,next_state;assignA=state;always@(posedgeclk,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;always@(state,x,y)beginnext_state=s0;case(state)s0:case({x,y})2"b00,2"b11:next_state=s0;2"b01,2"b10:next_state=s1;endcases1:case({x,y})2"b00,2"b11:next_state=s1;2"b01,2"b10:next_state=s0;endcaseendcaseendendmodulemodulet_Prob_5_28a();wireA;regx,y,clk,reset_b;Prob_5_28aM0(A,x,y,clk,reset_b);课后答案网initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;www.hackshp.cn//Initializetos0#4reset_b=1;x=0;y=0;#20beginx=1;y=1;end#30beginx=0;y=0;end#40beginx=1;y=0;end#50beginx=0;y=0;end#60beginx=1;y=1;end#70beginx=1;y=0;end#80beginx=0;y=1;endjoinendmodule080160Nameclkreset_bxyADigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.110(b)moduleProb_5_28b(outputA,inputx,y,Clock,reset_b);xor(w1,x,y);xor(w2,w1,A);DFFM0(A,w2,Clock,reset_b);endmodulemoduleDFF(outputregQ,inputD,Clock,reset_b);always@(posedgeClock,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=D;endmodulemodulet_Prob_5_28b();wireA;regx,y,clk,reset_b;Prob_5_28bM0(A,x,y,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;x=0;y=0;#20beginx=1;y=1;end#30begin课后答案网x=0;y=0;end#40beginx=1;y=0;end#50beginx=0;y=0;end#60beginx=1;y=1;end#70beginx=1;y=0;end#80beginwww.hackshp.cnx=0;y=1;endjoinendmoduleName060120180Clockreset_bxyADigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.111(c)Seeresultsof(b)and(c).modulet_Prob_5_28c();wireA_a,A_b;regx,y,clk,reset_b;Prob_5_28aM0(A_a,x,y,clk,reset_b);Prob_5_28bM1(A_b,x,y,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;x=0;y=0;#20beginx=1;y=1;end#30beginx=0;y=0;end#40beginx=1;y=0;end#50beginx=0;y=0;end#60beginx=1;y=1;end#70beginx=1;y=0;end#80beginx=0;y=1;endjoinendmoduleName课后答案网060120180clkreset_bwww.hackshp.cnxyA_aA_b5.29moduleProb_5_29(outputregy_out,inputx_in,clock,reset_b);parameters0=3"b000,s1=3"b001,s2=3"b010,s3=3"b011,s4=3"b100;reg[2:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;always@(state,x_in)beginy_out=0;next_state=s0;case(state)s0:if(x_in)beginnext_state=s4;y_out=1;endelsebeginnext_state=s3;y_out=0;ends1:if(x_in)beginnext_state=s4;y_out=1;endelsebeginnext_state=s1;y_out=0;ends2:if(x_in)beginnext_state=s0;y_out=1;endelsebeginnext_state=s2;y_out=0;ends3:if(x_in)beginnext_state=s2;y_out=1;endelsebeginnext_state=s1;y_out=0;ends4:if(x_in)beginnext_state=s3;y_out=0;endelsebeginnext_state=s2;y_out=0;enddefault:next_state=3"bxxx;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.112modulet_Prob_5_29();wirey_out;regx_in,clk,reset_b;Prob_5_29M0(y_out,x_in,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;//Tracethestatediagramandmonitory_outx_in=0;//Drivefroms0tos3toS1andpark#40x_in=1;//Drivetos4tos3tos2tos0tos4andloop#90x_in=0;//Drivefroms0tos3tos2andpart#110x_in=1;//Drives0tos4etcjoinendmoduleName04080120clkreset_bx_instate[2:0]课后答案网3143204204y_outwww.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1135.30Withnon-blocking(<=)assignmentoperator:ADQEDBCCCCLKWithblocking(=)assignmentoperator:ADQB课后答案网CCwww.hackshp.cnCLKNote:Theexpressionsubstitutionimpliedbythesequentialorderingwiththeblockingassignmentoperatorresults.intheeliminationofEbyasynthesistool.ToretainE,itisnecessarytodeclareEtobeanoutputportofthemodule.5.31moduleSeq_Ckt(inputA,B,C,CLK,outputregQ);regE;always@(posedgeCLK)beginQ=E|C;E=A&B;endendmoduleNote:Thestatementsmustbewritteninanorderthanproducestheeffectofconcurrentassignments.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1145.32initialbeginenable=0;A=0;B=0;C=0;D=1;E=1;F=1;#10B=1;C=1;D=0;#10A=1;B=0;D=1;E=0;#10B=1;课后答案网E=1;F=0;#10enable=1;A=0;B=0;F=0;www.hackshp.cn#10B=1;#10A=1;B=0;#10B=1;endinitialforkenable=0;A=0;B=0;C=0;D=1;E=1;F=1;#40enable=1;#20A=1;#40A=0;#60A=1;#10B=1;#20B=0;#30B=1;#40B=0;#50B=1;#60B=0;#70B=1;#10C=1;#10D=0;#20D=1;#20E=0;#30E=1;#30F=0;#40F=1;joinDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1155.33Signaltransitionsthatarecausedbyinputsignalsthatchangeontheactiveedgeoftheclockracewiththeclockitselftoreachtheaffectedflip-flops,andtheoutcomeisindeterminate(unpredictable).Conversely,changescausedbyinputsthataresynchronizedtotheinactiveedgeoftheclockreachstabilitybeforetheactiveedge,withpredictableoutputsoftheflip-flopsthatareaffectedbytheinputs.5.34moduleJK_flop_Prob_5_34(outputQ,inputJ,K,clk);wireK_bar;D_flopM0(Q,D,clk);MuxM1(D,J,K_bar,Q);InverterM2(K_bar,K);endmodulemoduleD_flop(outputregQ,inputD,clk);always@(posedgeclk)Q<=D;endmodulemoduleInverter(outputy_bar,inputy);assigny_bar=~y;endmodulemoduleMux(outputy,inputa,b,select);assigny=select?a:b;endmodulemodulet_JK_flop_Prob_5_34();wireQ;课后答案网regJ,K,clock;JK_flop_Prob_5_34M0(Q,J,K,clock);initial#500$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkwww.hackshp.cn#10beginJ=0;K=0;end//toggleQunknown#20beginJ=0;K=1;end//setQto0#30beginJ=1;K=0;end//setqto1#40beginJ=1;K=1;end//nochange#60beginJ=0;K=0;end//toggleQjoinendmodule0306090NameclockJKQ5.35initialbeginenable=0;A=0;B=0;C=0;D=1;E=1;F=1;#10beginB=1;C=1;D=0;end#10beginA=1;B=0;D=1;E=0;end#10beginA=1;B=0;E=1;F=0;end#10beginenable=1;A=0;B=0;F=1;end#10beginB=1;end#10beginA=1;B=0;end#10B=1;endDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.116initialforkenable=0;#40enable=1;#20A=1;#40A=0;#60A=1;#10B=1;#20B=0;#30B=1;#40B=0;#50B=1;#60B=0;#70B=1;#10C=1;#10D=0;#20D=1;#20E=0;#30E=1;#30F=0;#40F=1;join课后答案网5.36Note:SeeProblem5.8(counterwithrepeatedsequence:(A,B)=00,01,10,00....//SeeFig.P5.8www.hackshp.cnmoduleProblem_5_36(outputA,B,inputClock,reset_b);or(T_A,A,B);or(T_B,A_b,B);T_flopM0(A,A_b,T_A,Clock,reset_b);T_flopM1(B,B_b,T_B,Clock,reset_b);endmodulemoduleT_flop(outputregQ,outputQB,inputT,Clock,reset_b);assignQB=~Q;always@(posedgeClock,negedgereset_b)if(reset_b==0)Q<=0;elseif(T)Q<=~Q;endmodulemodulet_Problem_5_36();wireA,B;regClock,reset_b;Problem_5_36M0(A,B,Clock,reset_b);initial#350$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialfork#2reset_b=1;#3reset_b=0;#4reset_b=1;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.117Name0306090Clockreset_bAB5.37moduleProblem_5_37_Fig_5_25(outputregy,inputx_in,clock,reset_b);parametera=3"b000,b=3"b001,c=3"b010,d=3"b011,e=3"b100,f=3"b101,g=3"b110;reg[2:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=a;elsestate<=next_state;always@(state,x_in)beginy=0;next_state=a;case(state)a:课后答案网beginy=0;if(x_in==0)next_state=a;elsenext_state=b;endb:beginy=0;if(x_in==0)next_state=c;elsenext_state=d;endc:www.hackshp.cnbeginy=0;if(x_in==0)next_state=a;elsenext_state=d;endd:if(x_in==0)beginy=0;next_state=e;endelsebeginy=1;next_state=f;ende:if(x_in==0)beginy=0;next_state=a;endelsebeginy=1;next_state=f;endf:if(x_in==0)beginy=0;next_state=g;endelsebeginy=1;next_state=f;endg:if(x_in==0)beginy=0;next_state=a;endelsebeginy=1;next_state=f;enddefault:next_state=a;endcaseendendmodulemoduleProblem_5_37_Fig_5_26(outputregy,inputx_in,clock,reset_b);parametera=3"b000,b=3"b001,c=3"b010,d=3"b011,e=3"b100;reg[2:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=a;elsestate<=next_state;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.118always@(state,x_in)beginy=0;next_state=a;case(state)a:beginy=0;if(x_in==0)next_state=a;elsenext_state=b;endb:beginy=0;if(x_in==0)next_state=c;elsenext_state=d;endc:beginy=0;if(x_in==0)next_state=a;elsenext_state=d;endd:if(x_in==0)beginy=0;next_state=e;endelsebeginy=1;next_state=d;ende:if(x_in==0)beginy=0;next_state=a;endelsebeginy=1;next_state=d;enddefault:next_state=a;endcaseendendmodulemodulet_Problem_5_37();wirey_Fig_5_25,y_Fig_5_26;regx_in,clock,reset_b;Problem_5_37_Fig_5_25M0(y_Fig_5_25,x_in,clock,reset_b);Problem_5_37_Fig_5_26M1(y_Fig_5_26,课后答案网x_in,clock,reset_b);wire[2:0]state_25=M0.state;wire[2:0]state_26=M1.state;initial#350www.hackshp.cn$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkx_in=0;#2reset_b=1;#3reset_b=0;#4reset_b=1;#20x_in=1;#40x_in=0;//abdea,abdea#60x_in=1;#100x_in=0;//abdf....fga,abd...dea#120x_in=1;#160x_in=0;#170x_in=1;#200x_in=0;//abdf....fgf...fga,abd...ded...ea#220x_in=1;#240x_in=0;#250x_in=1;//abdef...//abded...joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1190110220Nameclockreset_bx_instate_25[2:0]01341356035560145state_26[2:0]013413403340143y_Fig_5_25y_Fig_5_265.38(a)moduleProb_5_38a(inputx_in,clock,reset_b);parameters0=2"b00,s1=2"b01,s2=2"b10,s3=2"b11;reg[1:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;always@课后答案网(state,x_in)beginnext_state=s0;case(state)s0:if(x_in==0)next_state=s0;www.hackshp.cnelseif(x_in==1)next_state=s3;s1:if(x_in==0)next_state=s1;elseif(x_in==1)next_state=s2;s2:if(x_in==0)next_state=s2;elseif(x_in==1)next_state=s0;s3:if(x_in==0)next_state=s3;elseif(x_in==1)next_state=s1;default:next_state=s0;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.120modulet_Prob_5_38a();regx_in,clk,reset_b;Prob_5_38aM0(x_in,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;#2x_in=0;#20x_in=1;#60x_in=0;#80x_in=1;#90x_in=0;#110x_in=1;#120x_in=0;#140x_in=1;#150x_in=0;#170x_in=1;joinendmodule060120180Name课后答案网clkreset_bwww.hackshp.cnx_instate[1:0]0312031203(b)moduleProb_5_38b(inputx_in,clock,reset_b);parameters0=2"b00,s1=2"b01,s2=2"b10,s3=2"b11;reg[1:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;always@(state,x_in)beginnext_state=s0;case(state)s0:if(x_in==0)next_state=s0;elseif(x_in==1)next_state=s3;s1:if(x_in==0)next_state=s1;elseif(x_in==1)next_state=s2;s2:if(x_in==0)next_state=s2;elseif(x_in==1)next_state=s0;s3:if(x_in==0)next_state=s3;elseif(x_in==1)next_state=s1;default:next_state=s0;endcaseendDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.121endmodulemodulet_Prob_5_38b();regx_in,clk,reset_b;Prob_5_38bM0(x_in,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;#2x_in=0;#20x_in=1;#60x_in=0;#80x_in=1;#90x_in=0;#110x_in=1;#120x_in=0;#140x_in=1;#150x_in=0;#170x_in=1;joinendmodule课后答案网Name060120180clkwww.hackshp.cnreset_bx_instate[1:0]03120312031205.39moduleSerial_2s_Comp(outputregB_out,inputB_in,clk,reset_b);//Seeproblem5.17parameterS_0=1"b0,S_1=1"b1;regstate,next_state;always@(posedgeclk,negedgereset_b)beginif(reset_b==0)state<=S_0;elsestate<=next_state;endalways@(state,B_in)beginB_out=0;case(state)S_0:if(B_in==0)beginnext_state=S_0;B_out=0;endelseif(B_in==1)beginnext_state=S_1;B_out=1;endS_1:beginnext_state=S_1;B_out=~B_in;enddefault:next_state=S_0;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.122modulet_Serial_2s_Comp();wireB_in,B_out;regclk,reset_b;reg[15:0]data;assignB_in=data[0];always@(negedgeclk,negedgereset_b)if(reset_b==0)data<=16"ha5ac;elsedata<=data>>1;//SamplebitstreamSerial_2s_CompM0(B_out,B_in,clk,reset_b);initial#150$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#10reset_b=0;#12reset_b=1;joinendmodule060120Nameclkreset_bB_in课后答案网stateB_outwww.hackshp.cn5.40EF=0xs0101011110xs3s10x11111010s20xmoduleProb_5_40(inputE,F,clock,reset_b);parameters0=2"b00,s1=2"b01,s2=2"b10,s3=2"b11;reg[1:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.123always@(state,E,F)beginnext_state=s0;case(state)s0:if(E==0)next_state=s0;elseif(F==1)next_state=s1;elsenext_state=s3;s1:if(E==0)next_state=s1;elseif(F==1)next_state=s2;elsenext_state=s0;s2:if(E==0)next_state=s2;elseif(F==1)next_state=s3;elsenext_state=s1;s3:if(E==0)next_state=s3;elseif(F==1)next_state=s0;elsenext_state=s2;default:next_state=s0;endcaseendendmodulemodulet_Prob_5_40();regE,F,clk,reset_b;Prob_5_40M0(E,F,clk,reset_b);initial课后答案网#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;//Initializetos0#4reset_b=1;www.hackshp.cn#2E=0;#20beginE=1;F=1;end#60E=0;#80E=1;#90E=0;#110E=1;#120E=0;#140E=1;#150E=0;#170E=1;#170F=0;joinendmodule0100200Nameclkreset_bEFstate[1:0]012301232103215.41DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.124moduleProb_5_41(outputregy_out,inputx_in,clock,reset_b);parameters0=3"b000,s1=3"b001,s2=3"b010,s3=3"b011,s4=3"b100;reg[2:0]state,next_state;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;always@(state,x_in)beginy_out=0;next_state=s0;case(state)s0:if(x_in)beginnext_state=s4;y_out=1;endelsebeginnext_state=s3;y_out=0;ends1:if(x_in)beginnext_state=s4;y_out=1;endelsebeginnext_state=s1;y_out=0;ends2:if(x_in)beginnext_state=s0;y_out=1;endelsebeginnext_state=s2;y_out=0;ends3:if(x_in)beginnext_state=s2;y_out=1;endelsebeginnext_state=s1;y_out=0;ends4:if(x_in)beginnext_state=s3;y_out=0;endelsebeginnext_state=s2;y_out=0;enddefault:next_state=3"bxxx;endcaseendendmodulemodulet_Prob_5_41();wirey_out;regx_in,clk,reset_b;Prob_5_41M0(y_out,x_in,clk,reset_b);课后答案网initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;www.hackshp.cn#3reset_b=0;//Initializetos0#4reset_b=1;//Tracethestatediagramandmonitory_outx_in=0;//Drivefroms0tos3toS1andpark#40x_in=1;//Drivetos4tos3tos2tos0tos4andloop#90x_in=0;//Drivefroms0tos3tos2andpart#110x_in=1;//Drives0tos4etcjoinendmodule04080120Nameclkreset_bx_instate[2:0]3143204204y_outDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1255.42moduleProb_5_42(outputA,B,B_bar,y,inputx,clk,reset_b);//SeeFig.5.29wirew1,w2,w3,D1,D2;and(w1,A,x);and(w2,B,x);or(D_A,w1,w2);and(w3,B_bar,x);and(y,A,B);or(D_B,w1,w3);DFFM0_A(A,D_A,clk,reset_b);DFFM0_B(B,D_B,clk,reset_b);not(B_bar,B);endmodulemoduleDFF(outputregQ,inputdata,clk,reset_b);always@(posedgeclk,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=data;endmodulemodulet_Prob_5_42();wireA,B,B_bar,y;regbit_in,clk,reset_b;wire[1:0]state;assignstate={A,B};wire课后答案网detect=y;Prob_5_42M0(A,B,B_bar,y,bit_in,clk,reset_b);//PatternsfromProblem5.45.www.hackshp.cninitial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;#4reset_b=1;//Tracethestatediagramandmonitordetect(assertinS3)bit_in=0;//ParkinS0#20bit_in=1;//DrivetoS0#30bit_in=0;//DrivetoS1andbacktoS0(2clocks)#50bit_in=1;#70bit_in=0;//DrivetoS2andbacktoS0(3clocks)#80bit_in=1;#130bit_in=0;//DrivetoS3,park,thenandbacktoS0joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.126050100150Namereset_bclkABB_barystate[1:0]x0101201230detect5.43moduleBinary_Counter_3_bit(output[2:0]count,inputclk,reset_b)always@(posedgeclk)if(reset_b==0)count<=0;elsecount<=next_count;always@(count)begincase(state)3"b000:count=3"b001;3"b001:count=3"b010;3"b010:count=3"b011;3"b011:count=3"b100;3"b100:count=3"b001;3"b101:count=3"b010;3"b110:课后答案网count=3"b011;3"b111:count=3"b100;default:count=3"b000;endcaseendwww.hackshp.cnendmodulemodulet_Binary_Counter_3_bit()wire[2:0]count;regclk,reset_b;Binary_Counter_3_bitM0(count,clk,reset_b)initial#150$finish;initialbeginclk=0;forever#5clk=~clk;endinitialforkreset=1;#10reset=0;#12reset=1;endmodule050100150Namereset_bclkcount[2:0]x012345670123456DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.127Alternative:structuralmodel.moduleProb_5_41(outputA2,A1,A0,inputT,clk,reset_bar);wiretoggle_A2;T_flopM0(A0,T,clk,reset_bar);T_flopM1(A1,A0,clk,reset_bar);T_flopM2(A2,toggle_A2,clk,reset_bar);and(toggle_A2,A0,A1);endmodulemoduleT_flop(outputregQ,inputT,clk,reset_bar);always@(posedgeclk,negedgereset_bar)if(!reset_bar)Q<=0;elseif(T)Q<=~Q;elseQ<=Q;endmodulemodulet_Prob_5_41;wireA2,A1,A0;wire[2:0]count={A2,A1,A0};regT,clk,reset_bar;Prob_5_41M0(A2,A1,A0,T,clk,reset_bar);initial#200$finish;initialbeginclk=0;forever#5clk=~clk;endinitialforkreset_bar=0;#2reset_bar=1;#40reset_bar=0;#42reset_bar=1;joininitialforkT=0;#20T=1;#70T=0;#110T=1;joinendmodule课后答案网IftheinputtoA0ischangedto0thecountercountsincorrectly.Itresumesacorrectcountingsequencewhenwww.hackshp.cnTischangedbackto1.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1285.44moduleDFF_synch_reset(outputregQ,inputdata,clk,reset);always@(posedgeclk)if(reset)Q<=0;elseQ<=data;endmodulemodulet_DFF_synch_reset();regdata,clk,reset;wireQ;DFF_synch_resetM0(Q,data,clk,reset);initial#150$finish;initialbeginclk=0;forever#5clk=~clk;endinitialforkreset=1;#20reset=1;#40reset=0;#10data=1;#50data=0;#60data=1;#100data=0;joinendmoduleName0课后答案网50100150resetclkwww.hackshp.cndataQ5.45moduleSeq_Detector_Prob_5_45(outputdetect,inputbit_in,clk,reset_b);parameterS0=0,S1=1,S2=2,S3=3;reg[1:0]state,next_state;assigndetect=(state==S3);always@(posedgeclk,negedgereset_b)if(reset_b==0)state<=S0;elsestate<=next_state;always@(state,bit_in)beginnext_state=S0;case(state)0:if(bit_in)next_state=S1;elsestate=S0;1:if(bit_in)next_state=S2;elsenext_state=S0;2:if(bit_in)next_state=S3;elsestate=S0;3:if(bit_in)next_state=S3;elsenext_state=S0;default:next_state=S0;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.129modulet_Seq_Detector_Prob_5_45();wiredetect;regbit_in,clk,reset_b;Seq_Detector_Prob_5_45M0(detect,bit_in,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork#2reset_b=1;#3reset_b=0;#4reset_b=1;//Tracethestatediagramandmonitordetect(assertinS3)bit_in=0;//ParkinS0#20bit_in=1;//DrivetoS0#30bit_in=0;//DrivetoS1andbacktoS0(2clocks)#50bit_in=1;#70bit_in=0;//DrivetoS2andbacktoS0(3clocks)#80bit_in=1;#130bit_in=0;//DrivetoS3,park,thenandbacktoS0joinendmodule04080120Name课后答案网reset_bclkbit_inwww.hackshp.cnstate[1:0]x0101201230detectDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.130CHAPTER66.1Thestructureshownbelowgatestheclockthroughanandgate.Inpractice,thecircuitcanexhibittwoproblemsiftheloadsignalisasynchronous:(1)thegatedclockarrivesinthesetupintervaloftheclockoftheflip-flop,causingmetastability,and(2)theloadsignaltruncatesthewidthoftheclockpulse.Additionally,thepropagationdelaythroughthenandgatemightcompromisethesynchronicityoftheoverallcircuit.Connecttotheclockinputofeachflip-flop.LoadClock6.2ModifyFig.6.2,witheachstagereplicatingthefirststageshownbelow:loadclearDQA0I0课后答案网clkLoadClearDOperation00ANochange0010Clearto01xILoadinputwww.hackshp.cn0Note:Inthisdesign,loadhaspriorityoverclear.6.3Serialdataistransferredonebitatatime.Paralleldataistransferrednbitsatatime(n>1).Ashiftregistercanconvertserialdataintoparalleldatabyfirstshiftingonebitatimeintotheregisterandthentakingtheparalleldatafromtheregisteroutputs.Ashiftregisterwithparallelloadcanconvertparalleldatatoaserialformatbyfirstloadingthedatainparallelandthenshiftingthebitsoneatatime.6.4101101Ω1101;0110;1011;1101;0110;10116.5(a)SeeFig.11.19:IC74194(b)SeeFig.11.20.Connecttwo74194ICstoforman8-bitregister.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1316.6Firststageofregister:shiftloadserialinputDQAI00clk6.7Firststageofregister:S1S0Select4x1AMuxYDQi01A"iQ"02Ii3clk6.8A=0010,0001,1000,1100.Carry课后答案网=1,1,1,06.9(a)InFig.6.5,complementtheserialoutputofshiftregisterB(withaninverter),andsettheinitialvalueofthecarryto1.www.hackshp.cn(b)xyxPresentNextFFstateInputsstateOutputinputsQ00011110mmmmQxyQDJK0132QQ01000000xmmmm4576000111xQ1xxxx001010x001000xy11011x0J=x"y11010x0Q11100x1xyx11111x0Q00011110mmmm01320xxxxmmmm4576Q11xK=xy"QD=QxyDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1326.10SeesolutiontoProblem5.7.Notethaty=xifQ=0,andy=x"ifQ=1.Qissetonthefirst1fromx.Notethatx§0=x,andx§1=x".SerialoutputShiftRegisterySerialinputxDQQFromshiftcontrolclkRResetto0initially6.11(a)Acountdowncounter.(b)Acountupcounter.6.12SimilartodiagramofFig.6.8.课后答案网(a)WiththebubblesinCremoved(positive-edge).(b)Withcomplementedflip-flopsconnectedtowww.hackshp.cnC.6.130A11A24-Bit0RippleCounterA31ClearA4Asynchronous,active-low)6.14(a)4;(b)9;(c)106.15Theworstcaseiswhenall10flip-flopsarecomplemented.Themaximumdelayis10x3ns=30ns.9Themaximumfrequencyis10/30=33.3MHzDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1336.16Q8Q4Q2Q1:101011001110SelfcorrectingNextstate:101111011111Nextstate:0100010000001010ç1011ç01001100ç1101ç01001110ç1111ç00006.17WithEdenotingthecountenableinFig.6.12andD-flip-flopsreplacingtheJ-Kflip-flops,thetogglingactionofthebitsofthecounterisdeterminedby:T0=E,T1=A0E,T2=A0A1E,T3=A0A1A2E.SinceDA=A§TAtheinputsoftheflip-flopsofthecounteraredeterminedby:DA0=A0§E;DA1=A1§(A0E);DA2=A2§(A0A1E);DA3=A3§(A0A1A2E).6.18Whenup=down=1thecircuitcountsup.updownxyOperationup0000NochangexCombinationalCircuit0100Countdown1010Countupdowny1100NochangeAddthistoFig.6.13up课后答案网xx=up(down)"y=(up)"downywww.hackshp.cndown6.19(b)FromthestatetableinTable6.5:DQ1=Q"1DQ2=ƒ(1,2,5,6)DQ4=ƒ(3,4,5,6)DQ8=ƒ(7,8)Don"tcare:d=ƒ(10,11,12,13,14,15)Simplifyingwithmaps:DQ2=Q2Q"1+Q"8Q"2Q1DQ4=Q4Q"1+Q4Q"2+Q"4Q2Q1DQ8=Q8Q"1+Q4Q2Q1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.134(a)PresentNextFlip-flopinputsstatestateAAAAAAAAJKJKJKJK84218421A8A8A4A4A2A2A1A1000000010x0x0x1xJ=1A1000100100x0x1xx1K=1A1001000110x0xx01xJ=AA"A218001101000x1xx1x1K=AA21010001010xx00x1xJ=AAA412010101100xx01xx1K=AAA412011001110xx0x01xJ=AAAA8124011110001xx1x1x1K=AA8110001001x00x0x1x10010000x10x0xx1d(A,A,A,A)=S(10,11,12,13,14,15)84216.20(a)Blockdiagramof4-bitcircuit:CountC_outFig.6.14Load16-bitcounterneeds4circuitsCLKwithoutputcarryconnectedtoClearthecountinputofthenextstage.(b)课后答案网26=64LoadCountC_outCount=1www.hackshp.cnFig.6.14LoadFig.6.14LoadCLKCLKClear=1Clear=106.21(a)JA0=LI0+L"CKA0=LI"0+L"C(b)J=[L(LI)"]"(L+C)=(L"+LI)(L+C)LI+L"C+LIC=LI+L"C(useamap)K=(LI)"(L+C)=(L"+I")(L+C)=LI"+L"C6.22DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.135Count=1Count=1C_outLoadC_outLoadFig.6.14Fig.6.14CLKCLKClear=1Clear=1001Countsequence:0,1,2,3,4,5,6,7,8,9,10,11Countsequence:4,5,6,7,8,9,10,11,1,213,14,15Count=1C_outLoad=0Fig.6.14CLK课后答案网Clear0www.hackshp.cnCountsequence:0,1,2,3,4,5,6,7,8,9,10,116.23Usea3-bitcounterandaflip-flop(initiallyat0).Astartsignalsetstheflip-flop,whichinturnenablesthecounter.Onthecountof7(binary111)resettheflip-flopto0todisablethecount(withthevalueof000).6.24PresentNextFlip-flopinputsstatestateABCABCTATBTC000001001001011010010xxxxxx011111110100000110101xxxxxx110100010111110001DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.136BCBBCBAA0001111000011110mmmmmmmm0132013201x01xmmmmmmmm45764576A11xA1x1CCT=ABT=BCABBCBBCBAA0001111000011110mmmmmmmm0132013201x01xmmmmmmmm45764576A1x1A1x1CCT=ACT=AC+A"B"C"CC010101101010100课后答案网Noself-correctingSelf-correcting6.25(a)Usea6-bitringcounter.(b)www.hackshp.cn0T0C201T1Counterof13x82T2B2Fig.6.16Decoder4T4A225T56T66.26Theclockgeneratorhasaperiodof12.5ns.Usea2-bitcountertocountfourpulses.-980/4=20MHz;cycletime=1000x10/20=50ns.6.27PresentNextFlip-flopinputsstatestateABCABCJKJKJKAABBCC0000010x0x1x0010100x1xx10100110xx01x0111001xx1x1100100xx001x101110xx1xx1110000xxx10x111xxxxxxxxxDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.137BCBBCBAA0001111000011110mmmmmmmm01320132010xxxxmmmmmmmm45764576A1xxxxA1x1CCJ=BCK=BAABCBBCBAA0001111000011110mmmmmmmm0132013201xx0xx1mmmmmmmm45764576A11xxA1xxx1CCJ=CK=A+CBBBCBBCBAA0001111000011110mmmmmmmm01320132课后答案网01xx10x11xmmmmmmmm45764576www.hackshp.cnA11xxA1x1xxCCJ=A"+B"K=1CC111001Self-correcting6.28PresentNextstatestateABCABCBCBA00000100011110mmmm00101001320x1010100mmmm011xxx4576100110A11xx101xxx110000C111xxxD=ABADigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.138BCBBCBAA0001111000011110mmmmmmmm0132013201xx101xmmmmmmmm45764576A11xxA1xxCCD=AB"+CD=A"B"C"BCSelf-correcting1110011111100106.29(a)The8validstatesarelistedinFig.8.18(b),withthesequence:0,8,12,14,15,7,3,1,0,....The8unusedstatesandtheirnextstatesareshownbelow:Next课后答案网StateAllstateinvalidABCEABCEstates000010019www.hackshp.cn010010101001010010201101011111001010041010110113101101015110101106(b)Modification:DC=(A+C)B.ABDQDQCEDQDQQ"E"clkThevalidstatesarethesameasin(a).Theunusedstateshavethefollowingsequences:2ç9ç4ç8and10ç13ç6ç11ç5ç0.Thefinalstates,0and8,arevalid.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1396.30ABDQDQCDEDQDQDQE"Q"clkThe5-bitJohnsoncounterhasthefollowingstatesequence:ABCDE0000010000110001110011110decodedA"E"AB"BC"CD"DE"output:1111101111001110001100001A"E"AB"BC"CD"DE"6.31moduleReg_4_bit_beh(outputregA3,A2,A1,A0,inputI3,I2,I1,I0,Clock,Clear);always@(posedgeClock,negedgeClear)if(Clear==0){A3,A2,A1,A0}<=4"b0;else{A3,A2,A1,A0}<={I3,I2,I1,I0};endmodule课后答案网moduleReg_4_bit_Str(outputA3,A2,A1,A0,inputI3,I2,I1,I0,Clock,Clear);DFFM3DFF(A3,I3,Clock,Clear);DFFM2DFF(A2,I2,Clock,Clear);DFFM1DFF(A1,www.hackshp.cnI1,Clock,Clear);DFFM0DFF(A0,I0,Clock,Clear);endmodulemoduleDFF(outputregQ,inputD,clk,clear);always@(posedgeclk,posedgeclear)if(clear==0)Q<=0;elseQ<=D;endmodulemodulet_Reg_4_bit();wireA3_beh,A2_beh,A1_beh,A0_beh;wireA3_str,A2_str,A1_str,A0_str;regI3,I2,I1,I0,Clock,Clear;wire[3:0]I_data={I3,I2,I1,I0};wire[3:0]A_beh={A3_beh,A2_beh,A1_beh,A0_beh};wire[3:0]A_str={A3_str,A2_str,A1_str,A0_str};Reg_4_bit_behM_beh(A3_beh,A2_beh,A1_beh,A0_beh,I3,I2,I1,I0,Clock,Clear);Reg_4_bit_StrM_str(A3_str,A2_str,A1_str,A0_str,I3,I2,I1,I0,Clock,Clear);initial#100$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbeginClear=0;#2Clear=1;endintegerK;initialbeginfor(K=0;K<16;K=K+1)begin{I3,I2,I1,I0}=K;#10;endendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.140050100NameClockClearI_data[3:0]0123456789I3I2I1I0A_beh[3:0]0123456789A3_behA2_behA1_behA0_behA_str[3:0]0123456789A3_str课后答案网A2_strA1_strA0_str6.32(a)www.hackshp.cnmoduleReg_4_bit_Load(outputregA3,A2,A1,A0,inputI3,I2,I1,I0,Load,Clock,Clear);always@(posedgeClock,negedgeClear)if(Clear==0){A3,A2,A1,A0}<=4"b0;elseif(Load){A3,A2,A1,A0}<={I3,I2,I1,I0};endmodulemodulet_Reg_4_Load();wireA3_beh,A2_beh,A1_beh,A0_beh;regI3,I2,I1,I0,Load,Clock,Clear;wire[3:0]I_data={I3,I2,I1,I0};wire[3:0]A_beh={A3_beh,A2_beh,A1_beh,A0_beh};Reg_4_bit_LoadM0(A3_beh,A2_beh,A1_beh,A0_beh,I3,I2,I1,I0,Load,Clock,Clear);initial#100$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbeginClear=0;#2Clear=1;endintegerK;initialfork#20Load=1;#30Load=0;#50Load=1;joininitialbeginfor(K=0;K<16;K=K+1)begin{I3,I2,I1,I0}=K;#10;endendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.141Name050100ClockClearLoadI_data[3:0]0123456789I_data[3]I_data[2]I_data[1]I_data[0]A_beh[3:0]0256789A_beh[3]A_beh[2]A_beh[1]A_beh[0](b)课后答案网moduleReg_4_bit_Load_str(outputA3,A2,A1,A0,inputI3,I2,I1,I0,Load,Clock,Clear);wirey3,y2,y1,y0;mux_2M3(y3,A3,I3,Load);www.hackshp.cnmux_2M2(y2,A2,I2,Load);mux_2M1(y1,A1,I1,Load);mux_2M0(y0,A0,I0,Load);DFFM3DFF(A3,y3,Clock,Clear);DFFM2DFF(A2,y2,Clock,Clear);DFFM1DFF(A1,y1,Clock,Clear);DFFM0DFF(A0,y0,Clock,Clear);endmodulemoduleDFF(outputregQ,inputD,clk,clear);always@(posedgeclk,posedgeclear)if(clear==0)Q<=0;elseQ<=D;endmodulemodulemux_2(outputy,inputa,b,sel);assigny=sel?a:b;endmodulemodulet_Reg_4_Load_str();wireA3,A2,A1,A0;regI3,I2,I1,I0,Load,Clock,Clear;wire[3:0]I_data={I3,I2,I1,I0};wire[3:0]A={A3,A2,A1,A0};Reg_4_bit_Load_strM0(A3,A2,A1,A0,I3,I2,I1,I0,Load,Clock,Clear);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.142initial#100$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbeginClear=0;#2Clear=1;endintegerK;initialfork#20Load=1;#30Load=0;#50Load=1;#80Load=0;joininitialbeginfor(K=0;K<16;K=K+1)begin{I3,I2,I1,I0}=K;#10;endendendmodule060NameClockClearLoadI_data[3:0]0123456789课后答案网A[3:0]x348(c)moduleReg_4_bit_Load_beh(www.hackshp.cnoutputregA3,A2,A1,A0,inputI3,I2,I1,I0,Load,Clock,Clear);always@(posedgeClock,negedgeClear)if(Clear==0){A3,A2,A1,A0}<=4"b0;elseif(Load){A3,A2,A1,A0}<={I3,I2,I1,I0};endmodulemoduleReg_4_bit_Load_str(outputA3,A2,A1,A0,inputI3,I2,I1,I0,Load,Clock,Clear);wirey3,y2,y1,y0;mux_2M3(y3,A3,I3,Load);mux_2M2(y2,A2,I2,Load);mux_2M1(y1,A1,I1,Load);mux_2M0(y0,A0,I0,Load);DFFM3DFF(A3,y3,Clock,Clear);DFFM2DFF(A2,y2,Clock,Clear);DFFM1DFF(A1,y1,Clock,Clear);DFFM0DFF(A0,y0,Clock,Clear);endmodulemoduleDFF(outputregQ,inputD,clk,clear);always@(posedgeclk,posedgeclear)if(clear==0)Q<=0;elseQ<=D;endmodulemodulemux_2(outputy,inputa,b,sel);assigny=sel?a:b;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.143modulet_Reg_4_Load_str();wireA3_beh,A2_beh,A1_beh,A0_beh;wireA3_str,A2_str,A1_str,A0_str;regI3,I2,I1,I0,Load,Clock,Clear;wire[3:0]I_data,A_beh,A_str;assignI_data={I3,I2,I1,I0};assignA_beh={A3_beh,A2_beh,A1_beh,A0_beh};assignA_str={A3_str,A2_str,A1_str,A0_str};Reg_4_bit_Load_strM0(A3_beh,A2_beh,A1_beh,A0_beh,I3,I2,I1,I0,Load,Clock,Clear);Reg_4_bit_Load_strM1(A3_str,A2_str,A1_str,A0_str,I3,I2,I1,I0,Load,Clock,Clear);initial#100$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbeginClear=0;#2Clear=1;endintegerK;initialfork#20Load=1;#30Load=0;#50Load=1;#80Load=0;joininitialbeginfor(K=0;K<16;K=K+1)begin{I3,I2,I1,I0}=K;#10;endendendmodule课后答案网060Namewww.hackshp.cnClockClearLoadI_data[3:0]0123456789A_beh[3:0]x348A_str[3:0]x3486.33//StimulusfortestingthebinarycounterofExample6-3moduletestcounter;regCount,Load,CLK,Clr;reg[3:0]IN;wireC0;wire[3:0]A;Binary_Counter_4_Par_LoadM0(A,//DataoutputC0,//OutputcarryIN,//DatainputCount,//ActivehightocountLoad,//ActivehightoloadCLK,//PositiveedgesensitiveClr//Activelow);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.144always#5CLK=~CLK;initialbeginClr=0;//Clearde-assertedCLK=1;//ClockinitializedhighLoad=0;Count=1;//Enablecount#5Clr=1;//Clearscount,thencountsforfivecycles#50Load=1;IN=4"b1100;//Countissetto4"b1100(12`0)#10Load=0;#70Count=0;//Countisdeassertedatt=135#20$finish;//Terminatesimulationendendmodule//Four-bitbinarycounterwithparallelload//SeeFigure6-14andTable6-6moduleBinary_Counter_4_Par_Load(outputreg[3:0]A_count,//DataoutputoutputC_out,//Outputcarryinput[3:0]Data_in,//DatainputinputCount,//ActivehightocountLoad,//ActivehightoloadCLK,//PositiveedgesensitiveClear//Activelow);课后答案网assignC_out=Count&(~Load)&(A_count==4"b1111);always@(posedgeCLK,negedgeClear)if(~Clear)A_count<=4"b0000;elseif(Load)A_count<=Data_in;elseif(Count)A_count<=A_count+1"b1;www.hackshp.cnelseA_count<=A_count;//redundantstatementendmodule//Note:apreferreddescriptioniftheclockisgivenby://initialbeginCLK=0;forever#5CLK=~CLK;end060120NameCLKClrLoadIN[3:0]xcCountA[3:0]012345cdef0123C06.34moduleShiftreg(SI,SO,CLK);inputSI,CLK;outputSO;reg[3:0]Q;assignSO=Q[0];always@(posedgeCLK)Q={SI,Q[3:1]};endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.145//Testplan////Verifythatdatashiftthroughtheregister//SetSI=1for4clockcycles//HoldSI=1for4clockcycles//SetSI=0for4clockcycles//Verifythatdatashiftsoutoftheregistercorrectlymodulet_Shiftreg;regSI,CLK;wireSO;ShiftregM0(SI,SO,CLK);initial#130$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkSI=1"b1;#80SI=0;joinendmodule060120Name课后答案网CLKSIwww.hackshp.cnSO6.35(a)NotethatLoadhaspriorityoverClear.moduleProb_6_35a(output[3:0]A,input[3:0]I,inputLoad,Clock,Clear);Register_CellR0(A[0],I[0],Load,Clock,Clear);Register_CellR1(A[1],I[1],Load,Clock,Clear);Register_CellR2(A[2],I[2],Load,Clock,Clear);Register_CellR3(A[3],I[3],Load,Clock,Clear);endmodulemoduleRegister_Cell(outputA,inputI,Load,Clock,Clear);DFFM0(A,D,Clock);not(Load_b,Load);not(w1,Load_b);not(Clear_b,Clear);and(w2,I,w1);and(w3,A,Load_b,Clear_b);or(D,w2,w3);endmodulemoduleDFF(outputregQ,inputD,clk);always@(posedgeclk)Q<=D;endmodulemodulet_Prob_6_35a();wire[3:0]A;reg[3:0]I;regClock,Clear,Load;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.146Prob_6_35aM0(A,I,Load,Clock,Clear);initial#150$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialforkI=4"b1010;Clear=1;#40Clear=0;Load=0;#20Load=1;#40Load=0;joinendmodule060120NameClockClearLoadI[3:0]aA[3:0]0a0(b)Note:ThesolutionbelowreplacesthesolutiongivenontheCD.课后答案网moduleProb_6_35b(outputreg[3:0]A,input[3:0]I,inputLoad,Clock,Clear);always@(posedgeClock)if(Load)A<=I;elseifwww.hackshp.cn(Clear)A<=4"b0;//elseA<=A;//redundantstatementendmodulemodulet_Prob_6_35b();wire[3:0]A;reg[3:0]I;regClock,Clear,Load;Prob_6_35bM0(A,I,Load,Clock,Clear);initial#150$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialforkI=4"b1010;Clear=1;#60Clear=0;Load=0;#20Load=1;#40Load=0;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.147060120NameClockClearLoadI[3:0]aA[3:0]0a0(c)moduleProb_6_35c(output[3:0]A,input[3:0]I,inputShift,Load,Clock);Register_CellR0(A[0],I[0],A[1],Shift,Load,Clock);Register_CellR1(A[1],I[1],A[2],Shift,Load,Clock);Register_CellR2(A[2],I[2],A[3],Shift,Load,Clock);Register_CellR3(A[3],I[3],A[0],Shift,Load,Clock);endmodulemoduleRegister_Cell(outputA,inputI,Serial_in,Shift,Load,Clock);DFFM0(A,D,Clock);not(Shift_b,Shift);not(Load_b,Load);and(w1,Shift,Serial_in);课后答案网and(w2,Shift_b,Load,I);and(w3,A,Shift_b,Load_b);or(D,w1,w2,w3);endmodulewww.hackshp.cnmoduleDFF(outputregQ,inputD,clk);always@(posedgeclk)Q<=D;endmodulemodulet_Prob_6_35c();wire[3:0]A;reg[3:0]I;regClock,Shift,Load;Prob_6_35cM0(A,I,Shift,Load,Clock);initial#150$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialforkI=4"b1010;Load=0;Shift=0;#20Load=1;#40Load=0;#50Shift=1;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.148060120NameClockShiftLoadI[3:0]aA[3:0]xa5a5a5a5a5(d)moduleProb_6_35d(outputreg[3:0]A,input[3:0]I,inputShift,Load,Clock,Clear);always@(posedgeClock)if(Shift)A<={A[0],A[3:1]};elseif(Load)A<=I;elseif(Clear)A<=4"b0;//elseA<=A;//redundantstatementendmodulemodulet_Prob_6_35d();wire[3:0]A;reg[3:0]I;regClock,Clear,Shift,Load;课后答案网Prob_6_35dM0(A,I,Shift,Load,Clock,Clear);initial#150$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialforkwww.hackshp.cnI=4"b1010;Clear=1;#100Clear=0;Load=0;#20Load=1;#40Load=0;#30Shift=1;#90Shift=0;joinendmodule060120NameClockClearShiftLoadI[3:0]aA[3:0]0a5a5a5a0DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.149(e)moduleShift_Register(output[3:0]A_par,input[3:0]I_par,inputMSB_in,LSB_in,s1,s0,CLK,Clear);wirey3,y2,y1,y0;DFFD3(A_par[3],y3,CLK,Clear);DFFD2(A_par[2],y2,CLK,Clear);DFFD1(A_par[1],y1,CLK,Clear);DFFD0(A_par[0],y0,CLK,Clear);MUX_4x1M3(y3,I_par[3],A_par[2],MSB_in,A_par[3],s1,s0);MUX_4x1M2(y2,I_par[2],A_par[1],A_par[3],A_par[2],s1,s0);MUX_4x1M1(y1,I_par[1],A_par[0],A_par[2],A_par[1],s1,s0);MUX_4x1M0(y0,I_par[0],LSB_in,A_par[1],A_par[0],s1,s0);endmodulemoduleMUX_4x1(outputregy,inputI3,I2,I1,I0,s1,s0);always@(I3,I2,I1,I0,s1,s0)case({s1,s0})2"b11:y=I3;2"b10:y=I2;2"b01:y=I1;2"b00:y=I0;endcaseendmodulemoduleDFF(outputregQ,inputD,clk,reset_b);always@(课后答案网posedgeclk,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=D;endmodulemodulet_Shift_Register();wire[3:0]A_par;reg[3:0]I_par;www.hackshp.cnregMSB_in,LSB_in,s1,s0,CLK,Clear;Shift_RegisterM_SR(A_par,I_par,MSB_in,LSB_in,s1,s0,CLK,Clear);initial#300$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkMSB_in=0;LSB_in=0;Clear=0;//Active-lowresets1=0;s0=0;//Nochange#10Clear=1;#10I_par=4"hA;#30begins1=1;s0=1;end//00:loadI_parintoA_par#50s1=0;//01:shiftright(1010to0101to0010to0001to0000)#90begins1=1;s0=1;end//11:reloadAwith1010#100s0=0;//10:shiftleft(1010to0100to1000to000)#140begins1=1;s0=1;MSB_in=1;LSB_in=1;end//RepeatwithMSBandLSB#150s1=0;#190begins1=1;s0=1;end//reloadwithA=1010#200s0=0;//Shiftleft#220s1=0;//Pause#240s1=1;//ShiftleftjoinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.150NoShiftShiftchangeLoadrightLoadleft090180270NameCLKClears1s0I_par[3:0]xaMSB_inLSB_inA_par[3:0]0a5210a480adefa5b7f(f)moduleShift_Register_BEH(output[3:0]A_par,input[3:0]I_par,inputMSB_in,LSB_in,s1,s0,CLK,Clear);always@(posedgeCLK,negedgeClear)if(Clear==0)A_par<=4"b0;else课后答案网case({s1,s0})2"b11:A_par<=I_par;2"b01:A_par<={MSB_in,A_par[3:1]};2"b10:A_par<={A_par[2:0],LSB_in};2"b00:A_par<=A_par;endcasewww.hackshp.cnendmodulemodulet_Shift_Register();wire[3:0]A_par;reg[3:0]I_par;regMSB_in,LSB_in,s1,s0,CLK,Clear;Shift_Register_BEHM_SR(A_par,I_par,MSB_in,LSB_in,s1,s0,CLK,Clear);initial#300$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkMSB_in=0;LSB_in=0;Clear=0;//Active-lowresets1=0;s0=0;//Nochange#10Clear=1;#10I_par=4"hA;#30begins1=1;s0=1;end//00:loadI_parintoA_par#50s1=0;//01:shiftright(1010to0101to0010to0001to0000)#90begins1=1;s0=1;end//11:reloadAwith1010#100s0=0;//10:shiftleft(1010to0100to1000to000)#140begins1=1;s0=1;MSB_in=1;LSB_in=1;end//RepeatwithMSBandLSB#150s1=0;#190begins1=1;s0=1;end//reloadwithA=1010#200s0=0;//Shiftleft#220s1=0;//Pause#240s1=1;//ShiftleftjoinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.151090180270NameCLKClears1s0I_par[3:0]xaMSB_inLSB_inA_par[3:0]0a5210a480adefa5b7f(g)moduleRipple_Counter_4bit(output[3:0]A,inputCount,reset_b);regA0,A1,A2,A3;assignA={A3,A2,A1,A0};always@(negedgeCount,negedgereset_b)if(reset_b==0)A0<=课后答案网0;elseA0<=~A0;always@(negedgeA0,negedgereset_b)if(reset_b==0)A1<=0;elseA1<=~A1;alwayswww.hackshp.cn@(negedgeA1,negedgereset_b)if(reset_b==0)A2<=0;elseA2<=~A2;always@(negedgeA2,negedgereset_b)if(reset_b==0)A3<=0;elseA3<=~A3;endmodulemodulet_Ripple_Counter_4bit();wire[3:0]A;regCount,reset_b;Ripple_Counter_4bitM0(A,Count,reset_b);initial#300$finish;initialforkreset_b=0;//Active-lowreset#60reset_b=1;Count=1;#15Count=0;#30Count=1;#85beginCount=0;forever#10Count=~Count;endjoinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.152090180270NameCountreset_bA[3:0]0123456789ab(h)Note:Thisversionofthesolutionsituatesthedatashiftregistersinthetestbench.moduleSerial_Subtractor(outputSO,inputSI_A,SI_B,shift_control,clock,reset_b);//SeeFig.6.5andProblem6.9a(2scomplementserialsubtractor)reg[1:0]sum;wiremem=sum[1];assignSO=sum[0];always@(posedgeclock,negedgereset_b)if(reset_b==0)beginsum<=2"b10;endelseif(shift_control)beginsum<=SI_课后答案网A+(!SI_B)+sum[1];endendmodulemodulet_Serial_Subtractor();wirewww.hackshp.cnSI_A,SI_B;regshift_control,clock,reset_b;Serial_SubtractorM0(SO,SI_A,SI_B,shift_control,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkshift_control=0;#10reset_b=0;#20reset_b=1;#22shift_control=1;#105shift_control=0;#112reset_b=0;#114reset_b=1;#122shift_control=1;#205shift_control=0;joinreg[7:0]A,B,SO_reg;wires7;assigns7=SO_reg[7];assignSI_A=A[0];assignSI_B=B[0];wireSI_B_bar=~SI_B;initialforkA=8"h5A;B=8"h0A;#122A=8"h0A;#122B=8"h5A;joinDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.153always@(negedgeclock,negedgereset_b)if(reset_b==0)SO_reg<=0;elseif(shift_control==1)beginSO_reg<={SO,SO_reg[7:1]};A<=A>>1;B<=B>>1;endwirenegative=!M0.sum[1];wire[7:0]magnitude=(!negative)?SO_reg:1"b1+~SO_reg;endmoduleSimulationresultsareshownfor5Ah–0Ah=50h=80dand0Ah–5Ah=-80.Themagnitudeoftheresultisalsoshown.课后答案网www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1541b01768020000060961600000011c0192640221801281280551600110b11022162200000552d4520a105a90120课后答案网000508080a0160160www.hackshp.cn00030114064648020228012812830550b11011162202240000022d450555a900a10xxxxx0Defaultclockreset_bshift_controlA[7:0]A[7:0]B[7:0]B[7:0]SI_BSI_ASI_B_barSOmemsum[1:0]SO_reg[7:0]SO_reg[7:0]negativemagnitude[7:0]NameDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.155(i)SeeProb.6.35h.(j)moduleSerial_Twos_Comp(outputy,input[7:0]data,inputload,shift_control,Clock,reset_b);reg[7:0]SReg;regQ;wireSO=SReg[0];assigny=SO^Q;always@(posedgeClock,negedgereset_b)if(reset_b==0)beginSReg<=0;Q<=0;endelsebeginif(load)SReg=data;elseif(shift_control)beginQ<=Q|SO;SReg<={y,SReg[7:1]};endendendmodulemodulet_Serial_Twos_Comp();wirey;reg[7:0]data;regload,shift_control,课后答案网Clock,reset_b;Serial_Twos_CompM0(y,data,load,shift_control,Clock,reset_b);reg[7:0]twos_comp;www.hackshp.cnalways@(posedgeClock,negedgereset_b)if(reset_b==0)twos_comp<=0;elseif(shift_control&&!load)twos_comp<={y,twos_comp[7:1]};initial#200$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbegin#2reset_b=0;#4reset_b=1;endinitialforkdata=8"h5A;#20load=1;#30load=0;#50shift_control=1;#50beginrepeat(9)@(posedgeClock);shift_control=0;endjoinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.156Name050100Clockreset_bdata[7:0]5aloadshift_controlSReg[7:0]005a2d96cb6532994ca6ytwos_comp[7:0]0080c06030984ca6(k)FromthesolutiontoProblem6.13:0A11A24-Bit0RippleCounterA31ClearA4课后答案网Asynchronous,active-low)moduleProb_6_35k_BCD_Counter(outputA1,A2,A3,A4,inputclk,reset_b);wire{A1,A2,A3,A4}=A;www.hackshp.cnnand(Clear,A2,A4);Ripple_Counter_4bitM0(A,Clear,reset_b);endmodulemoduleRipple_Counter_4bit(output[3:0]A,inputCount,reset_b);regA0,A1,A2,A3;assignA={A3,A2,A1,A0};always@(negedgeCount,negedgereset_b)if(reset_b==0)A0<=0;elseA0<=~A0;always@(negedgeA0,negedgereset_b)if(reset_b==0)A1<=0;elseA1<=~A1;always@(negedgeA1,negedgereset_b)if(reset_b==0)A2<=0;elseA2<=~A2;always@(negedgeA2,negedgereset_b)if(reset_b==0)A3<=0;elseA3<=~A3;endmodulemodulet_Prob_6_35k_BCD_Counter();wire[3:0]A;regCount,reset_b;Prob_6_35k_BCD_CounterM0(A1,A2,A3,A4,reset_b);initial#300$finish;initialforkreset_b=0;//Active-lowreset#60reset_b=1;/*Count=1;#15Count=0;#30Count=1;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.157#85beginCount=0;forever#10Count=~Count;end*/joinendmodule(l)moduleProb_6_35l_Up_Dwn_Beh(outputreg[3:0]A,inputCLK,Up,Down,reset_b);always@(posedgeCLK,negedgereset_b)if(reset_b==0)A<=4"b0000;elsecase({Up,Down})2"b10:A<=A+4"b0001;//Up2"b01:A<=A-4"b0001;//Downdefault:A<=A;//Suspend(Redundantstatement)endcaseendmodulemodulet_Prob_6_35l_Up_Dwn_Beh();wire[3:0]A;regCLK,Up,Down,reset_b;Prob_6_35l_Up_Dwn_BehM0(A,CLK,Up,Down,reset_b);initial#300$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkDown=0;Up=0;#10reset_b=0;课后答案网#20reset_b=1;#40Up=1;#150Down=1;#220Up=0;#280Down=0;www.hackshp.cnjoinendmodule090180270NameCLKreset_bUpDownA[3:0]x0123456789aba987656.36(a)//SeeFig.6.13.,4-bitUp-DownBinaryCountermoduleProb_6_36_Up_Dwn_Beh(outputreg[3:0]A,inputCLK,Up,Down,reset_b);always@(posedgeCLK,negedgereset_b)if(reset_b==0)A<=4"b0000;elseif(Up)A<=A+4"b0001;elseif(Down)A<=A-4"b0001;endmodulemodulet_Prob_6_36_Up_Dwn_Beh();wire[3:0]A;regCLK,Up,Down,reset_b;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.158Prob_6_36_Up_Dwn_BehM0(A,CLK,Up,Down,reset_b);initial#300$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkDown=0;Up=0;#10reset_b=0;#20reset_b=1;#40Up=1;#150Down=1;#220Up=0;#280Down=0;joinendmodule080160240NameCLKreset_bUpDownA[3:0]课后答案网x0123456789abcdef01210fedc(b)moduleProb_6_36_Up_Dwn_Str(output[3:0]A,inputCLK,Up,Down,reset_b);wireDown_3,Up_3,Down_2,Up_2,Down_1,Up_1;wirewww.hackshp.cnA_0b,A_1b,A_2b,A_3b;stage_registerSR3(A[3],A_3b,Down_3,Up_3,Down_2,Up_2,A[2],A_2b,CLK,reset_b);stage_registerSR2(A[2],A_2b,Down_2,Up_2,Down_1,Up_1,A[1],A_1b,CLK,reset_b);stage_registerSR1(A[1],A_1b,Down_1,Up_1,Down_not_Up,Up,A[0],A_0b,CLK,reset_b);not(Up_b,Up);and(Down_not_Up,Down,Up_b);or(T,Up,Down_not_Up);Toggle_flopTF0(A[0],A_0b,T,CLK,reset_b);endmodulemodulestage_register(outputA,A_b,Down_not_Up_out,Up_out,inputDown_not_Up,Up,A_in,A_in_b,CLK,reset_b);Toggle_flopT0(A,A_b,T,CLK,reset_b);or(T,Down_not_Up_out,Up_out);and(Down_not_Up_out,Down_not_Up,A_in_b);and(Up_out,Up,A_in);endmodulemoduleToggle_flop(outputregQ,outputQ_b,inputT,CLK,reset_b);always@(posedgeCLK,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=Q^T;assignQ_b=~Q;endmodulemodulet_Prob_6_36_Up_Dwn_Str();wire[3:0]A;regCLK,Up,Down,reset_b;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.159wireT3=M0.SR3.T;wireT2=M0.SR2.T;wireT1=M0.SR1.T;wireT0=M0.T;Prob_6_36_Up_Dwn_StrM0(A,CLK,Up,Down,reset_b);initial#150$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkDown=0;Up=0;#10reset_b=0;#20reset_b=1;#50Up=1;#140Down=1;#120Up=0;#140Down=0;joinendmodule070140210280NameCLKreset_bUpDownA[3:0]课后答案网x0123456789abcdef01210fedcT0T1T2T3www.hackshp.cn6.37moduleCounter_if(outputreg[3:0]Count,inputclock,reset);always@(posedgeclock,posedgereset)if(reset)Count<=0;elseif(Count==0)Count<=1;elseif(Count==1)Count<=3;//Defaultinterpretationisdecimalelseif(Count==3)Count<=7;elseif(Count==4)Count<=0;elseif(Count==6)Count<=4;elseif(Count==7)Count<=6;elseCount<=0;endmodulemoduleCounter_case(outputreg[3:0]Count,inputclock,reset);always@(posedgeclock,posedgereset)if(reset)Count<=0;elsebeginCount<=0;case(Count)0:Count<=1;1:Count<=3;3:Count<=7;4:Count<=0;6:Count<=4;7:Count<=6;default:Count<=0;endcaseDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.160endendmodulemoduleCounter_FSM(outputreg[3:0]Count,inputclock,reset);reg[2:0]state,next_state;parameters0=0,s1=1,s2=2,s3=3,s4=4,s5=5,s6=6,s7=7;always@(posedgeclock,posedgereset)if(reset)state<=s0;elsestate<=next_state;always@(state)beginCount=0;case(state)s0:beginnext_state=s1;Count=0;ends1:beginnext_state=s2;Count=1;ends2:beginnext_state=s3;Count=3;ends3:beginnext_state=s4;Count=7;ends4:beginnext_state=s5;Count=6;ends5:beginnext_state=s6;Count=4;enddefault:beginnext_state=s0;Count=0;endendcaseendendmodule6.38(a)课后答案网moduleProb_6_38a_Updown(OUT,Up,Down,Load,IN,CLK);//Verilog1995output[3:0]OUT;input[3:0]IN;inputUp,Down,Load,CLK;reg[3:0]OUT;www.hackshp.cnalways@(posedgeCLK)if(Load)OUT<=IN;elseif(Up)OUT<=OUT+4"b0001;elseif(Down)OUT<=OUT-4"b0001;elseOUT<=OUT;endmodulemoduleupdown(//Verilog2001,2005outputreg[3:0]OUT,input[3:0]IN,inputUp,Down,Load,CLK);(b)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.161moduleProb_6_38b_Updown(outputreg[3:0]OUT,input[3:0]IN,inputs1,s0,CLK);always@(posedgeCLK)case({s1,s0})2"b00:OUT<=OUT+4"b0001;2"b01:OUT<=OUT-4"b0001;2"b10:OUT<=IN;2"b11:OUT<=OUT;endcaseendmodulemodulet_Prob_6_38b_Updown();wire[3:0]OUT;reg[3:0]IN;regs1,s0,CLK;Prob_6_38b_UpdownM0(OUT,IN,s1,s0,CLK);initial#150$finish;initialbeginCLK=0;forever#5CLK=~CLK;endinitialforkIN=4"b1010;#10begins1=1;s0=0;end//LoadIN#20begins1=1;s0=1;end//nochange#40begins1=0;s0=0;end//UP;#80begins1=0;s0=1;end课后答案网//DOWN#120begins1=1;s0=1;endjoinendmoduleNamewww.hackshp.cn060120CLKs1s0IN[3:0]aOUT[3:0]xabcdedcba6.39moduleProb_6_39_Counter_BEH(outputreg[2:0]Count,inputClock,reset_b);always@(posedgeClock,negedgereset_b)if(reset_b==0)Count<=0;elsecase(Count)0:Count<=1;1:Count<=2;2:Count<=4;4:Count<=5;5:Count<=6;6:Count<=0;endcaseendmodulemoduleProb_6_39_Counter_STR(output[2:0]Count,inputClock,reset_b);supply1PWR;wireCount_1_b=~Count[1];DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.162JK_FFM2(Count[2],Count[1],Count[1],Clock,reset_b);JK_FFM1(Count[1],Count[0],PWR,Clock,reset_b);JK_FFM0(Count[0],Count_1_b,PWR,Clock,reset_b);endmodulemoduleJK_FF(outputregQ,inputJ,K,clk,reset_b);always@(posedgeclk,negedgereset_b)if(reset_b==0)Q<=0;elsecase({J,K})2"b00:Q<=Q;2"b01:Q<=0;2"b10:Q<=1;2"b11:Q<=~Q;endcaseendmodulemodulet_Prob_6_39_Counter();wire[2:0]Count_BEH,Count_STR;regClock,reset_b;Prob_6_39_Counter_BEHM0_BEH(Count_STR,Clock,reset_b);Prob_6_39_Counter_STRM0_STR(Count_BEH,Clock,reset_b);initial#250$finish;initialfork#1reset_b=0;#7reset_b=1;joininitialbeginClock=1;forever#5Clock=~Clock;endendmodule课后答案网060120NameClockwww.hackshp.cnreset_bCount_BEH[2:0]0124560124560124Count_STR[2:0]01245601245601246.40moduleProb_6_40(outputreg[0:7]timer,inputclk,reset_b);always@(negedgeclk,negedgereset_b)if(reset_b==0)timer<=8"b1000_0000;elsecase(timer)8"b1000_0000:timer<=8"b0100_0000;8"b0100_0000:timer<=8"b0010_0000;8"b0010_0000:timer<=8"b0001_0000;8"b0001_0000:timer<=8"b0000_1000;8"b0000_1000:timer<=8"b0000_0100;8"b0000_0100:timer<=8"b0000_0010;8"b0000_0010:timer<=8"b0000_0001;8"b0000_0001:timer<=8"b1000_0000;default:timer<=8"b1000_0000;endcaseendmodulemodulet_Prob_6_40();wire[0:7]timer;regclk,reset_b;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.163Prob_6_40M0(timer,clk,reset_b);initial#250$finish;initialfork#1reset_b=0;#7reset_b=1;joininitialbeginclk=1;forever#5clk=~clk;endendmodule070140210Nameclkreset_btimer[0:7]80timer[0]timer[1]timer[2]timer[3]timer[4]timer[5]timer[6]timer[7]6.41课后答案网moduleProb_6_41_Switched_Tail_Johnson_Counter(output[0:3]Count,inputCLK,reset_b);wireQ_0b,Q_1b,Q_2b,Q_3b;DFFM3(Count[3],Q_3b,Count[2],CLK,reset_b);www.hackshp.cnDFFM2(Count[2],Q_2b,Count[1],CLK,reset_b);DFFM1(Count[1],Q_1b,Count[0],CLK,reset_b);DFFM0(Count[0],Q_0b,Q_3b,CLK,reset_b);endmodulemoduleDFF(outputregQ,outputQ_b,inputD,clk,reset_b);assignQ_b=~Q;always@(posedgeclk,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=D;endmodulemodulet_Prob_6_41_Switched_Tail_Johnson_Counter();wire[3:0]Count;regCLK,reset_b;wires0=~M0.Count[0]&&~M0.Count[3];wires1=M0.Count[0]&&~M0.Count[1];wires2=M0.Count[1]&&~M0.Count[2];wires3=M0.Count[2]&&~M0.Count[3];wires4=M0.Count[0]&&M0.Count[3];wires5=~M0.Count[0]&&M0.Count[1];wires6=~M0.Count[1]&&M0.Count[2];wires7=~M0.Count[2]&&M0.Count[3];Prob_6_41_Switched_Tail_Johnson_CounterM0(Count,CLK,reset_b);initial#150$finish;initialfork#1reset_b=0;#7reset_b=1;joininitialbeginCLK=1;forever#5CLK=~CLK;endendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.164060120NameCLKreset_bCount[3:0]08cef73108cef73s0s1s2s3s4s5s6s76.42BecauseAisaregistervariable,itretainswhatevervaluehasbeenassignedtoituntilanewvalueisassigned.Therefore,thestatementA<=Ahasthesameeffectasifthestatementwasomitted.6.43课后答案网datawww.hackshp.cnD_inMuxMuxDQDFFShift_controlloadClock[moduleProb_6_43_Str(outputSO,input[7:0]data,inputload,Shift_control,Clock,reset_b);supply0gnd;wireSO_A;Shift_with_LoadM_A(SO_A,SO_A,data,load,Shift_control,Clock,reset_b);Shift_with_LoadM_B(SO,SO_A,data,gnd,Shift_control,Clock,reset_b);endmodulemoduleShift_with_Load(outputSO,inputD_in,input[7:0]data,inputload,select,Clock,reset_b);wire[7:0]Q;assignSO=Q[0];SR_cellM7(Q[7],D_in,data[7],load,select,Clock,reset_b);SR_cellM6(Q[6],Q[7],data[6],load,select,Clock,reset_b);SR_cellM5(Q[5],Q[6],data[5],load,select,Clock,reset_b);SR_cellM4(Q[4],Q[5],data[4],load,select,Clock,reset_b);SR_cellM3(Q[3],Q[4],data[3],load,select,Clock,reset_b);SR_cellM2(Q[2],Q[3],data[2],load,select,Clock,reset_b);SR_cellM1(Q[1],Q[2],data[1],load,select,Clock,reset_b);SR_cellM0(Q[0],Q[1],data[0],load,select,Clock,reset_b);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.165endmodulemoduleSR_cell(outputQ,inputD,data,load,select,Clock,reset_b);wirey;DFF_with_loadM0(Q,y,data,load,Clock,reset_b);Mux_2M1(y,Q,D,select);endmodulemoduleDFF_with_load(outputregQ,inputD,data,load,Clock,reset_b);always@(posedgeClock,negedgereset_b)if(reset_b==0)Q<=0;elseif(load)Q<=data;elseQ<=D;endmodulemoduleMux_2(outputregy,inputa,b,sel);always@(a,b,sel)if(sel==1)y=b;elsey=a;endmodulemodulet_Fig_6_4_Str();wireSO;regload,Shift_control,Clock,reset_b;reg[7:0]data,Serial_Data;Prob_6_43_StrM0(SO,data,load,Shift_control,Clock,reset_b);always@(posedgeClock,negedgereset_b)if(reset_b==0)Serial_Data<=0;elseif(Shift_control)Serial_Data<={M0.课后答案网SO_A,Serial_Data[7:1]};initial#200$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbegin#2reset_b=0;#4reset_b=1;endinitialforkwww.hackshp.cndata=8"h5A;#20load=1;#30load=0;#50Shift_control=1;#50beginrepeat(9)@(posedgeClock);Shift_control=0;endjoinendmodule050100NameClockreset_bloadShift_controldata[7:0]5aSO_ASOQ[7:0]005a2d964ba5d269b45a2dQ[7:0]008040a0d068b45a2dSerial_Data[7:0]008040a0d068b45aDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.166Alternative:abehavioralmodelforsynthesisisgivenbelow.ThebehavioraldescriptionimpliestheneedforamuxattheinputtoaD-typeflip-flop.moduleFig_6_4_Beh(outputSO,input[7:0]data,inputload,Shift_control,Clock,reset_b);reg[7:0]Shift_Reg_A,Shift_Reg_B;assignSO=Shift_Reg_B[0];always@(posedgeClock,negedgereset_b)if(reset_b==0)beginShift_Reg_A<=0;Shift_Reg_B<=0;endelseif(load)Shift_Reg_A<=data;elseif(Shift_control)beginShift_Reg_A<={Shift_Reg_A[0],Shift_Reg_A[7:1]};Shift_Reg_B<={Shift_Reg_A[0],Shift_Reg_B[7:1]};endendmodulemodulet_Fig_6_4_Beh();wireSO;regload,Shift_control,Clock,reset_b;reg[7:0]data,Serial_Data;Fig_6_4_BehM0(SO,data,load,Shift_control,Clock,reset_b);always@课后答案网(posedgeClock,negedgereset_b)if(reset_b==0)Serial_Data<=0;elseif(Shift_control)Serial_Data<={M0.Shift_Reg_A[0],Serial_Data[7:1]};initial#200$finish;initialbeginwww.hackshp.cnClock=0;forever#5Clock=~Clock;endinitialbegin#2reset_b=0;#4reset_b=1;endinitialforkdata=8"h5A;#20load=1;#30load=0;#50Shift_control=1;#50beginrepeat(9)@(posedgeClock);Shift_control=0;endjoinendmoduleName050100150Clockreset_bloadShift_controldata[7:0]5aShift_Reg_A[7:0]005a2d964ba5d269b45a2dShift_Reg_B[7:0]008040a0d068b45a2dSOSerial_Data[7:0]008040a0d068b45aDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1676.44//SeeFigure6.5//Note:SumisstoredinshiftregisterA;carryisstoredinQ//Note:Clearisactive-low.moduleProb_6_44_Str(outputSO,input[7:0]data_A,data_B,inputS_in,load,Shift_control,CLK,Clear);supply0gnd;wiresum,carry;assignSO=sum;wireSO_A,SO_B;Shift_Reg_gated_clockM_A(SO_A,sum,data_A,load,Shift_control,CLK,Clear);Shift_Reg_gated_clockM_B(SO_B,S_in,data_B,load,Shift_control,CLK,Clear);FAM_FA(carry,sum,SO_A,SO_B,Q);DFF_gatedM_FF(Q,carry,Shift_control,CLK,Clear);endmodulemoduleShift_Reg_gated_clock(outputSO,inputS_in,input[7:0]data,inputload,Shift_control,Clock,reset_b);reg[7:0]SReg;assignSO=SReg[0];always@(posedgeClock,negedgereset_b)if(reset_b==0)SReg<=0;课后答案网elseif(load)SReg<=data;elseif(Shift_control)SReg<={S_in,SReg[7:1]};endmodulewww.hackshp.cnmoduleDFF_gated(outputQ,inputD,Shift_control,Clock,reset_b);DFFM_DFF(Q,D_internal,Clock,reset_b);Mux_2M_Mux(D_internal,Q,D,Shift_control);endmodulemoduleDFF(outputregQ,inputD,Clock,reset_b);always@(posedgeClock,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=D;endmodulemoduleMux_2(outputregy,inputa,b,sel);always@(a,b,sel)if(sel==1)y=b;elsey=a;endmodulemoduleFA(outputregcarry,sum,inputa,b,C_in);always@(a,b,C_in){carry,sum}=a+b+C_in;endmodulemodulet_Prob_6_44_Str();wireSO;regSI,load,Shift_control,Clock,Clear;reg[7:0]data_A,data_B;Prob_6_44_StrM0(SO,data_A,data_B,SI,load,Shift_control,Clock,Clear);initial#200$finish;initialbeginClock=0;forever#5Clock=~Clock;endinitialbegin#2Clear=0;#4Clear=1;endDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.168initialforkdata_A=8"hAA;//8"hff;data_B=8"h55;//8"h01;SI=0;#20load=1;#30load=0;#50Shift_control=1;#50beginrepeat(8)@(posedgeClock);#5Shift_control=0;endjoinendmodule060120NameClockClearloadShift_controlaa+55={carry,sum}={0,ff}hhhdata_A[7:0]课后答案网aaSReg[7:0]00aad5eaf5fafdfeffQdata_B[7:0]55SReg[7:0]www.hackshp.cn00552a150a05020100SO060120NameClockClearloadShift_controlff+01={carry,sum}={1,00}hhhdata_A[7:0]ffSReg[7:0]00ff7f3f1f0f07030100Qdata_B[7:0]01SReg[7:0]000100SO6.45moduleProb_6_45(outputregy_out,inputstart,clock,reset_bar);parameters0=4"b0000,s1=4"b0001,s2=4"b0010,s3=4"b0011,s4=4"b0100,s5=4"b0101,DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.169s6=4"b0110,s7=4"b0111,s8=4"b1000;reg[3:0]state,next_state;always@(posedgeclock,negedgereset_bar)if(!reset_bar)state<=s0;elsestate<=next_state;always@(state,start)beginy_out=1"b0;case(state)s0:if(start)next_state=s1;elsenext_state=s0;s1:beginnext_state=s2;y_out=1;ends2:beginnext_state=s3;y_out=1;ends3:beginnext_state=s4;y_out=1;ends4:beginnext_state=s5;y_out=1;ends5:beginnext_state=s6;y_out=1;ends6:beginnext_state=s7;y_out=1;ends7:beginnext_state=s8;y_out=1;ends8:beginnext_state=s0;y_out=1;enddefault:next_state=s0;endcaseendendmodule//Testplan课后答案网//Verifythefollowing://Power-upreset//Responsetostartininitialstate//Reseton-the-flywww.hackshp.cn//Responsetore-assertionofstartafterreseton-the-fly//8-cyclecountingsequence//Ignorestartduringcountingsequence//Returntoinitialstateafter8cyclesandawaitstart//Remainininitialstateforoneclockifstartisassertedwhenthestateisenteredmodulet_Prob_6_45;wirey_out;regstart,clock,reset_bar;Prob_6_45M0(y_out,start,clock,reset_bar);initial#300$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_bar=0;#2reset_bar=1;#10start=1;#20start=0;#30reset_bar=0;#50reset_bar=1;#80start=1;#90start=0;#130start=1;#140start=0;#180start=1;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1706.46moduleProb_6_46(outputreg[0:3]timer,inputclk,reset_b);always@(negedgeclk,negedgereset_b)if(reset_b==0)timer<=4"b1000;elsecase(timer)4"b1000:timer<=4"b0100;4"b0100:timer<=4"b0010;4"b0010:timer<=4"b0001;4"b0001:timer<=4"b1000;default:timer<=4"b1000;endcase课后答案网endmodulemodulet_Prob_6_46();wirewww.hackshp.cn[0:3]timer;regclk,reset_b;Prob_6_46M0(timer,clk,reset_b);initial#150$finish;initialfork#1reset_b=0;#7reset_b=1;joininitialbeginclk=1;forever#5clk=~clk;endendmodule060120Nameclkreset_btimer[0:3]84218421842184timer[0]timer[1]timer[2]timer[3]6.47moduleProb_6_47(outputregP_odd,inputD_in,CLK,reset);wireD;assignD=D_in^P_odd;always@(posedgeCLK,posedgereset)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.171if(reset)P_odd<=0;elseP_odd<=D;endmodulemodulet_Prob_6_47();wireP_odd;regD_in,CLK,reset;Prob_6_47M0(P_odd,D_in,CLK,reset);initial#150$finish;initialfork#1reset=1;#7reset=0;joininitialbeginCLK=0;forever#5CLK=~CLK;endinitialbeginD_in=1;forever#20D_in=~D_in;endendmodule060120NameCLKresetD_inP_odd课后答案网6.48(a)moduleProb_6_48a(www.hackshp.cnoutputreg[7:0]count,inputclk,reset_b);reg[3:0]state;always@(posedgeclk,negedgereset_b)if(reset_b==0)state<=0;elsestate<=state+1;always@(state)case(state)0,2,4,6,8,10,12:count=8"b0000_0001;1:count=8"b0000_0010;3:count=8"b0000_0100;5:count=8"b0000_1000;7:count=8"b0001_0000;9:count=8"b0010_0000;11:count=8"b0100_0000;13:count=8"b1000_0000;default:count=8"b0000_0000;endcaseendmodulemodulet_Prob_6_48a();wire[7:0]count;regclk,reset_b;Prob_6_48aM0(count,clk,reset_b);initial#200$finish;initialbeginclk=0;forever#5clk=~clk;endinitialbeginreset_b=0;#2reset_b=1;endendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.172060120180Nameclkreset_bstate[3:0]123456789abcdef0123count[7:0]020104010801100120014001800001020104count[7]count[6]count[5]count[4]count[3]count[2]count[1]count[0](b)moduleProb_6_48b(outputreg[7:0]count,inputclk,reset_b);reg[3:0]state;always@(posedgeclk,negedgereset_b)if(reset_b==0)state<=0;elsestate<=state+1;always@(state)case(state)0,2,4,6,8,10,12:count=8"b1000_0000;1:课后答案网count=8"b0100_0000;3:count=8"b0010_0000;5:count=8"b0001_0000;7:count=8"b0000_1000;9:count=8"b0000_0100;11:count=8"b0000_0010;13:www.hackshp.cncount=8"b0000_0001;default:count=8"b0000_0000;endcaseendmodulemodulet_Prob_6_48b();wire[7:0]count;regclk,reset_b;Prob_6_48bM0(count,clk,reset_b);initial#180$finish;initialbeginclk=0;forever#5clk=~clk;endinitialbeginreset_b=0;#2reset_b=1;endendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.173060120180Nameclkreset_bstate[3:1]012345670count[7:0]40802080108008800480028001008040count[7]count[6]count[5]count[4]count[3]count[2]count[1]count[0]6.49//Behavioraldescriptionofa4-bituniversalshiftregister//Fig.6.7andTable6.3moduleShift_Register_4_beh(//V2001,2005outputreg[3:0]A_par,//Registeroutputinput[3:0]I_par,//Parallelinputinputs1,s0,//SelectinputsMSB_in,LSB_in,//Serialinputs课后答案网CLK,Clear//ClockandClear);always@(posedgeCLK,negedgeClear)//V2001,2005if(~Clear)A_par<=4"b0000;elsecase({s1,s0})www.hackshp.cn2"b00:A_par<=A_par;//Nochange2"b01:A_par<={MSB_in,A_par[3:1]};//Shiftright2"b10:A_par<={A_par[2:0],LSB_in};//Shiftleft2"b11:A_par<=I_par;//ParallelloadofinputendcaseendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.174//Testplan://testresetactionload//testparallelload//testshiftright//testshiftleft//testcirculationofdata//testresetontheflymodulet_Shift_Register_4_beh();regs1,s0,//SelectinputsMSB_in,LSB_in,//Serialinputsclk,reset_b;//ClockandClearreg[3:0]I_par;//Parallelinputwire[3:0]A_par;//RegisteroutputShift_Register_4_behM0(A_par,I_par,s1,s0,MSB_in,LSB_in,clk,reset_b);initial#200$finish;initialbeginclk=0;forever#5clk=~clk;endinitialfork//testresetactionload#3reset_b=1;#4reset_b=0;#9reset_b=1;//testparallelload课后答案网#10I_par=4"hA;#10{s1,s0}=2"b11;//testshiftright#30MSB_in=1"b0;www.hackshp.cn#30{s1,s0}=2"b01;//testshiftleft#80LSB_in=1"b1;#80{s1,s0}=2"b10;//testcirculationofdata#130{s1,s0}=2"b11;#140{s1,s0}=2"b00;//testresetonthefly#150reset_b=1"b0;#160reset_b=1"b1;#160{s1,s0}=2"b11;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.175060120180Nameclkreset_bI_par[3:0]xaMSB_inLSB_inA_par[3:0]0a5210137fa0as1s0ResetA_parShiftleftLoadA_parResetLoad_A_parNochangeLoadA_parShiftright6.50(a)Seeproblem6.27.moduleProb_8_50a(outputreg[2:0]count,inputclk,reset_b);always@(posedgeclk,negedgereset_b)if(!reset_b)count<=0;elsecase(count)3"d0:count<=3"d1;3"d1:count<=3"d2;课后答案网3"d2:count<=3"d3;3"d3:count<=3"d4;3"d4:count<=3"d5;3"d5:count<=3"d6;3"d4:count<=3"d6;www.hackshp.cn3"d6:count<=3"d0;default:count<=3"d0;endcaseendmodulemodulet_Prob_8_50a;wire[2:0]count;regclock,reset_b;Prob_8_50aM0(count,clock,reset_b);initial#130$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_b=0;#2reset_b=1;#40reset_b=0;#42reset_b=1;joinendmodule04080120Nameclockreset_bcount[2:0]012340123456012DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.176(b)Seeproblem6.28.moduleProb_8_50b(outputreg[2:0]count,inputclk,reset_b);always@(posedgeclk,negedgereset_b)if(!reset_b)count<=0;elsecase(count)3"d0:count<=3"d1;3"d1:count<=3"d2;3"d2:count<=3"d4;3"d4:count<=3"d6;3"d6:count<=3"d0;default:count<=3"d0;endcaseendmodulemodulet_Prob_8_50b;wire[2:0]count;regclock,reset_b;Prob_8_50bM0(count,clock,reset_b);initial#100$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_b=0;#2reset_b=1;课后答案网#40reset_b=0;#42reset_b=1;joinendmodulewww.hackshp.cn0306090reset_bclockcount[2:0]0124601246016.51moduleSeq_Detector_Prob_5_51(outputdetect,inputbit_in,clk,reset_b);reg[2:0]sample_reg;assigndetect=(sample_reg==3"b111);always@(posedgeclk,negedgereset_b)if(reset_b==0)sample_reg<=0;elsesample_reg<={bit_in,sample_reg[2:1]};endmodulemoduleSeq_Detector_Prob_5_45(outputdetect,inputbit_in,clk,reset_b);parameterS0=0,S1=1,S2=2,S3=3;reg[1:0]state,next_state;assigndetect=(state==S3);always@(posedgeclk,negedgereset_b)if(reset_b==0)state<=S0;elsestate<=next_state;always@(state,bit_in)beginnext_state=S0;case(state)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1770:if(bit_in)next_state=S1;elsestate=S0;1:if(bit_in)next_state=S2;elsenext_state=S0;2:if(bit_in)next_state=S3;elsestate=S0;3:if(bit_in)next_state=S3;elsenext_state=S0;default:next_state=S0;endcaseendendmodulemodulet_Seq_Detector_Prob_6_51();wiredetect_45,detect_51;regbit_in,clk,reset_b;Seq_Detector_Prob_5_51M0(detect_51,bit_in,clk,reset_b);Seq_Detector_Prob_5_45M1(detect_45,bit_in,clk,reset_b);initial#350$finish;initialbeginclk=0;forever#5clk=~clk;endinitialforkreset_b=0;#4reset_b=1;#10bit_in=1;#20bit_in=0;#30bit_in=1;#50bit_in=0;#60bit_in=1;课后答案网#100bit_in=0;joinendmodule060120Namewww.hackshp.cnclkreset_bbit_indetect_51detect_45Thecircuitusingashiftregisteruseslesshardware.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.178Chapter7137.1(a)8Kx32=2x16A=13D=1631(b)2Gx8=2x8A=31D=824(c)16Mx32=2x32A=24D=3218(d)256Kx64=2x64A=18D=64(e)133126217.2(a)2(b)2(c)2(d)27.3723=512+128+64+16+2+13451=2048+1024+256+64+32+16+8+2+1Address:1011010011=2D316Data:0000110101111011=0D7B16-8-1-9-17.4fCPU=100MHz,TCPU=1/fCPU=10Hz=10x10Hz=10ns课后答案网25ns10ns10ns10nsCPUclockwww.hackshp.cnT1T2T3AddressAddressvalidMemoryselectDatafromCPUDatavalidforwriteDatafrommemoryDatavalidforread7.5//TestingthememoryofHDLExample7.1.modulet_memory();regEnable,ReadWrite;reg[3:0]DataIn;reg[5:0]Address;wire[3:0]DataOut;memoryM0(Enable,ReadWrite,Address,DataIn,DataOut);initial#200$finish;initialbeginEnable=0;ReadWrite=0;Address=3;DataIn=5;repeat(8)#5Enable=~Enable;endinitialbeginDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.179#10Address=43;DataIn=10;#10ReadWrite=1;#10Address=0;endinitial$monitor("E=%bRW=%bAdd=%bD_in=%bD_out=%bT=%d",Enable,ReadWrite,Address,DataIn,DataOut,$time);wiremem0=M0.Mem[0];wiremem1=M0.Mem[1];wiremem2=M0.Mem[2];wiremem3=M0.Mem[3];wiremem4=M0.Mem[4];wiremem5=M0.Mem[5];wiremem40=M0.Mem[40];wiremem41=M0.Mem[41];wiremem42=M0.Mem[42];wiremem43=M0.Mem[43];wiremem44=M0.Mem[44];wiremem45=M0.Mem[45];endmodule//ReadandwriteoperationsofMem//Memsizeis64wordsof4bitseach.modulememory(Enable,ReadWrite,Address,DataIn,DataOut);inputEnable,ReadWrite;input[3:0]DataIn;课后答案网input[5:0]Address;output[3:0]DataOut;reg[3:0]DataOut;reg[3:0]Mem[0:63];//64x4Memalways@www.hackshp.cn(EnableorReadWrite)if(Enable)if(ReadWrite)DataOut=Mem[Address];//ReadelseMem[Address]=DataIn;//WriteelseDataOut=4"bz;//HighimpedancestateendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.180Name0306090Address[5:0]002b00ReadWriteEnableDataIn[3:0]5aDataOut[3:0]zaz5zMem[0][3:0]x5Mem[1][3:0]xMem[2][3:0]xMem[3][3:0]xMem[4][3:0]xMem[5][3:0]xMem[40][3:0]xMem[41][3:0]xMem[42][3:0]xMem[43][3:0]xaMem[44][3:0]xMem[45][3:0]x7.6课后答案网8Datainputlines8www.hackshp.cn44R/W33A0A4x4RAM4x4RAM1A"2A2EA"2E4444334x4RAM4x4RAMA2EAE24488DataoutputlinesDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.18114777.7(a)16K=2=2x2=128x128Eachdecoderis7ì128Decodersrequire256ANDgates,eachwith7inputs(b)6,000=0101110_1110000x=46y=1127.8(a)256K/32K=8chips18(b)256K=2(18addresslinesformemory);32K=215(15addresspins/chip)(c)18–15=3lines;mustdecodewith3ì8decoder257.913+12=25addresslines.Memorycapacity=2words.7.1001011011=12345678910111213P1P20P4101P81011P13P1=Xorofbits(3,5,7,9,11)=0,1,1,1,1=0(Note:even#of0s)P2=Xorofbits(3,6,7,10,11)=0,0,1,0,1=0P4=Xorofbits(5,6,7,12)=1,0,1,1=1(Note:odd#of0s)P8=Xorofbits(9,10,11,12)=1,0,1,1,=1Composite13-bitcodeword:0001101110111课后答案网7.1111001001010=123456789101112131415P1P21P4100P81001010P1=Xorofbits(3,5,7,9,11,13,15)=1,1,0,1,0,0,0=1www.hackshp.cn(Note:odd#of0s)P2=Xorofbits(3,6,7,10,11,14,15)=1,0,0,0,0,1,0=0(Note:even#of0s)P4=Xorofbits(5,6,7,12,13,14,15)=1,0,0,1,0,1,0=1P8=Xorofbits(9,10,11,12,13,14,15)=1,0,0,1,0,1,0=1Composite15-bitcodeword:1011100110010107.12(a)123456789101112000011101010C1(1,3,5,7,9,11)=0,0,1,1,1,1=0C2(2,3,6,7,10,11)=0,0,1,1,0,1=1C4(4,5,6,7,12)=0,1,1,1,0=1C8(8,9,10,11,12)=0,1,0,1,0=0C=0110Errorinbit6.Correctdata:01011010(b)123456789101112101110000110C1(1,3,5,7,9,11)=1,1,1,0,0,1=0C2(2,3,6,7,10,11)=0,1,0,0,1,1=1C4(4,5,6,7,12)=1,1,0,0,0=0C8(8,9,10,11,12)=0,0,1,1,0=0DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.182C=0010Errorinbit2=ParitybitP2.35679101112Correct8-bitdata:11000110(c)123456789101112101111110100C=0000)Noerrors)C1(1,3,5,7,9,11)=1,1,1,0,0,1=0C2(2,3,6,7,10,11)=0,1,0,0,1,1=1C4(4,5,6,7,12)=1,1,0,0,0=0C8(8,9,10,11,12)=0,0,1,1,0=035679101112Correct8-bitdata:111101007.13(a)16-bitdata(FromTable7.2):5Checkbits1bit----------------6paritybits(b)32-bitdata(FromTable7.2):6Checkbits1课后答案网bit----------------7paritybits(6)16-bitdata(FromTable7.2):5Checkbits1www.hackshp.cnbit----------------6paritybits7.14(a)1234567P1=Xor(3,5,7)=0,0,0=1P1P20P4010P2=Xor(3,6,7)=0,1,0=0P4=Xor(5,6,7)=0,1,0=17-bitword:0101010(b)Noerror:C1=Xor(1,3,5,7)=0,0,0,0=0C2=Xor(2,3,6,7)=1,0,1,0=0C4=Xor(4,5,6,7)=1,0,1,0=0(c)Errorinbit5:12345670101110C1=Xor(0,0,1,0)=1C2=Xor(1,0,1,0)=0C4=Xor(1,1,1,0)=1Errorinbit5:C=101DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.183(d)8-bitword1234567801010101Errorinbits2and5:00011101C1=Xor(0,0,1,0)=1C2=Xor(0,0,1,0)=1C4=Xor(1,1,1,0)=1P=0C=(1,1,1)ò0andP=0indicatesdoubleerror.7.1566666Address(8bits)2x4DecoderEnEnEnEn64x8ROM64x8ROM64x8ROM64x8ROM8888Data8(8bits)课后答案网Note:Outputsmustbewired-ORorthree-stateoutputs.7.16www.hackshp.cnNote:4096=212PwrGnd4096x8InputsOutputs12ROM8CS16inputs+8outputsrequiresa24-pinIC.7.18(a)256ì8(b)512ì5(c)1024ì4(d)32ì77.17InputAddressOutputofROMIIIIIDDDDDDD(20)Decimal543216543210000000000000,10,1000010000010,12,3…………………………010000010110,116,17010010011000,118,19…………………………111101100000,160,61111111100010,162,6387.18(a)8inputs8outputs2x8256x8ROM9(b)9inputs5outputs2x5512x5ROMDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.18410(c)10inputs4outputs2x41024x4ROM5(d)5inputs7outputs2x732x7ROM7.19yzyyzyxx0001111000011110mmmmmmmm013201320010101100mmmmmmmm45764576x11001x10011zzA=yz"+xz"+x"y"zB=xy+x"y"A"=yz+xz+x"y"z"B"=x"y"+x"yyzyyzyxx0001111000011110mmmmmmmm013201320000100111mmmmmmmm45764576x课后答案网10001x10110zzC=yz"D=z+x"yC"=y"+zD"=y"z"+xz"Outputswww.hackshp.cnProductInputsABCDtermxyzyz"1-101-1-xz"21-01---x"y"z30011---xy"410--1--x"y501--1-1z6--1---1TCTT7.20InputsOutputsxyzA,B,C,D00011010010111M[001]=0111010000001110001001001M[100]=1001101001111011001110101DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1857.21Note:SeetruthtableinFig.7.12(b).A1A0A1A1A0A1AA200011110200011110mmmmmmmm013201320000000000mmmmmmmm45764576A10011A1111022AA00F=AAF=AA"+AA12122120F"=A"+A"F"=A"+AA"1212210AAA1AAA11010AA200011110200011110mmmmmmmm013201320001000001mmmmmmmm45764576A10100A1000122AA00F=A"AA+AA"AF=AA"3210210410F"=A"+A"A"+AAF"=A"+A课后答案网302121410ProductInputsOutputstermAAAFFFF2101234AA111-1---21www.hackshp.cnA"220---1--Alternative:F"1,F"2,F3,F4AA"3-10-1-1(5terms)10A"AA4-11--1-210AA"5101--1-21TCTT7.22Decimalwxyzbbbbbbbb7654321000000000000000110001000000012400100000010039001100001001416010000010000525010100011001Note:b=z,andb=0.01636011000100100ROMwouldhave4inputs749011100110001and6outputs.A4x8864100001000000ROMwouldwastetwo981100101010001outputs.101001010011001001112110110111100112144110010010000131691101101010011419611101100010015225111111100001DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.186yzyyzywxwx0001111000011110mmmmmmmm01320132001001mmmmmmmm45764576011011mmmmxmmmmx1213151412131514111111wmmmmwmmmm891110891110101101zzb=yx"b=xy"z+x"yz23yzyyzywxwx0001111000011110mmmmmmmm013201320000mmmmmmmm45764576011110111mmmmxmmmmx12131514121315141111111wmmmmwmmmm891110891110课后答案网10111011zzb4=w"xz+xy"z"+wx"zb5=w"xy+wxz+wx"ywww.hackshp.cnyzyyzywxwx0001111000011110mmmmmmmm013201320000mmmmmmmm457645760101mmmmxmmmmx12131514121315141111111111wmmmmwmmmm89111089111010111110zzb=wy+wx"b=wx67DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1877.23FromFig.4-3:ProductInputsOutputsw=A+BC+BDtermABCDF1F2F3F4w"=A"B"+A"C"D"A11---1---x=B"C+B"D+BC"D"BC2-11-11--x"=B"C"D"+BCBDBD3-1-111--y=CD+C"D"B"C"D"4-000-1--y"=C"D+CD"CD5--11--1-z=D"C"D"6--00--1-z"=DD"7---0---1Usew,x",y,z(7terms)TCTT7.24ANDProductInputstermABCDOutputs11---w=A+BC+BD2-11-3-1-14-01-5-0-1x=B"C+B"D+BC"D"6-1007--11课后答案网8--00y=CD+C"D"9----10---011----z=D"www.hackshp.cn12----DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1887.25yzyyzyxx0001111000011110mmmmmmmm013201320010101110mmmmmmmm45764576x11001x10011zzA=yz"+xz"+x"y"zB=x"y"+xy+yzyzyyzyxx0001111000011110mmmmmmmm013201320010100111mmmmmmmm45764576x11011x10110zzC=A+xyzD=z+x"yAND课后答案网ProductInputstermxyzAOutputs1-10-A=yz"+xz"+x"y"z21-0-3001-www.hackshp.cn400--511--B=x"y"+xy+yz6011-70--18111-C=A+xyz90---100-1-1101--D=z+x"y12----A=yzÅ+xzÅ+xÅyÅzB=xÅyÅ+xy+yzC=A+xyzD=z+xÅyDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1897.26xx"yy"ACA"LKOE=1SETDQAQCLRxy7.27TheresultsofProb.6.17canbeusedtodeveloptheequationsforathree-bitbinarycounterwithD-typeflip-flops.DA0=A"0DA1=A"1课后答案网A0+A1A"0DA2=A"2A1A0+A2A"1+A2A"0Cout=A2A1A0CAAAwww.hackshp.cnout0120135246789110111231415SETDQA0QCLRclockSETDQA1QCLRclockSETDQA2QCLRclockDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1907.28ABCA"BAC"A"BC"ACABBCF"2F17.29课后答案网ProductInputsOutputtermxyADAx"y"A10011x"yA"20101www.hackshp.cnxy"A"31001xyA41111DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.191CHAPTER88.1(a)Thetransferandincrementoccurconcurrently,i.e.,atthesameclockedge.Afterthetransfer,R2holdsthecontentsthatwereinR1beforetheclockedge,andR2holdsitspreviousvalueincrementedby1.(b)DecrementthecontentofR3byone.(c)If(S1=1),transfercontentofR1toR0.If(S1=0andS2=1),transfercontentofR2toR0.8.2S1clr_RDatapathR0xController...reset_bincr_Ry1xreset_bclock1yyR<=0R<=R+11clr_Rincr_RS3S28.3课后答案网reset_breset_breset_bwww.hackshp.cnS1S1S11xxxadd_by_211S31yS2S2S2R<=R+2S3(a)(b)(c)8.4110111zyxyz11011zz1110101100011100001008.5Theoperationsspecifiedinaflowchartareexecutedsequentially,oneatatime.TheoperationsspecifiedinanASMchartareexecutedconcurrentlyforeachASMblock.Thus,theoperationslistedwithinastatebox,theoperationsspecifiedbyaconditionalbox,andthetransfertothenextstateineachASMblockareexecutedatthesameclockedge.Forexample,inFig.8.5withStart=1andFlag=1,signalFlush_Risasserted.AttheclockedgethestatemovestoS_2,andregisterRisflushed.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.1928.6Note:Inpractice,theasynchronousinputsxandyshouldbesynchronizedtotheclocktoavoidmetastableconditonsintheflip-flops..count<=0reset_bcount<=count-1count<=count+1S_idledecrincr110110{y,x}00S_outS_in01000010{y,x}{y,x}10S_in_out01111100incrDatapath1001count{y,x}xController...decrdecrincry11decrincrreset_b课后答案网clockS_inS_outwww.hackshp.cnS_idleNote:Toavoidcountingapersonmorethanonce,themachinewaitsuntilxoryisde-assertedbeforeincrementingordecrementingthecounter.Themachinealsoaccountsforpersonsenteringandleavingsimultaneously.8.7RTLnotation:S0:Initialstate:if(start=1)then(RAãdata_A,RBãdata_B,gotoS1).S1:{Carry,RA}ãRA+(2’scomplementofRB),gotoS2.S2:If(borrow=0)gotoS0.If(borrow=1)thenRAã(2’scomplementofRA),gotoS0.BlockdiagramandASMDchart:DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.193reset_bS0data_Adata_Bdoneborrow88Reg_A<=data_AstartReg_B<=data_B1DatapathReg_ALoad_A_BLoad_A_B...Reg_A<=Reg_A+~Reg_B+1SubtractReg_BS1Controllerstart...SubtractConvertcarryresultdone...S2reset_bclock8borrowReg_A<=~Reg_A+1result1ConvertmoduleSubtractor_P8_7课后答案网(outputdone,output[7:0]result,input[7:0]data_A,data_B,inputstart,clock,reset_b);Controller_P8_7M0(Load_A_B,Subtract,Convert,done,start,borrow,clock,reset_b);Datapath_P8_7M1(result,borrow,data_A,data_B,Load_A_B,Subtract,Convert,clock,reset_b);endmodulewww.hackshp.cnmoduleController_P8_7(outputregLoad_A_B,Subtract,outputregConvert,outputdone,inputstart,borrow,clock,reset_b);parameterS0=2"b00,S1=2"b01,S2=2"b10;reg[1:0]state,next_state;assigndone=(state==S0);always@(posedgeclock,negedgereset_b)if(!reset_b)state<=S0;elsestate<=next_state;always@(state,start,borrow)beginLoad_A_B=0;Subtract=0;Convert=0;case(state)S0:if(start)beginLoad_A_B=1;next_state=S1;endS1:beginSubtract=1;next_state=S2;endS2:beginnext_state=S0;if(borrow)Convert=1;enddefault:next_state=S0;endcaseendendmodulemoduleDatapath_P8_7(output[7:0]result,outputborrow,input[7:0]data_A,data_B,inputLoad_A_B,Subtract,Convert,clock,reset_b);regcarry;reg[8:0]diff;reg[7:0]RA,RB;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.194assignborrow=carry;assignresult=RA;always@(posedgeclock,negedgereset_b)if(!reset_b)begincarry<=1"b0;RA<=8"b0000_0000;RB<=8"b0000_0000;endelsebeginif(Load_A_B)beginRA<=data_A;RB<=data_B;endelseif(Subtract){carry,RA}<=RA+~RB+1;//Inthestatementabove,themathoftheLHSisdonetothewordlengthoftheLHS//Thestatementbelowismoreexplicitabouthowthemathforsubtractionisdone://elseif(Subtract){carry,RA}<={1"b0,RA}+{1"b1,~RB}+9"b0000_0001;//Ifthe9-thbitisnotconsidered,the2scomplementoperationwillgenerateacarrybit,//andborrowmustbeformedasborrow=~carry.elseif(Convert)RA<=~RA+8"b0000_0001;endendmodule//Testplan–Verify;//Power-upreset//Subtractionwithdata_A>data_B//Subtractionwithdata_A0Mul_BR_x2_CRCR<=0Clr_CRmoduleProb_8_8(outputdone,input[15:0]data_AR,data_BR,inputstart,clock,reset_b);Controller_P8_8M0(Ld_AR_BR,Div_AR_x2_CR,Mul_BR_x2_CR,Clr_CR,done,start,AR_lt_0,AR_gt_0,AR_eq_0,clock,reset_b);Datapath_P8_8M1(Overflow,AR_lt_0,AR_gt_0,AR_eq_0,data_AR,data_BR,Ld_AR_BR,Div_AR_x2_CR,Mul_BR_x2_CR,Clr_CR,clock,reset_b);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.197moduleController_P8_8(outputregLd_AR_BR,Div_AR_x2_CR,Mul_BR_x2_CR,Clr_CR,outputdone,inputstart,AR_lt_0,AR_gt_0,AR_eq_0,clock,reset_b);parameterS0=1"b0,S1=1"b1;regstate,next_state;assigndone=(state==S0);always@(posedgeclock,negedgereset_b)if(!reset_b)state<=S0;elsestate<=next_state;always@(state,start,AR_lt_0,AR_gt_0,AR_eq_0)beginLd_AR_BR=0;Div_AR_x2_CR=0;Mul_BR_x2_CR=0;Clr_CR=0;case(state)S0:if(start)beginLd_AR_BR=1;next_state=S1;endS1:beginnext_state=S0;if(AR_lt_0)Div_AR_x2_CR=1;elseif(AR_gt_0)Mul_BR_x2_CR=1;elseif(AR_eq_0)Clr_CR=1;enddefault:next_state=S0;endcase课后答案网endendmodulemoduleDatapath_P8_8(outputregwww.hackshp.cnOverflow,outputAR_lt_0,AR_gt_0,AR_eq_0,input[15:0]data_AR,data_BR,inputLd_AR_BR,Div_AR_x2_CR,Mul_BR_x2_CR,Clr_CR,clock,reset_b);reg[15:0]AR,BR,CR;assignAR_lt_0=AR[15];assignAR_gt_0=(!AR[15])&&(|AR[14:0]);//Reduction-ORassignAR_eq_0=(AR==16"b0);always@(posedgeclock,negedgereset_b)if(!reset_b)beginAR<=8"b0;BR<=8"b0;CR<=16"b0;endelsebeginif(Ld_AR_BR)beginAR<=data_AR;BR<=data_BR;endelseif(Div_AR_x2_CR)CR<={AR[15],AR[15:1]};//Forcompilerwithoutarithmeticrightshiftelseif(Mul_BR_x2_CR){Overflow,CR}<=(BR<<1);elseif(Clr_CR)CR<=16"b0;endendmodule//Testplan–Verify;//Power-upreset//IfAR<0divideARby2andtransfertoCR//IfAR>0multiplyARby2andtransfertoCR//IfAR=0clearCR//Reseton-the-flyDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.198modulet_Prob_P8_8;wiredone;reg[15:0]data_AR,data_BR;regstart,clock,reset_b;reg[15:0]AR_mag,BR_mag,CR_mag;//Toillustrate2scomplementmath//Probesfordisplayingmagnitudeofnumbersalways@(M0.M1.AR)//Hierarchicaldereferencingif(M0.M1.AR[15])AR_mag=~M0.M1.AR+16"d1;elseAR_mag=M0.M1.AR;always@(M0.M1.BR)if(M0.M1.BR[15])BR_mag=~M0.M1.BR+16"d1;elseBR_mag=M0.M1.BR;always@(M0.M1.CR)if(M0.M1.CR[15])CR_mag=~M0.M1.CR+16"d1;elseCR_mag=M0.M1.CR;Prob_8_8M0(done,data_AR,data_BR,start,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_b=0;//Power-upreset#2reset_b=1;#50reset_b=0;//Reseton-the-fly#52reset_b=1;#90reset_b=1;#92reset_b=1;join课后答案网initialfork#20start=1;#30start=0;#70start=1;#110start=1;www.hackshp.cnjoininitialforkdata_AR=16"d50;//AR>0data_BR=16"d20;//Resultshouldbe40#50data_AR=16"d20;#50data_BR=16"d50;//Resultshouldbe100#100data_AR=16"d50;#100data_BR=16"d50;#130data_AR=16"d0;//AR=0,resultshouldclearCR#160data_AR=-16"d20;//AR<0,Verilogstores16-bit2scomplement#160data_BR=16"d50;//Resultshouldhavemagnitude10#190data_AR=16"d20;//AR<0,Verilogstores16-bit2scomplement#190data_BR=16"hffff;//ResultshouldhaveoverflowjoinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.199Reseton-the-flyName060120180240reset_bclockstartDivideby2andxfertoCRMultiplyby2andxfertoCRAR_lt_0AR_gt_0AR_eq_0stateLd_AR_BRDiv_AR_x2_CRMul_BR_x2_CRClr_CRdonedata_AR[15:0]50205006551620AR[15:0]课后答案网0500205006551620AR[15:0]000000320000001400320000ffec0014AR_mag[15:0]05002050020data_BR[15:0]www.hackshp.cn205065535BR[15:0]02005065535BR[15:0]0000001400000032ffffBR_mag[15:0]0200501CR[15:0]040010006552665534CR[15:0]0000000000640000fff6fffeCR_mag[15:0]04001000102OverflowDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2008.9Designequations:DS_idle=S_2+S_idleStart"DS_1=S_idleStart+S_1(A2A3)"DS_2=A2A3S_1HDLdescription:moduleProb_8_9(outputE,F,output[3:0]A,outputA2,A3,inputStart,clock,reset_b);Controller_Prob_8_9M0(set_E,clr_E,set_F,clr_A_F,incr_A,Start,A2,A3,clock,reset_b);Datapath_Prob_8_9M1(E,F,A,A2,A3,set_E,clr_E,set_F,clr_A_F,incr_A,clock,reset_b);endmodule//Structuralversionofthecontroller(one-hot)//Notethattheflip-flopforS_idlemusthaveasetinputandreset_biswiretotheset//SimulationresultsmatchFig.8-13moduleController_Prob_8_9(outputset_E,clr_E,set_F,clr_A_F,incr_A,inputStart,A2,A3,clock,reset_b);wireD_S_idle,D_S_1,D_S_2;wireq_S_idle,q_S_1,q_S_2;课后答案网wirew0,w1,w2,w3;wire[2:0]state={q_S_2,q_S_1,q_S_idle};//Next-StateLogicor(D_S_idle,q_S_2,w0);www.hackshp.cn//inputtoD-typeflip-flopforq_S_idleand(w0,q_S_idle,Start_b);not(Start_b,Start);or(D_S_1,w1,w2,w3);//inputtoD-typeflip-flopforq_S_1and(w1,q_S_idle,Start);and(w2,q_S_1,A2_b);not(A2_b,A2);and(w3,q_S_1,A2,A3_b);not(A3_b,A3);and(D_S_2,A2,A3,q_S_1);//inputtoD-typeflip-flopforq_S_2D_flop_SM0(q_S_idle,D_S_idle,clock,reset_b);D_flopM1(q_S_1,D_S_1,clock,reset_b);D_flopM2(q_S_2,D_S_2,clock,reset_b);//OutputLogicand(set_E,q_S_1,A2);and(clr_E,q_S_1,A2_b);buf(set_F,q_S_2);and(clr_A_F,q_S_idle,Start);buf(incr_A,q_S_1);endmodulemoduleD_flop(outputregq,inputdata,clock,reset_b);always@(posedgeclock,negedgereset_b)if(!reset_b)q<=1"b0;elseq<=data;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.201moduleD_flop_S(outputregq,inputdata,clock,set_b);always@(posedgeclock,negedgeset_b)if(!set_b)q<=1"b1;elseq<=data;endmodule/*//RTLVersionofthecontroller//SimulationresultsmatchFig.8-13moduleController_Prob_8_9(outputregset_E,clr_E,set_F,clr_A_F,incr_A,inputStart,A2,A3,clock,reset_b);parameterS_idle=3"b001,S_1=3"b010,S_2=3"b100;//One-hotreg[2:0]state,next_state;always@(posedgeclock,negedgereset_b)if(!reset_b)state<=S_idle;elsestate<=next_state;always@(state,Start,A2,A3)beginset_E=1"b0;clr_E=1"b0;set_F=1"b0;clr_A_F=1"b0;incr_A=1"b0;case(state)S_idle:课后答案网if(Start)beginnext_state=S_1;clr_A_F=1;endelsenext_state=S_idle;S_1:beginincr_A=1;www.hackshp.cnif(!A2)beginnext_state=S_1;clr_E=1;endelsebeginset_E=1;if(A3)next_state=S_2;elsenext_state=S_1;endendS_2:beginnext_state=S_idle;set_F=1;enddefault:next_state=S_idle;endcaseendendmodule*/moduleDatapath_Prob_8_9(outputregE,F,outputreg[3:0]A,outputA2,A3,inputset_E,clr_E,set_F,clr_A_F,incr_A,clock,reset_b);assignA2=A[2];assignA3=A[3];always@(posedgeclock,negedgereset_b)beginif(!reset_b)beginE<=0;F<=0;A<=0;endelsebeginif(set_E)E<=1;if(clr_E)E<=0;if(set_F)F<=1;if(clr_A_F)beginA<=0;F<=0;endif(incr_A)A<=A+1;endendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.202//TestPlan-Verify:(1)Power-upreset,(2)matchASMDchartinFig.8-9(d),//(3)recoverfromreseton-the-flymodulet_Prob_8_9;wireE,F;wire[3:0]A;wireA2,A3;regStart,clock,reset_b;Prob_8_9M0(E,F,A,A2,A3,Start,clock,reset_b);initial#500$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialfork#20Start=1;#40reset_b=0;#62reset_b=1;joinendmodule8.10reset_b课后答案网s0x1www.hackshp.cns110ys3s200xx1110yy1moduleProb_8_10(inputx,y,clock,reset_b);reg[1:0]state,next_state;parameters0=2"b00,s1=2"b01,s2=2"b10,s3=2"b11;always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=s0;elsestate<=next_state;always@(state,x,y)beginnext_state=s0;case(state)s0:if(x==0)next_state=s0;elsenext_state=s1;s1:if(y==0)next_state=s2;elsenext_state=s3;s2:if(x==0)next_state=s0;elseif(y==0)next_state=s2;elsenext_state=s3;s3:if(x==0)next_state=s0;elseif(y==0)next_state=s2;elsenext_state=s3;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.203modulet_Prob_8_10();regx,y,clock,reset_b;Prob_8_10M0(x,y,clock,reset_b);initial#150$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_b=0;#12reset_b=1;x=0;y=0;//Remainins0#10y=1;//Remainins0#20x=1;//Gotos1tos3#40reset_b=0;//Gotos0#42reset_b=1;//Gotos2tos3#60y=0;//Gotos2#80y=1;//Gotos3#90x=0;//Gotos0#100x=1;//Gotos1#110y=0;//Gotos2#130x=0;//Gotos0joinendmodule050100150Name课后答案网clockreset_bxwww.hackshp.cnystate[1:0]013013230120DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2048.11DA=AÅB+AxDB=AÅBÅx+AÅBy+xyxyxnextABstateinputsstate00011110mmmm013200000000000100mmmm0010014576011111001101mmmmB121315140100101111010111Ammmm0110108911101011011111100000y100100D=A"B+AxA101010xyx101111AB00011110mmmm11000001320011110100111010mmmm45761111110111课后答案网mmmmB12131514111Ammmm891110www.hackshp.cn101yD=A"B"x+A"By+xyB8.12ModifythecounterinFig.6.12toaddasignal,Clear,toclearthecountersynchronously,asshowninthecircuitdiagrambelow.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.205CountenableJQA0ClearKQBJQA1KQBJQA2KQBJQA课后答案网3www.hackshp.cnKQBTonextstageCLKmoduleCounter_4bit_Synch_Clr(output[3:0]A,outputnext_stage,inputCount_enable,Clear,CLK);wireA0,A1,A2,A3;assignA[3:0]={A3,A2,A1,A0};JK_FFM0(A0,J0,K0,CLK);JK_FFM1(A1,J1,K1,CLK);JK_FFM2(A2,J2,K2,CLK);JK_FFM3(A3,J3,K3,CLK);not(Clear_b,Clear);and(J0,Count_enable,Clear_b);and(J1,J0,A0);and(J2,J1,A1);and(J3,J2,A2);or(K0,Clear,J0);or(K1,Clear,J1);or(K2,Clear,J2);or(K3,Clear,J3);and(next_stage,A3,J3);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.206moduleJK_FF(outputregQ,inputJ,K,clock);always@(posedgeclock)case({J,K})2"b00:Q<=Q;2"b01:Q<=0;2"b10:Q<=1;2"b11:Q<=~Q;endcaseendmodulemodulet_Counter_4bit_Synch_Clr();wire[3:0]A;wirenext_stage;regCount_enable,Clear,clock;Counter_4bit_Synch_ClrM0(A,next_stage,Count_enable,Clear,clock);initial#300$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkClear=1;Count_enable=0;#12Clear=0;#20Count_enable=1;#180Clear=1;#190Clear=0;#230Count_enable=0;课后答案网joinendmoduleNamewww.hackshp.cn050100150200250clockClearCount_enableJ0K0A0J1K1A1J2K2A2J3K3A3A[3:0]x012345678910111213141501234next_stage8.13//Structuraldescriptionofdesignexample(Fig.8-10,8-12)moduleDesign_Example_STR(output[3:0]A,outputE,F,inputStart,clock,reset_b);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.207Controller_STRM0(clr_A_F,set_E,clr_E,set_F,incr_A,Start,A[2],A[3],clock,reset_b);Datapath_STRM1(A,E,F,clr_A_F,set_E,clr_E,set_F,incr_A,clock);endmodulemoduleController_STR(outputclr_A_F,set_E,clr_E,set_F,incr_A,inputStart,A2,A3,clock,reset_b);wireG0,G1;parameterS_idle=2"b00,S_1=2"b01,S_2=2"b11;wirew1,w2,w3;not(G0_b,G0);not(G1_b,G1);buf(incr_A,w2);buf(set_F,G1);not(A2_b,A2);or(D_G0,w1,w2);and(w1,Start,G0_b);and(clr_A_F,G0_b,Start);and(w2,G0,G1_b);and(set_E,w2,A2);and(clr_E,w2,A2_b);and(D_G1,w3,w2);and(w3,A2,A3);课后答案网D_flip_flop_ARM0(G0,D_G0,clock,reset_b);D_flip_flop_ARM1(G1,D_G1,clock,reset_b);endmodule//datapathunitwww.hackshp.cnmoduleDatapath_STR(output[3:0]A,outputE,F,inputclr_A_F,set_E,clr_E,set_F,incr_A,clock);JK_flip_flop_2M0(E,E_b,set_E,clr_E,clock);JK_flip_flop_2M1(F,F_b,set_F,clr_A_F,clock);Counter_4M2(A,incr_A,clr_A_F,clock);endmodulemoduleCounter_4(outputreg[3:0]A,inputincr,clear,clock);always@(posedgeclock)if(clear)A<=0;elseif(incr)A<=A+1;endmodulemoduleD_flip_flop_AR(Q,D,CLK,RST);outputQ;inputD,CLK,RST;regQ;always@(posedgeCLK,negedgeRST)if(RST==0)Q<=1"b0;elseQ<=D;endmodulemoduleJK_flip_flop_2(Q,Q_not,J,K,CLK);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.208outputQ,Q_not;inputJ,K,CLK;regQ;assignQ_not=~Q;always@(posedgeCLK)case({J,K})2"b00:Q<=Q;2"b01:Q<=1"b0;2"b10:Q<=1"b1;2"b11:Q<=~Q;endcaseendmodulemodulet_Design_Example_STR;regStart,clock,reset_b;wire[3:0]A;wireE,F;wire[1:0]state_STR={M0.M0.G1,M0.M0.G0};Design_Example_STRM0(A,E,F,Start,clock,reset_b);initial#500$finish;initial课后答案网beginreset_b=0;Start=0;clock=0;#5reset_b=1;Start=1;www.hackshp.cnrepeat(32)begin#5clock=~clock;endendinitial$monitor("A=%bE=%bF=%btime=%0d",A,E,F,$time);endmoduleThesimulationresultsshownbelowmatchFig.8.13.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.209Name050100150200clockreset_bStartA2A3state_STR[1:0]01301clr_A_Fset_Eclr_Eset_Fincr_AA[3:0]x0123456789abcd0EF8.14Thestatecode2"b10isunused.Ifthemachineentersanunusedstate,thecontrolleriswrittenwithdefaultassignmenttonext_state.ThedefaultassignmentforcesthestatetoS_idle,sothemachinerecoversfromthecondition.课后答案网8.15Modifythetestbenchtoinsertareseteventandextendtheclock.//RTLdescriptionofdesignexample(seeFig.8-11)moduleDesign_Example_RTL(A,E,F,www.hackshp.cnStart,clock,reset_b);//Specifyportsofthetop-levelmoduleofthedesign//SeeblockdiagramFig.8-10output[3:0]A;outputE,F;inputStart,clock,reset_b;//InstantiatecontrolleranddatapathunitsController_RTLM0(set_E,clr_E,set_F,clr_A_F,incr_A,A[2],A[3],Start,clock,reset_b);Datapath_RTLM1(A,E,F,set_E,clr_E,set_F,clr_A_F,incr_A,clock);endmodulemoduleController_RTL(set_E,clr_E,set_F,clr_A_F,incr_A,A2,A3,Start,clock,reset_b);outputregset_E,clr_E,set_F,clr_A_F,incr_A;inputStart,A2,A3,clock,reset_b;reg[1:0]state,next_state;parameterS_idle=2"b00,S_1=2"b01,S_2=2"b11;//Statecodesalways@(posedgeclockornegedgereset_b)//Statetransitions(edge-sensitive)if(reset_b==0)state<=S_idle;elsestate<=next_state;//CodenextstatelogicdirectlyfromASMDchart(Fig.8-9d)always@(state,Start,A2,A3)begin//Nextstatelogic(level-sensitive)next_state=S_idle;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.210case(state)S_idle:if(Start)next_state=S_1;elsenext_state=S_idle;S_1:if(A2&A3)next_state=S_2;elsenext_state=S_1;S_2:next_state=S_idle;default:next_state=S_idle;endcaseend//CodeoutputlogicdirectlyfromASMDchart(Fig.8-9d)always@(state,Start,A2)beginset_E=0;//defaultassignments;assignbyexceptionclr_E=0;set_F=0;clr_A_F=0;incr_A=0;case(state)S_idle:if(Start)clr_A_F=1;S_1:beginincr_A=1;if(A2)set_E=1;elseclr_E=1;endS_2:set_F=1;endcaseendendmodulemoduleDatapath_RTL(A,E,F,set_E,clr_E,set_F,clr_A_F,incr_A,clock);outputreg[3:0]A;//registerforcounteroutputreg课后答案网E,F;//flagsinputset_E,clr_E,set_F,clr_A_F,incr_A,clock;//CoderegistertransferoperationsdirectlyfromASMDchart(Fig.8-9d)always@www.hackshp.cn(posedgeclock)beginif(set_E)E<=1;if(clr_E)E<=0;if(set_F)F<=1;if(clr_A_F)beginA<=0;F<=0;endif(incr_A)A<=A+1;endendmodulemodulet_Design_Example_RTL;regStart,clock,reset_b;wire[3:0]A;wireE,F;//InstantiatedesignexampleDesign_Example_RTLM0(A,E,F,Start,clock,reset_b);//Describestimuluswaveformsinitial#500$finish;//Stopwatchinitialfork#25reset_b=0;//Testforrecoveryfromreseton-the-fly.#27reset_b=1;joininitialbeginreset_b=0;Start=0;clock=0;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.211#5reset_b=1;Start=1;//repeat(32)repeat(38)//Modifyfortestofreset_bon-the-flybegin#5clock=~clock;//Clockgeneratorendendinitial$monitor("A=%bE=%bF=%btime=%0d",A,E,F,$time);endmoduleName04080120160200Defaultclockreset_bStartA2A3state[1:0]0101301clr_A_Fset_Eclr_Eset_Fincr_AA[3:0]x课后答案网010123456789abcd01EF8.16RTLnotation:www.hackshp.cns0:(initialstate)Ifstart=0gobacktostates0,If(start=1)thenBRãmultiplicand,ARãmultiplier,PRã0,gotos1.s1:(checkARforZero)Zero=1ifAR=0,if(Zero=1)thengobacktos0(done)If(Zero=0)thengotos1,PRãPR+BR,ARãAR–1.Theinternalarchitectureofthedatapathconsistsofadouble-widthregistertoholdtheproduct(PR),aregistertoholdthemultiplier(AR),aregistertoholdthemultiplicand(BR),adouble-widthparalleladder,andsingle-widthparalleladder.Thesingle-widthadderisusedtoimplementtheoperationofdecrementingthemultiplierunit.Addingawordconsistingentirelyof1stothemultiplieraccomplishesthe2"scomplementsubtractionof1fromthemultiplier.Figure8.16(a)belowshowstheASMDchart,blockdiagram,andcontrollerofthecircuit.Figure8.16(b)showstheinternalarchitectureofthedatapath.Figure8.16(c)showstheresultsofsimulatingthecircuit.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.212reset_bs0doneAR<=data_Adata_ARdata_BRBR<=data_BstartPR<=016161zeroLd_regsDatapathLd_regsARPR<=PR+BRs1...AR<=AR-1Add_decrBRController...start1PRAdd_decrZerodone...reset_b16clockPRNote:FormZeroastheoutputofanORgatewhoseinputs课后答案网arethebitsoftheregisterAR.Add_decrControllers0=s1"Zerowww.hackshp.cndoneDStartclockreset_bLd_regs(a)ASMDchart,blockdiagram,andcontrollerDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.213data_BR1610Ld_regsmux16BR10All0"s...Add_decrmux32161616data_AR32Note:allregistershaveactive-low10+Ld_regsmuxasynchronousreset3216PRAR............321616muxLd_regs0132+0mux10Add_decr16A//1s课后答案网(b)Datapath04080120160200Namewww.hackshp.cnreset_bclockstartLd_regsAdd_decrzerostatedata_AR[7:0]534data_BR[7:0]209AR[7:0]05432104321040209BR[7:0]donePR[15:0]020406080100091827360(c)SimulationresultsDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.214moduleProb_8_16_STR(output[15:0]PR,outputdone,input[7:0]data_AR,data_BR,inputstart,clock,reset_b);Controller_P8_16M0(done,Ld_regs,Add_decr,start,zero,clock,reset_b);Datapath_P8_16M1(PR,zero,data_AR,data_BR,Ld_regs,Add_decr,clock,reset_b);endmodulemoduleController_P8_16(outputdone,outputregLd_regs,Add_decr,inputstart,zero,clock,reset_b);parameters0=1"b0,s1=1"b1;regstate,next_state;assigndone=(state==s0);always@(posedgeclock,negedgereset_b)if(!reset_b)state<=s0;elsestate<=next_state;always@(state,start,zero)beginLd_regs=0;Add_decr=0;case(state)s0:if(start)beginLd_regs=1;next_state=s1;ends1:if(zero)next_state=s0;elsebeginnext_state=s1;Add_decr=1;enddefault:next_state=s0;endcaseend课后答案网endmodulemoduleRegister_32(output[31:0]data_out,input[31:0]data_in,inputclock,reset_b);Register_8M3(data_out[31:24],data_in[31:24],clock,reset_b);Register_8M2(data_out[23:16],data_in[23:16],clock,reset_b);www.hackshp.cnRegister_8M1(data_out[15:8],data_in[15:8],clock,reset_b);Register_8M0(data_out[7:0],data_in[7:0],clock,reset_b);endmodulemoduleRegister_16(output[15:0]data_out,input[15:0]data_in,inputclock,reset_b);Register_8M1(data_out[15:8],data_in[15:8],clock,reset_b);Register_8M0(data_out[7:0],data_in[7:0],clock,reset_b);endmodulemoduleRegister_8(output[7:0]data_out,input[7:0]data_in,inputclock,reset_b);D_flopM7(data_out[7]data_in[7],clock,reset_b);D_flopM6(data_out[6]data_in[6],clock,reset_b);D_flopM5(data_out[5]data_in[5],clock,reset_b);D_flopM4(data_out[4]data_in[4],clock,reset_b);D_flopM3(data_out[3]data_in[3],clock,reset_b);D_flopM2(data_out[2]data_in[2],clock,reset_b);D_flopM1(data_out[1]data_in[1],clock,reset_b);D_flopM0(data_out[0]data_in[0],clock,reset_b);endmodulemoduleAdder_32(outputc_out,output[31:0]sum,input[31:0]a,b);assign{c_out,sum}=a+b;endmodulemoduleAdder_16(outputc_out,output[15:0]sum,input[15:0]a,b);assign{c_out,sum}=a+b;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.215moduleD_flop(outputq,inputdata,clock,reset_b);always@(posedgeclock,negedgereset_b)if(!reset_b)q<=0;elseq<=data;endmodulemoduleDatapath_P8_16(outputreg[15:0]PR,outputzero,input[7:0]data_AR,data_BR,inputLd_regs,Add_decr,clock,reset_b);reg[7:0]AR,BR;assignzero=~(|AR);always@(posedgeclock,negedgereset_b)if(!reset_b)beginAR<=8"b0;BR<=8"b0;PR<=16"b0;endelsebeginif(Ld_regs)beginAR<=data_AR;BR<=data_BR;PR<=0;endelseif(Add_decr)beginPR<=PR+BR;AR<=AR-1;endendendmodule//Testplan–Verify;//Power-upreset//Dataisloadedcorrectly//Controlsignalsassertcorrectly//Statussignalsassertcorrectly课后答案网//startisignoredwhilemultiplying//Multiplicationiscorrect//Recoveryfromreseton-the-flymodulet_Prob_P8_16;www.hackshp.cnwiredone;wire[15:0]PR;reg[7:0]data_AR,data_BR;regstart,clock,reset_b;Prob_8_16_STRM0(PR,done,data_AR,data_BR,start,clock,reset_b);initial#500$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_b=0;#12reset_b=1;#40reset_b=0;#42reset_b=1;#90reset_b=1;#92reset_b=1;joininitialfork#20start=1;#30start=0;#40start=1;#50start=0;#120start=1;#120start=0;joinDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.216initialforkdata_AR=8"d5;//AR>0data_BR=8"d20;#80data_AR=8"d3;#80data_BR=8"d9;#100data_AR=8"d4;#100data_BR=8"d9;joinendmodulenn2n8.17(2–1)(2–1)<(2–1)forní18.18(a)Themaximumproductsizeis32bitsavailableinregistersAandQ.(b)Pcountermusthave5bitstoload16(binary10000)initially.(c)Z(zero)detectionisgeneratedwitha5-inputNORgate.8.19MultiplicandB=110112=2710MultiplierQ=101112=2310Product:CAQ=62110CAQPMultiplierin课后答案网Q00000010111101Q0=1;addB11011Firstpartialproduct01101110111100ShiftrightCAQ00110111011Q0=1;addB11011Secondpartialproductwww.hackshp.cn10100011011011ShiftrightCAQ01010001101Q0=1;addB11011Thirdpartialproduct10111101101010ShiftrightCAQ01011110110ShiftrightCAQ00101111011Fourthpartialproduct00101111011001Q0=1;addB11011Fifthpartialproduct10011011011000ShiftrightCAQ01001101101FinalproductinAQ:AQ=10011_01101=621108.20S_idle=1tnsTheloopbetweenS_addandS_shifttakes2ntns)Totaltimetomultiply:(2n+1)t8.21DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.217Statecodes:GG10S_idle00S_add01S_shift10unused000011G1Mux_1DZero"2StartLoad_regsC03ss10Q[0]0Add_regs12x4Decoder2Shift_regs3ssStart01001G0Mux_2D0课后答案网2C03clockreset_bwww.hackshp.cn8.22NotethatthemachinedescribedbyFig.P8.22requiresfourstates,butthemachinedescribedbyFig.8.15(b)requiresonlythree.Also,observethatthesamplesimulationresultsshowacasewherethecarrybitregsiter,C,isneededtosupporttheadditionoperation.Thedatapathis8bitswide.moduleProb_8_22#(parameterm_size=9)(output[2*m_size-1:0]Product,outputReady,input[m_size-1:0]Multiplicand,Multiplier,inputStart,clock,reset_b);wire[m_size-1:0]A,Q;assignProduct={A,Q};wireQ0,Zero,Load_regs,Decr_P,Add_regs,Shift_regs;Datapath_UnitM0(A,Q,Q0,Zero,Multiplicand,Multiplier,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);Control_UnitM1(Ready,Decr_P,Load_regs,Add_regs,Shift_regs,Start,Q0,Zero,clock,reset_b);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.218moduleDatapath_Unit#(parameterm_size=9,BC_size=4)(outputreg[m_size-1:0]A,Q,outputQ0,Zero,input[m_size-1:0]Multiplicand,Multiplier,inputLoad_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);regC;reg[BC_size-1:0]P;reg[m_size-1:0]B;assignQ0=Q[0];assignZero=(P==0);always@(posedgeclock,negedgereset_b)if(reset_b==0)beginB<=0;C<=0;A<=0;Q<=0;P<=m_size;endelsebeginif(Load_regs)beginA<=0;C<=0;Q<=Multiplier;B<=Multiplicand;课后答案网P<=m_size;endif(Decr_P)P<=P-1;if(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;www.hackshp.cnendendmodulemoduleControl_Unit(outputReady,Decr_P,outputregLoad_regs,Add_regs,Shift_regs,inputStart,Q0,Zero,clock,reset_b);reg[1:0]state,next_state;parameterS_idle=2"b00,S_loaded=2"b01,S_sum=2"b10,S_shifted=2"b11;assignReady=(state==S_idle);assignDecr_P=(state==S_loaded);always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=S_idle;elsestate<=next_state;always@(state,Start,Q0,Zero)beginnext_state=S_idle;Load_regs=0;Add_regs=0;Shift_regs=0;case(state)S_idle:if(Start==0)next_state=S_idle;elsebeginnext_state=S_loaded;Load_regs=1;endS_loaded:if(Q0)beginnext_state=S_sum;Add_regs=1;endelsebeginnext_state=S_shifted;Shift_regs=1;endS_sum:beginnext_state=S_shifted;Shift_regs=1;endS_shifted:if(Zero)next_state=S_idle;elsenext_state=S_loaded;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.219modulet_Prob_8_22();parameterm_size=9;//Widthofdatapathwire[2*m_size-1:0]Product;wireReady;reg[m_size-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;integerExp_Value;regError;Prob_8_22M0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#140000$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joininitialbegin#5Start=1;endalways@(posedgeReady)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//Injecterrortoconfirmdetectionendalways@(negedgeReady)beginError=(Exp_Value^Product);课后答案网endinitialbegin#5Multiplicand=0;Multiplier=0;www.hackshp.cnrepeat(64)#10beginMultiplier=Multiplier+1;repeat(64)@(posedgeM0.Ready)#5Multiplicand=Multiplicand+1;endendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.220Name7681176861769117696177011clockreset_bReadyStartLoad_regsAdd_regsShift_regsDecr_PQ0Zerostate[1:0]0131231231313131313130131P[3:0]0987654321098B[8:0]177178CA[8:0]0000bb11908c046023011008004000Q[8:0]0031010801400a00501281940ca003Product[17:0]3960017200036000180009000450022503Multiplicand[8:0]375376Multiplier[8:0]6Product[17:0]3960017200036000180009000450022503ReadyExp_Value22442250Error课后答案网8.23AsshowninFig.P8.23themachineassertsLoad_regsinstateS_load.Thiswillcausethemachinetooperateincorrectly.OnceLoad_regsisremovedfromS_loadthemachineoperatescorrectly.ThestateS_loadisawastedstate.Itsremovalleadstowww.hackshp.cnthesamemachineasdhowninFig.P8.15b.moduleProb_8_23#(parameterm_size=9)(output[2*m_size-1:0]Product,outputReady,input[m_size-1:0]Multiplicand,Multiplier,inputStart,clock,reset_b);wire[m_size-1:0]A,Q;assignProduct={A,Q};wireQ0,Zero,Load_regs,Decr_P,Add_regs,Shift_regs;Datapath_UnitM0(A,Q,Q0,Zero,Multiplicand,Multiplier,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);Control_UnitM1(Ready,Decr_P,Shift_regs,Add_regs,Load_regs,Start,Q0,Zero,clock,reset_b);endmodulemoduleDatapath_Unit#(parameterm_size=9,BC_size=4)(outputreg[m_size-1:0]A,Q,outputQ0,Zero,input[m_size-1:0]Multiplicand,Multiplier,inputLoad_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);regC;reg[BC_size-1:0]P;reg[m_size-1:0]B;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.221assignQ0=Q[0];assignZero=(P==0);always@(posedgeclock,negedgereset_b)if(reset_b==0)beginA<=0;C<=0;Q<=0;B<=0;P<=m_size;endelsebeginif(Load_regs)beginA<=0;C<=0;Q<=Multiplier;B<=Multiplicand;P<=m_size;endif(Decr_P)P<=P-1;if(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;endendmodulemoduleControl_Unit(outputReady,Decr_P,Shift_regs,课后答案网outputregAdd_regs,Load_regs,inputStart,Q0,Zero,clock,reset_b);reg[1:0]state,next_state;parameterwww.hackshp.cnS_idle=2"b00,S_load=2"b01,S_decr=2"b10,S_shift=2"b11;assignReady=(state==S_idle);assignShift_regs=(state==S_shift);assignDecr_P=(state==S_decr);always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=S_idle;elsestate<=next_state;always@(state,Start,Q0,Zero)beginnext_state=S_idle;Load_regs=0;Add_regs=0;case(state)S_idle:if(Start==0)next_state=S_idle;elsebeginnext_state=S_load;Load_regs=1;endS_load:beginnext_state=S_decr;endS_decr:beginnext_state=S_shift;if(Q0)Add_regs=1;endS_shift:if(Zero)next_state=S_idle;elsenext_state=S_load;endcaseendendmodulemodulet_Prob_8_23();parameterm_size=9;//Widthofdatapathwire[2*m_size-1:0]Product;wireReady;reg[m_size-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;integerExp_Value;regError;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.222Prob_8_23M0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#140000$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joininitialbegin#5Start=1;endalways@(posedgeReady)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//Injecterrortoconfirmdetectionendalways@(negedgeReady)beginError=(Exp_Value^Product);endinitialbegin#5Multiplicand=0;Multiplier=0;repeat(64)#10beginMultiplier=Multiplier+1;repeat(64)@(posedgeM0.Ready)#5Multiplicand=Multiplicand+1;endend课后答案网endmoduleNamewww.hackshp.cn214032143321463214932152321553clockreset_bReadyStartLoad_regsAdd_regsShift_regsDecr_PQ0Zerostate[1:0]312312312312312301P[3:0]5432109B[8:0]04c04dCA[8:0]013009004002001000Q[8:0]0001001800c0060130098002Product[17:0]4864243212166083041522Multiplicand[8:0]7677Multiplier[8:0]2Product[17:0]4864243212166083041522ReadyExp_Value150152ErrorDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2238.24moduleProb_8_24#(parameterdp_width=5)(output[2*dp_width-1:0]Product,outputReady,input[dp_width-1:0]Multiplicand,Multiplier,inputStart,clock,reset_b);wireLoad_regs,Decr_P,Add_regs,Shift_regs,Zero,Q0;ControllerM0(Ready,Load_regs,Decr_P,Add_regs,Shift_regs,Start,Zero,Q0,clock,reset_b);DatapathM1(Product,Q0,Zero,Multiplicand,Multiplier,Start,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);endmodulemoduleController(outputReady,outputregLoad_regs,Decr_P,Add_regs,Shift_regs,inputStart,Zero,Q0,clock,reset_b);parameterS_idle=3"b001,//one-hotcode课后答案网S_add=3"b010,S_shift=3"b100;reg[2:0]state,next_state;//sizedforone-hotassignReady=(state==S_idle);always@www.hackshp.cn(posedgeclock,negedgereset_b)if(~reset_b)state<=S_idle;elsestate<=next_state;always@(state,Start,Q0,Zero)beginnext_state=S_idle;Load_regs=0;Decr_P=0;Add_regs=0;Shift_regs=0;case(state)S_idle:if(Start)beginnext_state=S_add;Load_regs=1;endS_add:beginnext_state=S_shift;Decr_P=1;if(Q0)Add_regs=1;endS_shift:beginShift_regs=1;if(Zero)next_state=S_idle;elsenext_state=S_add;enddefault:next_state=S_idle;endcaseendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.224moduleDatapath#(parameterdp_width=5,BC_size=3)(output[2*dp_width-1:0]Product,outputQ0,outputZero,input[dp_width-1:0]Multiplicand,Multiplier,inputStart,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);//Defaultconfiguration:5-bitdatapathreg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[BC_size-1:0]P;//BitcounterassignQ0=Q[0];assignZero=(P==0);//CounteriszeroassignProduct={C,A,Q};always@(posedgeclock,negedgereset_b)if(reset_b==0)begin//Addedtothissolution,butP<=dp_width;//notreallynecessarysinceLoad_regsB<=0;//initializesthedatapathC<=0;A<=0;Q<=0;endelsebeginif(Load_regs)beginP<=dp_width;A<=0;C<=0;B<=Multiplicand;课后答案网Q<=Multiplier;endif(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;if(Decr_P)P<=P-1;www.hackshp.cnendendmodulemodulet_Prob_8_24;parameterdp_width=5;//Widthofdatapathwire[2*dp_width-1:0]Product;wireReady;reg[dp_width-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;integerExp_Value;regError;Prob_8_24M0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#115000$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joinalways@(negedgeStart)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//Injecterrortoconfirmdetectionendalways@(posedgeReady)begin#1Error<=(Exp_Value^Product);endDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.225initialbegin#5Multiplicand=0;Multiplier=0;repeat(32)#10beginStart=1;#10Start=0;repeat(32)beginStart=1;#10Start=0;#100Multiplicand=Multiplicand+1;endMultiplier=Multiplier+1;endendendmoduleName4534045380454204546045500clockreset_bStartLoad_regsAdd_regsShift_regsDecr_P课后答案网Q0ZeroP[2:0]1054321054B[4:0]www.hackshp.cn191a1bCA[4:0]1890261371990Q[4:0]180c06030110180cMultiplicand[4:0]252627Multiplier[4:0]12Product[9:0]600300126383541722562431212ReadyExp_Value300312324ErrorDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2268.25(a)ReadyMultiplicandMultiplierresetDatapathEmptyAA<=0Load_regsS_idleC<=0Shift_regsBReadyB<=MultiplicandControllerStartAdd_regsQStartQ<=MultiplierDecr_PP<=m_sizeCP1Load_regsresetP<=P-1clockProductS_addZeroDecr_PQ[0]EmptyClr_P1{C,A}<=A+BRegisterB(Multiplicand)RegisterP(Counter)1110101111000Q[0]708Add_regs+16158870S_shift0000000000010111Shift_regs9CRegister课后答案网A(Sum)RegisterQ(Multiplier){C,A,Q}<={C,A,Q}>>1EmptyZero1www.hackshp.cn1(b)//ThemultiplierofFig.8.15ismodifiedtodetectwhetherthemultiplierormultiplicandareinitiallyzero,//andtodetectwhetherthemultiplierbecomeszerobeforetheentiremultiplierhasbeenapplied//tothemultiplicand.Signalemptyisgeneratedbythedatapathunitandusedbythe//controller.Notethatthebitsoftheproductmustbeselectedaccordingtothestageatwhich//terminationoccurs.Thetestfortheconditionofanemptymultiplierishardwiredherefor//dp_width=5becausetherangeboundsofavectormustbedefinedbyintegerconstants.//Thispreventsdevelopmentofafullyparameterizedmodel.//Note:thetestbenchhasbeenmodified.moduleProb_8_25#(parameterdp_width=5)(output[2*dp_width-1:0]Product,outputReady,input[dp_width-1:0]Multiplicand,Multiplier,inputStart,clock,reset_b);wireLoad_regs,Decr_P,Add_regs,Shift_regs,Empty,Zero,Q0;ControllerM0(Ready,Load_regs,Decr_P,Add_regs,Shift_regs,Start,Empty,Zero,Q0,clock,reset_b);DatapathM1(Product,Q0,Empty,Zero,Multiplicand,Multiplier,Start,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.227moduleController(outputReady,outputregLoad_regs,Decr_P,Add_regs,Shift_regs,inputStart,Empty,Zero,Q0,clock,reset_b);parameterBC_size=3;//SizeofbitcounterparameterS_idle=3"b001,//one-hotcodeS_add=3"b010,S_shift=3"b100;reg[2:0]state,next_state;//sizedforone-hotassignReady=(state==S_idle);always@(posedgeclock,negedgereset_b)if(~reset_b)state<=S_idle;elsestate<=next_state;always@(state,Start,Q0,Empty,Zero)beginnext_state=S_idle;Load_regs=0;Decr_P=0;Add_regs=0;Shift_regs=0;case(state)S_idle:if(Start)beginnext_state=S_add;Load_regs=1;endS_add:beginnext_state=S_shift;Decr_P=1;if(Q0)Add_regs=1;endS_shift:begin课后答案网Shift_regs=1;if(Zero)next_state=S_idle;elseif(Empty)next_state=S_idle;elsenext_state=S_add;enddefault:next_state=S_idle;www.hackshp.cnendcaseendendmodulemoduleDatapath#(parameterdp_width=5,BC_size=3)(outputreg[2*dp_width-1:0]Product,outputQ0,outputEmpty,outputZero,input[dp_width-1:0]Multiplicand,Multiplier,inputStart,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);//Defaultconfiguration:5-bitdatapathparameterS_idle=3"b001,//one-hotcodeS_add=3"b010,S_shift=3"b100;reg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[BC_size-1:0]P;//Bitcounterwire[2*dp_width-1:0]Internal_Product={C,A,Q};assignQ0=Q[0];assignZero=(P==0);//Bitcounteriszeroalways@(posedgeclock,negedgereset_b)if(reset_b==0)begin//Addedtothissolution,butP<=dp_width;//notreallynecessarysinceLoad_regsB<=0;//initializesthedatapathC<=0;A<=0;Q<=0;endDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.228elsebeginif(Load_regs)beginP<=dp_width;A<=0;C<=0;B<=Multiplicand;Q<=Multiplier;endif(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;if(Decr_P)P<=P-1;end//StatussignalsregEmpty_multiplier;wireEmpty_multiplicand=(Multiplicand==0);assignEmpty=Empty_multiplicand||Empty_multiplier;always@(P,Internal_Product)begin//Note:hardwiredfordp_width5Product=0;case(P)//Examinemultiplierbits0:Product=Internal_Product;1:Product=Internal_Product[2*dp_width-1:1];2:Product=Internal_Product[2*dp_width-1:2];3:Product=Internal_Product[2*dp_width-1:3];4:Product=Internal_Product[2*dp_width-1:4];5:Product=0;endcase课后答案网endalways@(P,Q)begin//Note:hardwiredfordp_width5Empty_multiplier=0;case(P)www.hackshp.cn0:Empty_multiplier=1;1:if(Q[1]==0)Empty_multiplier=1;2:if(Q[2:1]==0)Empty_multiplier=1;3:if(Q[3:1]==0)Empty_multiplier=1;4:if(Q[4:1]==0)Empty_multiplier=1;5:if(Q[5:1]==0)Empty_multiplier=1;default:Empty_multiplier=1"bx;endcaseendendmodulemodulet_Prob_8_25;parameterdp_width=5;//Widthofdatapathwire[2*dp_width-1:0]Product;wireReady;reg[dp_width-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;integerExp_Value;regError;Prob_8_25M0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#115000$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joinDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.229always@(negedgeStart)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//Injecterrortoconfirmdetectionendalways@(posedgeReady)begin#1Error<=(Exp_Value^Product);endinitialbegin#5Multiplicand=0;Multiplier=0;repeat(32)#10beginStart=1;#10Start=0;repeat(32)beginStart=1;#10Start=0;#100Multiplicand=Multiplicand+1;endMultiplier=Multiplier+1;endendendmodule(c)Testplan:Exhaustivelytestallcombinationsofmultiplierandmultiplicand,usingautomaticerrorchecking.Verifythatearlyterminationisimplemented课后答案网.Sampleofsimulationresultsisshownbelow.Name6902699270827172reset_bwww.hackshp.cnclockStartstate[2:0]1241241242EarlyterminationEmpty_multiplicandEmpty_multiplierEmptyClr_CAQLoad_regsDecr_PAdd_regsShift_regsQ0P[4:0]4545454ZeroB[4:0]303101A[4:0]15150CQ[4:0]01162121Multiplicand[4:0]303101Multiplier[4:0]12Product[9:0]30310ReadyExp_Value303102ErrorDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2308.26resetS_idleA<=0/ReadyC<=0B<=MultiplicandQ<=MultiplierStartP<=m_size1Load_regsP<=P-1S_add_shift/Decr_P{C,A,Q}<={A+B,Q}>>11Q[0]Add_Shift课后答案网ZeroZero11moduleProb_8_26(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);//Defaultconfiguration:5-bitdatapathparameterwww.hackshp.cndp_width=5;//Settowidthofdatapathoutput[2*dp_width-1:0]Product;outputReady;input[dp_width-1:0]Multiplicand,Multiplier;inputStart,clock,reset_b;parameterBC_size=3;//SizeofbitcounterparameterS_idle=2"b01,//one-hotcodeS_add_shift=2"b10;reg[2:0]state,next_state;reg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[BC_size-1:0]P;regLoad_regs,Decr_P,Add_shift,Shift;assignProduct={C,A,Q};wireZero=(P==0);//counteriszerowireReady=(state==S_idle);//controllerstatus//controlunitalways@(posedgeclock,negedgereset_b)if(~reset_b)state<=S_idle;elsestate<=next_state;always@(state,Start,Q[0],Zero)beginnext_state=S_idle;Load_regs=0;Decr_P=0;Add_shift=0;Shift=0;case(state)S_idle:beginif(Start)next_state=S_add_shift;Load_regs=1;endDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.231S_add_shift:beginDecr_P=1;if(Zero)next_state=S_idle;elsebeginnext_state=S_add_shift;if(Q[0])Add_shift=1;elseShift=1;endenddefault:next_state=S_idle;endcaseend//datapathunitalways@(posedgeclock)beginif(Load_regs)beginP<=dp_width;A<=0;C<=0;B<=Multiplicand;Q<=Multiplier;endif(Decr_P)P<=P-1;if(Add_shift){C,A,Q}<={C,A+B,Q}>>1;if(Shift){C,A,Q}<={C,A,Q}>>1;endendmodule课后答案网modulet_Prob_8_26;parameterdp_width=5;//Widthofdatapathwire[2*dp_width-1:0]Product;wireReady;reg[dp_width-1:0]www.hackshp.cnMultiplicand,Multiplier;regStart,clock,reset_b;integerExp_Value;wireError;Prob_8_26M0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#70000$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joininitialbegin#5Start=1;endalways@(posedgeReady)beginExp_Value=Multiplier*Multiplicand;endassignError=Ready&(Exp_Value^Product);initialbegin#5Multiplicand=0;Multiplier=0;repeat(32)#10beginMultiplier=Multiplier+1;repeat(32)@(posedgeM0.Ready)#5Multiplicand=Multiplicand+1;endendendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.232Sampleofsimulationresults.Name23982240422410224162clockreset_bStartLoad_regsShiftAdd_shiftDecr_PP[2:0]21075432107543210754B[4:0]22232425CA[4:0]01150111011501221126012Q[4:0]9418112110212629115211681121Multiplicand[4:0]22232425Multiplier[4:0]11Product[9:0]课后答案网178189200Exp_Value231242253264Errorwww.hackshp.cn8.27(a)//Testbenchforexhaustivesimulationmodulet_Sequential_Binary_Multiplier;parameterdp_width=5;//Widthofdatapathwire[2*dp_width-1:0]Product;wireReady;reg[dp_width-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;Sequential_Binary_MultiplierM0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#109200$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joininitialbegin#5Start=1;endinitialbegin#5Multiplicand=0;Multiplier=0;repeat(31)#10beginMultiplier=Multiplier+1;repeat(32)@(posedgeM0.Ready)#5Multiplicand=Multiplicand+1;endStart=0;end//ErrorCheckerDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.233regError;reg[2*dp_width-1:0]Exp_Value;always@(posedgeReady)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//InjecterrortoverifydetectionError=(Exp_Value^Product);endendmodulemoduleSequential_Binary_Multiplier(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);//Defaultconfiguration:5-bitdatapathparameterdp_width=5;//Settowidthofdatapathoutput[2*dp_width-1:0]Product;outputReady;input[dp_width-1:0]Multiplicand,Multiplier;inputStart,clock,reset_b;parameterBC_size=3;//SizeofbitcounterparameterS_idle=3"b001,//one-hotcodeS_add=3"b010,S_shift=3"b100;reg[2:0]state,next_state;reg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[BC_size-1:0]P;regLoad_regs,课后答案网Decr_P,Add_regs,Shift_regs;//MiscellaneouscombinationallogicassignProduct={C,A,Q};wirewww.hackshp.cnZero=(P==0);//counteriszerowireReady=(state==S_idle);//controllerstatus//controlunitalways@(posedgeclock,negedgereset_b)if(~reset_b)state<=S_idle;elsestate<=next_state;always@(state,Start,Q[0],Zero)beginnext_state=S_idle;Load_regs=0;Decr_P=0;Add_regs=0;Shift_regs=0;case(state)S_idle:beginif(Start)next_state=S_add;Load_regs=1;endS_add:beginnext_state=S_shift;Decr_P=1;if(Q[0])Add_regs=1;endS_shift:beginShift_regs=1;if(Zero)next_state=S_idle;elsenext_state=S_add;enddefault:next_state=S_idle;endcaseendDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.234//datapathunitalways@(posedgeclock)beginif(Load_regs)beginP<=dp_width;A<=0;C<=0;B<=Multiplicand;Q<=Multiplier;endif(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;if(Decr_P)P<=P-1;endendmoduleSampleofsimulationresults:Name99539995799961999659clockreset_bStartstate[2:0]412424242424124Load_regs课后答案网Decr_PAdd_regsShift_regsZerowww.hackshp.cnP[2:0]054321054B[4:0]08090aA[4:0]0e07000904020b050e07100800CQ[4:0]11081d1e0f170b051dMultiplicand[4:0]8910Multiplier[4:0]29Product[9:0]465232293171587936718347123552326129ReadyExp_Value[9:0]203232261ErrorDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.235(b)InthispartthecontrollerisdescribedbyFig.8.18.Thetestbenchincludesprobestodisplaythestateofthecontroller.//Testbenchforexhaustivesimulationmodulet_Sequential_Binary_Multiplier;parameterdp_width=5;//Widthofdatapathwire[2*dp_width-1:0]Product;wireReady;reg[dp_width-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;Sequential_Binary_MultiplierM0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#109200$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joininitialbegin#5Start=1;endinitialbegin#5Multiplicand=0;Multiplier=0;repeat(31)#10beginMultiplier=Multiplier+1;repeat课后答案网(32)@(posedgeM0.Ready)#5Multiplicand=Multiplicand+1;endStart=0;endwww.hackshp.cn//ErrorCheckerregError;reg[2*dp_width-1:0]Exp_Value;always@(posedgeReady)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//InjecterrortoverifydetectionError=(Exp_Value^Product);endwire[2:0]state={M0.G2,M0.G1,M0.G0};endmodulemoduleSequential_Binary_Multiplier(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);//Defaultconfiguration:5-bitdatapathparameterdp_width=5;//Settowidthofdatapathoutput[2*dp_width-1:0]Product;outputReady;input[dp_width-1:0]Multiplicand,Multiplier;inputStart,clock,reset_b;parameterBC_size=3;//Sizeofbitcounterreg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[BC_size-1:0]P;wireLoad_regs,Decr_P,Add_regs,Shift_regs;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.236//StatussignalsassignProduct={C,A,Q};wireZero=(P==0);//counteriszerowireQ0=Q[0];//One-HotControlunit(SeeFig.8.18)DFF_SM0(G0,D0,clock,Set);DFFM1(G1,D1,clock,reset_b);DFFM2(G2,G1,clock,reset_b);or(D0,w1,w2);and(w1,G0,Start_b);and(w2,Zero,G2);not(Start_b,Start);not(Zero_b,Zero);or(D1,w3,w4);and(w3,Start,G0);and(w4,Zero_b,G2);and(Load_regs,G0,Start);and(Add_regs,Q0,G1);assignReady=G0;assignDecr_P=G1;assignShift_regs=G2;not(Set,reset_b);//datapathunit课后答案网always@(posedgeclock)beginif(Load_regs)beginP<=dp_width;A<=0;www.hackshp.cnC<=0;B<=Multiplicand;Q<=Multiplier;endif(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;if(Decr_P)P<=P-1;endendmodulemoduleDFF_S(outputregQ,inputdata,clock,Set);always@(posedgeclock,posedgeSet)if(Set)Q<=1"b1;elseQ<=data;endmodulemoduleDFF(outputregQ,inputdata,clock,reset_b);always@(posedgeclock,negedgereset_b)if(reset_b==0)Q<=1"b0;elseQ<=data;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.237Sampleofsimulationresults:ts:Name40699407394077940819clockreset_bStartstate[2:0]12424242424124Load_regsDecr_PAdd_regsShift_regsP[2:0]054321054ZeroB[4:0]111213A[4:0]课后答案网060012091b0d0600CQ[4:0]0c06030110180cMultiplicand[4:0]171819Multiplier[4:0]www.hackshp.cn12Product[9:0]204126357928986543221612ReadyExp_Value[9:0]204216Error8.28//Testbenchforexhaustivesimulationmodulet_Sequential_Binary_Multiplier;parameterdp_width=5;//Widthofdatapathwire[2*dp_width-1:0]Product;wireReady;reg[dp_width-1:0]Multiplicand,Multiplier;regStart,clock,reset_b;Sequential_Binary_MultiplierM0(Product,Ready,Multiplicand,Multiplier,Start,clock,reset_b);initial#109200$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkreset_b=1;#2reset_b=0;#3reset_b=1;joinDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.238initialbegin#5Start=1;endinitialbegin#5Multiplicand=0;Multiplier=0;repeat(31)#10beginMultiplier=Multiplier+1;repeat(32)@(posedgeM0.Ready)#5Multiplicand=Multiplicand+1;endStart=0;end//ErrorCheckerregError;reg[2*dp_width-1:0]Exp_Value;always@(posedgeReady)beginExp_Value=Multiplier*Multiplicand;//Exp_Value=Multiplier*Multiplicand+1;//InjecterrortoverifydetectionError=(Exp_Value^Product);endwire[2:0]state={M0.M0.G2,M0.M0.G1,M0.M0.G0};//WatchstateendmodulemoduleSequential_Binary_Multiplier#(parameterdp_width=5)(output[2*dp_width-1:0]Product,outputReady,input[dp_width-1:0]课后答案网Multiplicand,Multiplier,inputStart,clock,reset_b);wireLoad_regs,Decr_P,Add_regs,Shift_regs,Zero,Q0;ControllerM0(Ready,Load_regs,Decr_P,Add_regs,Shift_www.hackshp.cnregs,Start,Zero,Q0,clock,reset_b);DatapathM1(Product,Q0,Zero,Multiplicand,Multiplier,Start,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);endmodulemoduleController(outputReady,outputLoad_regs,Decr_P,Add_regs,Shift_regs,inputStart,Zero,Q0,clock,reset_b);//One-HotControlunit(SeeFig.8.18)DFF_SM0(G0,D0,clock,Set);DFFM1(G1,D1,clock,reset_b);DFFM2(G2,G1,clock,reset_b);or(D0,w1,w2);and(w1,G0,Start_b);and(w2,Zero,G2);not(Start_b,Start);not(Zero_b,Zero);or(D1,w3,w4);and(w3,Start,G0);and(w4,Zero_b,G2);and(Load_regs,G0,Start);and(Add_regs,Q0,G1);assignReady=G0;assignDecr_P=G1;assignShift_regs=G2;not(Set,reset_b);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.239moduleDatapath#(parameterdp_width=5,BC_size=3)(output[2*dp_width-1:0]Product,outputQ0,outputZero,input[dp_width-1:0]Multiplicand,Multiplier,inputStart,Load_regs,Decr_P,Add_regs,Shift_regs,clock,reset_b);reg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[BC_size-1:0]P;assignProduct={C,A,Q};//StatussignalsassignZero=(P==0);//counteriszeroassignQ0=Q[0];always@(posedgeclock)beginif(Load_regs)beginP<=dp_width;A<=0;C<=0;B<=Multiplicand;Q<=Multiplier;endif(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;if(Decr_P)P<=P-1;endendmodule课后答案网moduleDFF_S(outputregQ,inputdata,clock,Set);always@(posedgeclock,posedgeSet)if(Set)Q<=1"b1;elseQ<=data;endmodulemoduleDFFwww.hackshp.cn(outputregQ,inputdata,clock,reset_b);always@(posedgeclock,negedgereset_b)if(reset_b==0)Q<=1"b0;elseQ<=data;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.240Name58738587785881858858clockreset_bStartstate[2:0]12424242424124Load_regsDecr_PAdd_regsShift_regsP[2:0]054321054Q0ZeroB[4:0]151617CA[4:0]课后答案网0b00160b050201170b00Q[4:0]051108141a0d1611Multiplicand[4:0]212223Multiplier[4:0]www.hackshp.cn17Product[9:0]35717721360180904574937417ReadyExp_Value[9:0]357374Error8.29(a)Inputs:xyEF00--01--1---S0S1S2---1S3S4--0---1-S7S6S5DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.241(b)DS0=x"y"S0+S3+S5+S7DS1=xS0DS2=x"yS0+S1DS3=FS2DS4=F"S2DS5=E"S5DS6=E"S4DS7=S6(c)PresentNextstateInputsstateOutputG1G2G3xyEFG1G2G3S000000xx000S00001xxx001S000001xx010S1001xxxx010S2010xx0x100S2010xx1x011S3011xxxx000课后答案网S4100xxx0110S4100xxx1101S5101xxxx000www.hackshp.cnS6110xxxx110S7111xxxx000(d)DG1DQQ"S0SDG12DQS2S3SQ"4S5S6DG3SDQ7Q"ClockResetDG1=F"S2+S4+S6DG2=x"yS0+S1+FS2+E"S4+S6DG3=xS0+FS2+ES4+S6(e)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.242PresentNextInputstatestateMux1Mux2Mux3conditionsGGGGGG123123000000x’y’000001x0x"yx000010x’y001010None010010100F’F"FF010011F’011000None000100110E’100101E’1E"E101000None000110110None111111000None000(f)0s2s1s0课后答案网18x1F"23MuxDQ4G30516Q"www.hackshp.cn7x"0s2s1s0S0y1S1F2S8x13x823SMuxDQDecoder3E"4SG452S516Q"S607S7x0s2s1s001F28x13DQE4MuxG1516Q"7Clockreset_b(g)moduleController_8_29g(inputx,y,E,F,clock,reset_b);supply0GND;supply1VCC;mux_8x1M3(m3,GND,GND,F_bar,GND,VCC,GND,VCC,GND,G3,G2,G1);mux_8x1M2(m2,w1,VCC,F,GND,E_bar,GND,VCC,GND,G3,G2,G1);mux_8x1M1(m1,x,GND,F,GND,E,GND,VCC,GND,G3,G2,G1);DFF_8_28gDM3(G3,m3,clock,reset_b);DFF_8_28gDM2(G2,m2,clock,reset_b);DFF_8_28gDM1(G1,m1,clock,reset_b);decoder_3x8M0_D(y0,y1,y2,y3,y4,y5,y6,y7,G3,G2,G1);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.243and(w1,x_bar,y);not(F_bar,F);not(E_bar,E);not(x_bar,x);endmodule//Testplan:ExerciseallpathsoftheASMchartmodulet_Controller_8_29g();regx,y,E,F,clock,reset_b;Controller_8_29gM0(x,y,E,F,clock,reset_b);wire[2:0]state={M0.G3,M0.G2,M0.G1};initial#500$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginendinitialforkreset_b=0;#2reset_b=1;#0beginx=1;y=1;E=1;F=1;end//Path:S_0,S_1,S_2,S_34#80reset_b=0;#92reset_b=1;#90beginx=1;y=1;E=1;F=0;end#150reset_b=0;#152reset_b=1;#150beginx=1;y=1;E=0;F=0;end//Path:S_0,S_1,S_2,S_4,S_5#200reset_b=0;#202reset_b=1;#190begin课后答案网x=1;y=1;E=0;F=0;end//Path:S_0,S_1,S_2,S_4,S_6,S_7#250reset_b=0;#252reset_b=1;#240beginx=0;y=0;E=0;F=0;end//Path:S_0#290reset_b=0;#292reset_b=1;www.hackshp.cn#280beginx=0;y=1;E=0;F=0;end//Path:S_0,S_2,S_4,S_6,S_7#360reset_b=0;#362reset_b=1;#350beginx=0;y=1;E=1;F=0;end//Path:S_0,S_2,S_4,S_5#420reset_b=0;#422reset_b=1;#410beginx=0;y=1;E=0;F=1;end//Path:S_0,S_2,S_3joinendmodulemodulemux_8x1(outputregy,inputx0,x1,x2,x3,x4,x5,x6,x7,s2,s1,s0);always@(x0,x1,x2,x3,x4,x5,x6,x7,s0,s1,s2)case({s2,s1,s0})3"b000:y=x0;3"b001:y=x1;3"b010:y=x2;3"b011:y=x3;3"b100:y=x4;3"b101:y=x5;3"b110:y=x6;3"b111:y=x7;endcaseendmodulemoduleDFF_8_28g(outputregq,inputdata,clock,reset_b);always@(posedgeclock,negedgereset_b)if(!reset_b)q<=1"b0;elseq<=data;endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.244moduledecoder_3x8(outputregy0,y1,y2,y3,y4,y5,y6,y7,inputx2,x1,x0);always@(x0,x1,x2)begin{y7,y6,y5,y4,y3,y2,y1,y0}=8"b0;case({x2,x1,x0})3"b000:y0=1"b1;3"b001:y1=1"b1;3"b010:y2=1"b1;3"b011:y3=1"b1;3"b100:y4=1"b1;3"b101:y5=1"b1;3"b110:y6=1"b1;3"b111:y7=1"b1;endcaseendendmodule课后答案网www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.245Path:S_0,S_1,S_2,S_3andPath:S_0,S_1,S_2,S_4,S_5Name0306090120clockreset_bxyEFstate[2:0]01230123012450Path:S_0,S_1,S_2,S_4,S_6,S_7Name120150180210240clockreset_bxyEFstate[2:0]45010124670124670Path:S_0andPath,S_0,S_2,S_4,S_6,S_7课后答案网Name240270300330360clockreset_bxywww.hackshp.cnEFstate[2:0]670202467024024Path:S_0,S_2,S_4,S_5andpathS_0,S_2,S_3Name324354384414444clockreset_bxyEFstate[2:0]7024024502302302(h)moduleController_8_29h(inputx,y,E,F,clock,reset_b);parameterS_0=3"b000,S_1=3"b001,S_2=3"b010,S_3=3"b011,S_4=3"b100,S_5=3"b101,S_6=3"b110,S_7=3"b111;reg[2:0]state,next_state;always@(posedgeclock,negedgereset_b)if(!reset_b)state<=S_0;elsestate<=next_state;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.246always@(state,x,y,E,F)begincase(state)S_0:if(x)next_state=S_1;elsenext_state=y?S_2:S_0;S_1:next_state=S_2;S_2:if(F)next_state=S_3;elsenext_state=S_4;S_3,S_5,S_7:next_state=S_0;S_4:if(E)next_state=S_5;elsenext_state=S_6;S_6:next_state=S_7;default:next_state=S_0;endcaseendendmodule//Testplan:ExerciseallpathsoftheASMchartmodulet_Controller_8_29h();regx,y,E,F,clock,reset_b;Controller_8_29hM0(x,y,E,F,clock,reset_b);initial#500$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginendinitialforkreset_b=0;#2reset_b=1;#20课后答案网beginx=1;y=1;E=1;F=1;end//Path:S_0,S_1,S_2,S_34#80reset_b=0;#92reset_b=1;#90beginx=1;y=1;E=1;F=0;end#150reset_b=0;#152reset_b=1;#150www.hackshp.cnbeginx=1;y=1;E=0;F=0;end//Path:S_0,S_1,S_2,S_4,S_5#200reset_b=0;#202reset_b=1;#190beginx=1;y=1;E=0;F=0;end//Path:S_0,S_1,S_2,S_4,S_6,S_7#250reset_b=0;#252reset_b=1;#240beginx=0;y=0;E=0;F=0;end//Path:S_0#290reset_b=0;#292reset_b=1;#280beginx=0;y=1;E=0;F=0;end//Path:S_0,S_2,S_4,S_6,S_7#360reset_b=0;#362reset_b=1;#350beginx=0;y=1;E=1;F=0;end//Path:S_0,S_2,S_4,S_5#420reset_b=0;#422reset_b=1;#410beginx=0;y=1;E=0;F=1;end//Path:S_0,S_2,S_3joinendmoduleNote:Simulationresultsmatchthosefor8.39g.8.30(a)E=1(b)E=08.31A=0110,B=0010,C=0000.A*B=1100A|B=0110A&&C=0A+B=1000A∏B=0100|A=1A–B=0100&A=0AB=1A&B=0010A||B=1A!B=1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2478.324Mux44-bit4R1CounterR2+selectS1S2countloadselect=S1load=S+S"S"112count=S"S12clock8.33Assumethatthestatesareencodedone-hotasT,T,T,012T.Theselectlinesofthemuxaregeneratedas:课后答案网3s=T+T123s=T+T013ThesignaltoloadRcanbegeneratedbythehost4www.hackshp.cnprocessororby:load=T+T+TT.012+38R008R11888MuxRegisterR4R228R3ss310loadT0T14x2TEncoder2T3loadclock8.34(a)moduleDatapath_BEH#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,outputregE,outputZero,input[dp_width-1:0]data,inputLoad_regs,Shift_left,Incr_R2,clock,reset_b);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.248reg[dp_width-1:0]R1;reg[R2_width-1:0]R2;assigncount=R2;assignZero=~(|R1);always@(posedgeclock)beginE<=R1[dp_width-1]&Shift_left;if(Load_regs)beginR1<=data;R2<={R2_width{1"b1}};endif(Shift_left){E,R1}<={E,R1}<<1;if(Incr_R2)R2<=R2+1;endendmodule//TestPlanforDatapathUnit://DemonstrateactionofLoad_regs//R1getsdata,R2getsallones//DemonstrateactionofIncr_R2//DemonstrateactionofShift_leftanddetectE//Testbenchfordatapathmodulet_Datapath_Unit#(parameterdp_width=8,R2_width=4)();课后答案网wire[R2_width-1:0]count;wireE,Zero;reg[dp_width-1:0]data;regLoad_regs,www.hackshp.cnShift_left,Incr_R2,clock,reset_b;Datapath_BEHM0(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;Load_regs=0;Incr_R2=0;Shift_left=0;#10Load_regs=1;#20Load_regs=0;#50Incr_R2=1;#120Incr_R2=0;#90Shift_left=1;#200Shift_left=0;joinendmoduleNote:Thesimulationresultsshowtestsoftheoperationsofthedatapathindependentofthecontrolunit,socountdoesnotrepresentthenumberofonesinthedata.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.249R1getsdataandR2getsallonesName060120180clockreset_bR2incrementswhileR1shiftsleftZeroassertsIncr_R2isassertedLoad_regsIncr_R2Shift_leftNotethatEmatchespreviousZerovalueofR1[7]Edata[7:0]aaR1[7:0]xxaa54a850a0408000R1[7]R1[6]R1[5]R1[4]R1[3]R1[2]R1[1]课后答案网R1[0]R2[3:0]xf0123456count[3:0]www.hackshp.cnxf0123456(b)//ControlUnitmoduleController_BEH(outputReady,outputregLoad_regs,outputIncr_R2,Shift_left,inputStart,Zero,E,clock,reset_b);parameterS_idle=0,S_1=1,S_2=2,S_3=3;reg[1:0]state,next_state;assignReady=(state==S_idle);assignIncr_R2=(state==S_1);assignShift_left=(state==S_2);always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=S_idle;elsestate<=next_state;always@(state,Start,Zero,E)beginLoad_regs=0;case(state)S_idle:if(Start)beginLoad_regs=1;next_state=S_1;endelsenext_state=S_idle;S_1:if(Zero)next_state=S_idle;elsenext_state=S_2;S_2:next_state=S_3;S_3:if(E)next_state=S_1;elsenext_state=S_2;endcaseendDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.250endmodule//TestplanforControlUnit//VerifythatstateentersS_idlewithreset_basserted.//Withreset_bde-asserted,verifythatstateentersS_1andassertsLoad_Regswhen//Startisasserted.//VerifythatIncr_R2isassertedinS_1.//VerifythatstatereturnstoS_idlefromS_1ifZeroisasserted.//VerifythatstategoestoS_2ifZeroisnotasserted.//VerifythatShift_leftisassertedinS_2.//VerifythatstategoestoS_3fromS_2unconditionally.//VerifythatstatereturnstoS_2fromS_3idEisnotasserted.//VerifythatstategoestoS_1fromS_3ifEisasserted.//TestbenchforControlUnitmodulet_Control_Unit();wireReady,Load_regs,Incr_R2,Shift_left;regStart,Zero,E,clock,reset_b;Controller_BEHM0(Ready,Load_regs,Incr_R2,Shift_left,Start,Zero,E,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkZero=1;课后答案网E=0;Start=0;#20Start=1;//CyclefromS_idletoS_1#80Start=0;#70Zero=0;//S_idletoS_1toS_2toS_3andcycletoS_2.www.hackshp.cn#130E=1;//CycletoS_3toS_1toS_2toS_3#150Zero=1;//ReturntoS_idlejoinendmoduleGotoS_1andcyletoGotoS_2andcyleGotoS_1andcyletoReturntoS_idleS_idlewhileZero=1toS_3whileE=0S_3whileZero=0Name070140210clockreset_bStartZeroEstate[1:0]01010123232312310ReadyLoad_regsIncr_R2Shift_leftReadyassertswhileLoad_regsassertswhileIncr_R2assertswhilestate=S_1Shift_leftassertswhilestate=S_2state=S_idlestate=S_idleandStart=1DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.251(c)//IntegratedsystemmoduleCount_Ones_BEH_BEH#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,input[dp_width-1:0]data,inputStart,clock,reset_b);wireLoad_regs,Incr_R2,Shift_left,Zero,E;Controller_BEHM0(Ready,Load_regs,Incr_R2,Shift_left,Start,Zero,E,clock,reset_b);Datapath_BEHM1(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock,reset_b);endmodule//Testplanforintegratedsystem//Testfordatavaluesof8"haa,8"h00,8"hff.//Testbenchforintegratedsystemmodulet_count_Ones_BEH_BEH();parameterdp_width=8,R2_width=4;wire[R2_width-1:0]count;reg[dp_width-1:0]data;regStart,clock,reset_b;Count_Ones_BEH_BEHM0(count,data,Start,clock,reset_b);initial#700课后答案网$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;//Expectcount=4Start=0;www.hackshp.cn#20Start=1;#30Start=0;#40data=8"b00;//Expectcount=0#250Start=1;#260Start=0;#280data=8"hff;#280Start=1;#290Start=0;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.252Name070140210clockreset_bReadyStartLoad_regsIncr_R2Shift_leftZeroEstate[1:0]012312323123231232310data[7:0]aa00R1[7:0]xxaa54a850a0408000R2[3:0]xf01234count[3:0]x01234Name课后答案网188248308368clockreset_bwww.hackshp.cnReadyStartLoad_regsIncr_R2Shift_leftZeroEstate[1:0]231010123123123123data[7:0]00ffR1[7:0]00fffefcf8f0R2[3:0]34f0f0123count[3:0]34150150123DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.253258318378438498558Nameclockreset_bReadyStartLoad_regsIncr_R2Shift_leftZeroEstate[1:0]1012312312312312312312312310data[7:0]00ffR1[7:0]00fffefcf8f0e0c08000R2[3:0]f0f012345678count[3:0]015012345678(d)//One-HotControlunitmoduleController_BEH_1Hot(outputReady,outputreg课后答案网Load_regs,outputIncr_R2,Shift_left,inputStart,Zero,E,clock,reset_b);parameterS_idle=4"b001,S_1=4"b0010,S_2=4"b0100,S_3=4"b1000;reg[3:0]state,next_state;www.hackshp.cnassignReady=(state==S_idle);assignIncr_R2=(state==S_1);assignShift_left=(state==S_2);always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=S_idle;elsestate<=next_state;always@(state,Start,Zero,E)beginLoad_regs=0;case(state)S_idle:if(Start)beginLoad_regs=1;next_state=S_1;endelsenext_state=S_idle;S_1:if(Zero)next_state=S_idle;elsenext_state=S_2;S_2:next_state=S_3;S_3:if(E)next_state=S_1;elsenext_state=S_2;endcaseendendmoduleNote:Testplan,testbenchandsimulationresultsaresameas(b),butwithstatesnumberedwithone-hotcodes.(e)//Integratedsystemwithone-hotcontrollerDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.254moduleCount_Ones_BEH_1Hot#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,input[dp_width-1:0]data,inputStart,clock,reset_b);wireLoad_regs,Incr_R2,Shift_left,Zero,E;Controller_BEH_1HotM0(Ready,Load_regs,Incr_R2,Shift_left,Start,Zero,E,clock,reset_b);Datapath_BEHM1(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock,reset_b);endmoduleNote:Testplan,testbenchandsimulationresultsaresameas(c),butwithstatesnumberedwithone-hotcodes.8.35Note:SignalStartisinitializedto0whenthesimulationbegins.Otherwise,thestateofthestructuralmodelwillbecomeXatthefirstclockaftertheresetconditionisdeasserted,withStartandLoad_Regshavingunknownvalues.Inthisconditionthestructuralmodelcannotoperatecorrectly.03060Nameclockreset_b课后答案网StartLoad_regsShift_leftIncr_R2www.hackshp.cnZeroReadystate[1:0]x0Xdata[7:0]ffcount[3:0]xmoduleCount_Ones_STR_STR(count,Ready,data,Start,clock,reset_b);//Mux–decoderimplementationofcontrollogic//controllerisstructural//datapathisstructuralparameterR1_size=8,R2_size=4;output[R2_size-1:0]count;outputReady;input[R1_size-1:0]data;inputStart,clock,reset_b;wireLoad_regs,Shift_left,Incr_R2,Zero,E;Controller_STRM0(Ready,Load_regs,Shift_left,Incr_R2,Start,E,Zero,clock,reset_b);Datapath_STRM1(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.255moduleController_STR(Ready,Load_regs,Shift_left,Incr_R2,Start,E,Zero,clock,reset_b);outputReady;outputLoad_regs,Shift_left,Incr_R2;inputStart;inputE,Zero;inputclock,reset_b;supply0GND;supply1PWR;parameterS0=2"b00,S1=2"b01,S2=2"b10,S3=2"b11;//BinarycodewireLoad_regs,Shift_left,Incr_R2;wireG0,G0_b,D_in0,D_in1,G1,G1_b;wireZero_b=~Zero;wireE_b=~E;wire[1:0]select={G1,G0};wire[0:3]Decoder_out;assignReady=~Decoder_out[0];assignIncr_R2=~Decoder_out[1];assignShift_left=~Decoder_out[2];and(Load_regs,Ready,Start);mux_4x1_behMux_1(D_in1,GND,Zero_b,PWR,E_b,select);mux_4x1_behMux_0(D_in0,Start,GND,PWR,E,select);D_flip_flop_AR_bM1(G1,G1_b,D_in1,clock,reset_b);D_flip_flop_AR_bM0(G0,G0_b,D_in0,clock,reset_b);decoder_2x4_df课后答案网M2(Decoder_out,G1,G0,GND);endmodulemoduleDatapath_STR(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock);parameterR1_size=8,R2_size=4;output[R2_size-1:0]count;www.hackshp.cnoutputE,Zero;input[R1_size-1:0]data;inputLoad_regs,Shift_left,Incr_R2,clock;wire[R1_size-1:0]R1;supply0Gnd;supply1Pwr;assignZero=(R1==0);Shift_RegM1(R1,data,Gnd,Shift_left,Load_regs,clock,Pwr);CounterM2(count,Load_regs,Incr_R2,clock,Pwr);D_flip_flop_ARM3(E,w1,clock,Pwr);and(w1,R1[R1_size-1],Shift_left);endmodulemoduleShift_Reg(R1,data,SI_0,Shift_left,Load_regs,clock,reset_b);parameterR1_size=8;output[R1_size-1:0]R1;input[R1_size-1:0]data;inputSI_0,Shift_left,Load_regs;inputclock,reset_b;reg[R1_size-1:0]R1;always@(posedgeclock,negedgereset_b)if(reset_b==0)R1<=0;elsebeginif(Load_regs)R1<=data;elseif(Shift_left)R1<={R1[R1_size-2:0],SI_0};endendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.256moduleCounter(R2,Load_regs,Incr_R2,clock,reset_b);parameterR2_size=4;output[R2_size-1:0]R2;inputLoad_regs,Incr_R2;inputclock,reset_b;reg[R2_size-1:0]R2;always@(posedgeclock,negedgereset_b)if(reset_b==0)R2<=0;elseif(Load_regs)R2<={R2_size{1"b1}};//Fillwith1elseif(Incr_R2==1)R2<=R2+1;endmodulemoduleD_flip_flop_AR(Q,D,CLK,RST);outputQ;inputD,CLK,RST;regQ;always@(posedgeCLK,negedgeRST)if(RST==0)Q<=1"b0;elseQ<=D;endmodulemoduleD_flip_flop_AR_b(Q,Q_b,D,CLK,RST);outputQ,Q_b;inputD,CLK,RST;regQ;课后答案网assignQ_b=~Q;always@(posedgeCLK,negedgeRST)if(RST==0)Q<=1"b0;elseQ<=D;endmodulewww.hackshp.cn//Behavioraldescriptionof4-to-1linemultiplexer//Verilog2005portsyntaxmodulemux_4x1_beh(outputregm_out,inputin_0,in_1,in_2,in_3,input[1:0]select);always@(in_0,in_1,in_2,in_3,select)//Verilog2005syntaxcase(select)2"b00:m_out=in_0;2"b01:m_out=in_1;2"b10:m_out=in_2;2"b11:m_out=in_3;endcaseendmodule//Dataflowdescriptionof2-to-4-linedecoder//SeeFig.4.19.Note:ThefigureusessymbolE,butthe//Verilogmodelusesenabletoclearlyindicatefunctionality.moduledecoder_2x4_df(D,A,B,enable);output[0:3]D;inputA,B;inputenable;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.257assignD[0]=~(~A&~B&~enable),D[1]=~(~A&B&~enable),D[2]=~(A&~B&~enable),D[3]=~(A&B&~enable);endmodulemodulet_Count_Ones;parameterR1_size=8,R2_size=4;wire[R2_size-1:0]R2;wire[R2_size-1:0]count;wireReady;reg[R1_size-1:0]data;regStart,clock,reset_b;wire[1:0]state;//Useonlyfordebugassignstate={M0.M0.G1,M0.M0.G0};Count_Ones_STR_STRM0(count,Ready,data,Start,clock,reset_b);initial#4000$finish;initialbeginclock=0;#5forever#5clock=~clock;endinitialforkStart=0;#1reset_b=1;#3reset_b=0;#4reset_b=1;课后答案网data=8"Hff;#25Start=1;#35Start=0;#310data=8"h0f;#310Start=1;www.hackshp.cn#320Start=0;#610data=8"hf0;#610Start=1;#620Start=0;#910data=8"h00;#910Start=1;#920Start=0;#1210data=8"haa;#1210Start=1;#1220Start=0;#1510data=8"h0a;#1510Start=1;#1520Start=0;#1810data=8"ha0;#1810Start=1;#1820Start=0;#2110data=8"h55;#2110Start=1;#2120Start=0;#2410data=8"h05;#2410Start=1;#2420Start=0;#2710data=8"h50;#2710Start=1;#2720Start=0;#3010data=8"ha5;#3010Start=1;#3020Start=0;#3310data=8"h5a;#3310Start=1;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.258#3320Start=0;joinendmoduleName218423242464260427442884clockreset_bStartLoad_regsShift_leftIncr_R2ZeroReadystate[1:0]000data[7:0]550550count[3:0]12340120128.36Note:SeeProb.8.35forabehavioralmodelofthedatapathunit,Prob.8.36dforaone-hotcontrolunit.(a)T0,T1,T2,T3beassertedwhenthestateisinS_idle,S_1,S_2,andS_3,respectively.LetD0,D1,D2,andD3denotetheinputstotheone-hotflip-flops.课后答案网D0=T0Start"+T1ZeroD1=T0Start+T3ED2=T1Zero"+T3E"D3=T2www.hackshp.cn(b)Gate-levelone-hotcontrollermoduleController_Gates_1Hot(outputReady,outputLoad_regs,Incr_R2,Shift_left,inputStart,Zero,E,clock,reset_b);wirew1,w2,w3,w4,w5,w6;wireT0,T1,T2,T3;wireset;assignReady=T0;assignIncr_R2=T1;assignShift_left=T2;and(Load_regs,T0,Start);not(set,reset_b);DFF_SM0(T0,D0,clock,set);//Note:resetactionmustinitializeS_idle=4"b0001DFFM1(T1,D1,clock,reset_b);DFFM2(T2,D2,clock,reset_b);DFFM3(T3,D3,clock,reset_b);not(Start_b,Start);and(w1,T0,Start_b);and(w2,T1,Zero);or(D0,w1,w2);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.259and(w3,T0,Start);and(w4,T3,E);or(D1,w3,w4);not(Zero_b,Zero);not(E_b,E);and(w5,T1,Zero_b);and(w6,T3,E_b);or(D2,w5,w6);buf(D3,T2);endmodulemoduleDFF(outputregQ,inputD,clock,reset_b);always@(posedgeclock,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=D;endmodulemoduleDFF_S(outputregQ,inputD,clock,set);always@(posedgeclock,posedgeset)if(set==1)Q<=1;elseQ<=D;endmodule(c)//TestplanforControlUnit课后答案网//VerifythatstateentersS_idlewithreset_basserted.//Withreset_bde-asserted,verifythatstateentersS_1andassertsLoad_Regswhen//Startisasserted.//VerifythatIncr_R2isassertedinS_1.//Verifythatstateretuwww.hackshp.cnrnstoS_idlefromS_1ifZeroisasserted.//VerifythatstategoestoS_2ifZeroisnotasserted.//VerifythatShift_leftisassertedinS_2.//VerifythatstategoestoS_3fromS_2unconditionally.//VerifythatstatereturnstoS_2fromS_3idEisnotasserted.//VerifythatstategoestoS_1fromS_3ifEisasserted.//TestbenchforOne-HotControlUnitmodulet_Control_Unit();wireReady,Load_regs,Incr_R2,Shift_left;regStart,Zero,E,clock,reset_b;wire[3:0]state={M0.T3,M0.T2,M0.T1,M0.T0};//Observeone-hotstatebitsController_Gates_1HotM0(Ready,Load_regs,Incr_R2,Shift_left,Start,Zero,E,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkZero=1;E=0;Start=0;#20Start=1;//CyclefromS_idletoS_1#80Start=0;#70Zero=0;//S_idletoS_1toS_2toS_3andcycletoS_2.#130E=1;//CycletoS_3toS_1toS_2toS_3#150Zero=1;//ReturntoS_idlejoinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.260Note:simulationresultsmatchthoseforProb.8.34(d).SeeProb.8.34(c)forannotations.Name060120180Defaultclockreset_bStartZeroEstate[3:0]12121248484824821ReadyLoad_regsIncr_R2Shift_left(d)Datapathunitdetail:s=Shift_regs+Load_regs"Shift_regs"1s=Load_regs+Load_regs"Shift_regs"课后答案网0Zero8R0www.hackshp.cn18data1Register4x1888(D-typeR1MuxR1<<12Flip-8flops)R1_7R3ssE1DQ10Q"Shift_regsclkLoad_regsclock40RegisterR22x14"b0001(D-typeMux+1selFlip-flops)Incr_R2DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.261//Datapathunit–structuralmodelmoduleDatapath_STR#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,outputE,outputZero,input[dp_width-1:0]data,inputLoad_regs,Shift_left,Incr_R2,clock,reset_b);supply1pwr;supply0gnd;wire[dp_width-1:0]R1_Dbus,R1;wire[R2_width-1:0]R2_Dbus;wireDR1_0,DR1_1,DR1_2,DR1_3,DR1_4,DR1_5,DR1_6,DR1_7;wireR1_0,R1_1,R1_2,R1_3,R1_4,R1_5,R1_6,R1_7;wireR2_0,R2_1,R2_2,R2_3;wire[R2_width-1:0]R2={R2_3,R2_2,R2_1,R2_0};assigncount={R2_3,R2_2,R2_1,R2_0};assignR1={R1_7,R1_6,R1_5,R1_4,R1_3,R1_2,R1_1,R1_0};assignDR1_0=R1_Dbus[0];assignDR1_1=R1_Dbus[1];assignDR1_2=R1_Dbus[2];assignDR1_3=R1_Dbus[3];assignDR1_4=R1_Dbus[4];assignDR1_5=R1_Dbus[5];assignDR1_6=R1_Dbus[6];assignDR1_7=R1_Dbus[7];nor(Zero,R1_0,R1_1,R1_2,R1_3,R1_4,R1_5,R1_6,R1_7);DFFD_E(E,R1_7,clock,pwr);课后答案网DFFDF_0(R1_0,DR1_0,clock,pwr);//DisableresetDFFDF_1(R1_1,DR1_1,clock,pwr);DFFDF_2(R1_2,DR1_2,clock,pwr);DFFDF_3(R1_3,DR1_3,clock,pwr);www.hackshp.cnDFFDF_4(R1_4,DR1_4,clock,pwr);DFFDF_5(R1_5,DR1_5,clock,pwr);DFFDF_6(R1_6,DR1_6,clock,pwr);DFFDF_7(R1_7,DR1_7,clock,pwr);DFF_SDR_0(R2_0,DR2_0,clock,Load_regs);//Load_regs(set)drivesR2toallonesDFF_SDR_1(R2_1,DR2_1,clock,Load_regs);DFF_SDR_2(R2_2,DR2_2,clock,Load_regs);DFF_SDR_3(R2_3,DR2_3,clock,Load_regs);assignDR2_0=R2_Dbus[0];assignDR2_1=R2_Dbus[1];assignDR2_2=R2_Dbus[2];assignDR2_3=R2_Dbus[3];wire[1:0]sel={Shift_left,Load_regs};wire[dp_width-1:0]R1_shifted={R1_6,R1_5,R1_4,R1_3,R1_2,R1_1,R1_0,1"b0};wire[R2_width-1:0]sum=R2+4"b0001;Mux8_4_x_1M0(R1_Dbus,R1,data,R1_shifted,R1,sel);Mux4_2_x_1M1(R2_Dbus,R2,sum,Incr_R2);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.262moduleMux8_4_x_1#(parameterdp_width=8)(outputreg[dp_width-1:0]mux_out,input[dp_width-1:0]in0,in1,in2,in3,input[1:0]sel);always@(in0,in1,in2,in3,sel)case(sel)2"b00:mux_out=in0;2"b01:mux_out=in1;2"b10:mux_out=in2;2"b11:mux_out=in3;endcaseendmodulemoduleMux4_2_x_1#(parameterdp_width=4)(output[dp_width-1:0]mux_out,input[dp_width-1:0]in0,in1,inputsel);assignmux_out=sel?in1:in0;endmodule//TestPlanforDatapathUnit://DemonstrateactionofLoad_regs//R1getsdata,R2getsallones//DemonstrateactionofIncr_R2//DemonstrateactionofShift_leftanddetectE//Testbenchfordatapathmodulet_Datapath_Unit#(parameterdp_width=8,R2_width=4)();wire[R2_width-1:0]count;课后答案网wireE,Zero;reg[dp_width-1:0]data;regLoad_regs,Shift_left,Incr_R2,clock,reset_b;Datapath_STRM0(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock,reset_b);www.hackshp.cninitial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;Load_regs=0;Incr_R2=0;Shift_left=0;#10Load_regs=1;#20Load_regs=0;#50Incr_R2=1;#120Incr_R2=0;#90Shift_left=1;#200Shift_left=0;joinendmodule//IntegratedsystemmoduleCount_Ones_Gates_1_Hot_STR#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,input[dp_width-1:0]data,inputStart,clock,reset_b);wireLoad_regs,Incr_R2,Shift_left,Zero,E;Controller_Gates_1HotM0(Ready,Load_regs,Incr_R2,Shift_left,Start,Zero,E,clock,reset_b);Datapath_STRM1(count,E,Zero,data,Load_regs,Shift_left,Incr_R2,clock,reset_b);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.263//Testplanforintegratedsystem//Testfordatavaluesof8"haa,8"h00,8"hff.//Testbenchforintegratedsystemmodulet_count_Ones_Gates_1_Hot_STR();parameterdp_width=8,R2_width=4;wire[R2_width-1:0]count;reg[dp_width-1:0]data;regStart,clock,reset_b;wire[3:0]state={M0.M0.T3,M0.M0.T2,M0.M0.T1,M0.M0.T0};Count_Ones_Gates_1_Hot_STRM0(count,data,Start,clock,reset_b);initial#700$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;//Expectcount=4Start=0;#20Start=1;#30Start=0;#40data=8"b00;//Expectcount=0#250Start=1;#260Start=0;#280data=8"hff;#280Start=1;#290Start=0;课后答案网joinendmoduleNote:Thesimulationresultsshowtestsoftheoperationsofthedatapathindependentofthecontrolunit,socountdoesnotrepresentthenumberofonesinthedata.www.hackshp.cnName060120180clockreset_bLoad_regsIncr_R2Shift_leftZeroEdata[7:0]aaR1[7:0]xxaa54a850a0408000R1[7]R1[6]R1[5]R1[4]R1[3]R1[2]R1[1]R1[0]R2[3:0]xf0123456count[3:0]xf0123456DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.264SimulationsresultsfortheintegratedsystemmatchthoseshowninProb.8.34(e).Seethoseresultsforadditionalannotation.Name0150300450600clockreset_bReadyStartLoad_regsShift_leftIncr_R2ZeroEstate[3:0]1111data[7:0]aa00ffR1[7:0]xx54504000fffefcf8f0e0c08000R2[3:0]xf01234f0f012345678count[3:0]xf01234f0f0123456788.37(a)ASMDchart:课后答案网www.hackshp.cnreset_bS_idle/ReadyR1<=dataStartR2<=0Load_regs1S_runningR2<=R2+R1[0]R1<=R1>>11ZeroAdd_shift(b)RTLmodel:moduleDatapath_Unit_2_Beh#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,outputZero,input[dp_width-1:0]data,inputLoad_regs,Add_shift,clock,reset_b);reg[dp_width-1:0]R1;reg[R2_width-1:0]R2;assigncount=R2;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.265assignZero=~|R1;always@(posedgeclock,negedgereset_b)beginif(reset_b==0)beginR1<=0;R2<=0;endelsebeginif(Load_regs)beginR1<=data;R2<=0;endif(Add_shift)beginR1<=R1>>1;R2<=R2+R1[0];end//concurrentoperationsendendendmodule//Testplanfordatapathunit//Verifyactive-lowresetaction//TestforactionofAdd_shift//TestforactionofLoad_regsmodulet_Datapath_Unit_2_Beh();parameterR1_size=8,R2_size=4;wire[R2_size-1:0]count;wireZero;reg[R1_size-1:0]data;regLoad_regs,Add_shift,clock,reset_b;Datapath_Unit_2_BehM0(count,Zero,data,Load_regs,Add_shift,clock,reset_b);课后答案网initial#1000$finish;initialbeginclock=0;forever#5clock=~clock;endinitialfork#1reset_b=1;#3reset_b=0;www.hackshp.cn#4reset_b=1;joininitialforkdata=8"haa;Load_regs=0;Add_shift=0;#10Load_regs=1;#20Load_regs=0;#50Add_shift=1;#150Add_shift=0;joinendmoduleNotethattheoperationsofthedatapathunitaretestedindependentofthecontroller,sotheactionsofLoad_regsandadd_shiftandthevalueofcountdonotcorrespondtodata.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.266Name050100150clockreset_bLoadR1,flushR2Load_regsAdd_shiftR1shifts,R2addsZerodata[7:0]aaR1[7:0]00aa552a150a05020100R2[3:0]01234count[7:0]01234moduleController_2_Beh(outputReady,outputregLoad_regs,Add_shift,inputStart,Zero,clock,reset_b);parameterS_idle=0,S_running=1;reg课后答案网state,next_state;assignReady=(state==S_idle);always@(posedgeclock,negedgereset_b)if(reset_b==0)state<=S_idle;elsestate<=next_state;www.hackshp.cnalways@(state,Start,Zero)beginnext_state=S_idle;Load_regs=0;Add_shift=0;case(state)S_idle:if(Start)beginLoad_regs=1;next_state=S_running;endS_running:if(Zero)next_state=S_idle;elsebeginAdd_shift=1;next_state=S_running;endendcaseendendmodulemodulet_Controller_2_Beh();wireReady,Load_regs,Add_shift;regStart,Zero,clock,reset_b;Controller_2_BehM0(Ready,Load_regs,Add_shift,Start,Zero,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkZero=1;Start=0;#20Start=1;//CyclefromS_idletoS_1#80Start=0;#70Zero=0;//S_idletoS_1toS_idleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.267#90Zero=1;//ReturntoS_idlejoinendmoduleNote:ThestatetransitionsandoutputsofthecontrollermatchtheASMDchart.Name050100150clockreset_bReadyStartLoad_regsAdd_shiftZerostatemoduleCount_of_Ones_2_Beh#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,课后答案网outputReady,input[dp_width-1:0]data,inputStart,clock,reset_b);wireLoad_regs,Add_shift,Zero;www.hackshp.cnController_2_BehM0(Ready,Load_regs,Add_shift,Start,Zero,clock,reset_b);Datapath_Unit_2_BehM1(count,Zero,data,Load_regs,Add_shift,clock,reset_b);endmodule//Testplanforintegratedsystem//Testfordatavaluesof8"haa,8"h00,8"hff.//Testbenchforintegratedsystemmodulet_Count_Ones_2_Beh();parameterdp_width=8,R2_width=4;wire[R2_width-1:0]count;reg[dp_width-1:0]data;regStart,clock,reset_b;Count_of_Ones_2_BehM0(count,Ready,data,Start,clock,reset_b);initial#700$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;//Expectcount=4Start=0;#20Start=1;#30Start=0;#40data=8"b00;//Expectcount=0#120Start=1;#130Start=0;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.268#140data=8"hff;#160Start=1;#170Start=0;joinendmoduleName060120180240clockreset_bStartLoad_regsAdd_shiftZeroReadystatedata[7:0]aa00ffR1[7:0]00aa552a150a05020100ff7f3f1f0f07030100R2[3:0]01234012345678count[3:0]课后答案网01234012345678(c)T0,T1aretobeassertedwhenthestateisinS_idle,S_running,respectively.LetD0,D1denotetheinputstotheone-hotflip-flops.D0=T0Start"+Twww.hackshp.cn1ZeroD1=T0Start+T1E"(d)Gate-levelone-hotcontrollermoduleController_2_Gates_1Hot(outputReady,Load_regs,Add_shift,inputStart,Zero,clock,reset_b);wirew1,w2,w3,w4;wireT0,T1;wireset;assignReady=T0;assignAdd_shift=T1;and(Load_regs,T0,Start);not(set,reset_b);DFF_SM0(T0,D0,clock,set);//Note:resetactionmustinitializeS_idle=2"b01DFFM1(T1,D1,clock,reset_b);not(Start_b,Start);not(Zero_b,Zero);and(w1,T0,Start_b);and(w2,T1,Zero);or(D0,w1,w2);and(w3,T0,Start);and(w4,T1,Zero_b);or(D1,w3,w4);endmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.269moduleDFF(outputregQ,inputD,clock,reset_b);always@(posedgeclock,negedgereset_b)if(reset_b==0)Q<=0;elseQ<=D;endmodulemoduleDFF_S(outputregQ,inputD,clock,set);always@(posedgeclock,posedgeset)if(set==1)Q<=1;elseQ<=D;endmodule//TestplanforControlUnit//VerifythatstateentersS_idlewithreset_basserted.//Withreset_bde-asserted,verifythatstateentersS_runningandassertsLoad_Regswhen//Startisasserted.//VerifythatstatereturnstoS_idlefromS_runningifZeroisasserted.//VerifythatstategoestoS_runningifZeroisnotasserted.//TestbenchforOne-HotControlUnitmodulet_Control_Unit();wireReady,Load_regs,Add_shift;regStart,Zero,clock,reset_b;wire[3:0]state={M0.T1,M0.T0};//Observeone-hotstatebitsController_2_Gates_1HotM0(Ready,Load_regs,Add_shift,Start,Zero,clock,reset_b);课后答案网initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkwww.hackshp.cnZero=1;Start=0;#20Start=1;//CyclefromS_idletoS_1#80Start=0;#70Zero=0;//S_idletoS_1toS_idle#90Zero=1;//ReturntoS_idlejoinendmoduleSimulationresultsshowthatthecontrollermatchestheASMDchart.DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.270Name060120180clockreset_bStartZeroLoad_regsAdd_shiftZeroReadystate[3:0]1212121//Datapathunit–structuralmodelmoduleDatapath_2_STR#(parameterdp_width=8,R2_width=4)(课后答案网output[R2_width-1:0]count,outputZero,input[dp_width-1:0]data,inputLoad_regs,Add_shift,clock,reset_b);supply1pwww.hackshp.cnwr;supply0gnd;wire[dp_width-1:0]R1_Dbus,R1;wire[R2_width-1:0]R2_Dbus;wireDR1_0,DR1_1,DR1_2,DR1_3,DR1_4,DR1_5,DR1_6,DR1_7;wireR1_0,R1_1,R1_2,R1_3,R1_4,R1_5,R1_6,R1_7;wireR2_0,R2_1,R2_2,R2_3;wire[R2_width-1:0]R2={R2_3,R2_2,R2_1,R2_0};assigncount={R2_3,R2_2,R2_1,R2_0};assignR1={R1_7,R1_6,R1_5,R1_4,R1_3,R1_2,R1_1,R1_0};assignDR1_0=R1_Dbus[0];assignDR1_1=R1_Dbus[1];assignDR1_2=R1_Dbus[2];assignDR1_3=R1_Dbus[3];assignDR1_4=R1_Dbus[4];assignDR1_5=R1_Dbus[5];assignDR1_6=R1_Dbus[6];assignDR1_7=R1_Dbus[7];nor(Zero,R1_0,R1_1,R1_2,R1_3,R1_4,R1_5,R1_6,R1_7);not(Load_regs_b,Load_regs);DFFDF_0(R1_0,DR1_0,clock,pwr);//DisableresetDFFDF_1(R1_1,DR1_1,clock,pwr);DFFDF_2(R1_2,DR1_2,clock,pwr);DFFDF_3(R1_3,DR1_3,clock,pwr);DFFDF_4(R1_4,DR1_4,clock,pwr);DFFDF_5(R1_5,DR1_5,clock,pwr);DFFDF_6(R1_6,DR1_6,clock,pwr);DFFDF_7(R1_7,DR1_7,clock,pwr);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.271DFFDR_0(R2_0,DR2_0,clock,Load_regs_b);//Load_regs(set)drivesR2toallonesDFFDR_1(R2_1,DR2_1,clock,Load_regs_b);DFFDR_2(R2_2,DR2_2,clock,Load_regs_b);DFFDR_3(R2_3,DR2_3,clock,Load_regs_b);assignDR2_0=R2_Dbus[0];assignDR2_1=R2_Dbus[1];assignDR2_2=R2_Dbus[2];assignDR2_3=R2_Dbus[3];wire[1:0]sel={Add_shift,Load_regs};wire[dp_width-1:0]R1_shifted={1"b0,R1_7,R1_6,R1_5,R1_4,R1_3,R1_2,R1_1};wire[R2_width-1:0]sum=R2+{3"b000,R1[0]};Mux8_4_x_1M0(R1_Dbus,R1,data,R1_shifted,R1,sel);Mux4_2_x_1M1(R2_Dbus,R2,sum,Add_shift);endmodule课后答案网www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.272moduleMux8_4_x_1#(parameterdp_width=8)(outputreg[dp_width-1:0]mux_out,input[dp_width-1:0]in0,in1,in2,in3,input[1:0]sel);always@(in0,in1,in2,in3,sel)case(sel)2"b00:mux_out=in0;2"b01:mux_out=in1;2"b10:mux_out=in2;2"b11:mux_out=in3;endcaseendmodulemoduleMux4_2_x_1#(parameterdp_width=4)(output[dp_width-1:0]mux_out,input[dp_width-1:0]in0,in1,inputsel);assignmux_out=sel?in1:in0;endmodule//TestPlanforDatapathUnit://DemonstrateactionofLoad_regs//R1getsdata,R2getsallones//DemonstrateactionofIncr_R2//DemonstrateactionofAdd_shiftanddetectZero//Testbenchfordatapathmodulet_Datapath_Unit#(parameterdp_width=8,R2_width=4)();课后答案网wire[R2_width-1:0]count;wireZero;reg[dp_width-1:0]data;regLoad_regs,www.hackshp.cnAdd_shift,clock,reset_b;Datapath_2_STRM0(count,Zero,data,Load_regs,Add_shift,clock,reset_b);initial#250$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;Load_regs=0;Add_shift=0;#10Load_regs=1;#20Load_regs=0;#50Add_shift=1;#140Add_shift=0;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.273Name050100150clockreset_bLoad_regsAdd_shiftZerodata[7:0]aaR1[7:0]xxaa552a150a05020100R2[3:0]x01234count[3:0]x01234//IntegratedsystemmoduleCount_Ones_2_Gates_1Hot_STR#(parameterdp_width=8,R2_width=4)(output[R2_width-1:0]count,input[dp_width-1:0]data,inputStart,clock,reset_b);wireLoad_regs,Add_shift,Zero;课后答案网Controller_2_Gates_1HotM0(Ready,Load_regs,Add_shift,Start,Zero,clock,reset_b);Datapath_2_STRM1(count,Zero,data,Load_regs,Add_shift,clock,reset_b);endmodule//Testplanforintegratedsystemwww.hackshp.cn//Testfordatavaluesof8"haa,8"h00,8"hff.//Testbenchforintegratedsystemmodulet_Count_Ones_2_Gates_1Hot_STR();parameterdp_width=8,R2_width=4;wire[R2_width-1:0]count;reg[dp_width-1:0]data;regStart,clock,reset_b;wire[1:0]state={M0.M0.T1,M0.M0.T0};Count_Ones_2_Gates_1Hot_STRM0(count,data,Start,clock,reset_b);initial#700$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginreset_b=0;#2reset_b=1;endinitialforkdata=8"haa;//Expectcount=4Start=0;#20Start=1;#30Start=0;#40data=8"b00;//Expectcount=0#120Start=1;#130Start=0;#150data=8"hff;//Expectcount=8#200Start=1;#210Start=0;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.274Name080160240320400clockreset_bStartZeroLoad_regsAdd_shiftstate[1:0]1212121data[7:0]aa00ffR1[7:0]xx00ff7f3f1f0f00R2[3:0]x01234012345678count[3:0]x012340123456788.38moduleProb_8_38(outputreg[7:0]Sum,outputregCar_Bor,input[7:0]Data_A,Data_B);reg[7:0]Reg_A,Reg_B;always@(Data_A,Data_B)case({Data_A[7],Data_B[7]})课后答案网2"b00,2"b11:begin//++,--{Car_Bor,Sum[6:0]}=Data_A[6:0]+Data_B[6:0];Sum[7]=Data_A[7];www.hackshp.cnenddefault:if(Data_A[6:0]>=Data_B[6:0])begin//+-,-+{Car_Bor,Sum[6:0]}=Data_A[6:0]-Data_B[6:0];Sum[7]=Data_A[7];endelsebegin{Car_Bor,Sum[6:0]}=Data_B[6:0]-Data_A[6:0];Sum[7]=Data_B[7];endendcaseendmodulemodulet_Prob_8_38();wire[7:0]Sum;wireCar_Bor;reg[7:0]Data_A,Data_B;wire[6:0]Mag_A,Mag_B;assignMag_A=M0.Data_A[6:0];//HierarchicaldereferencingassignMag_B=M0.Data_B[6:0];wireSign_A=M0.Data_A[7];wireSign_B=M0.Data_B[7];wireSign=Sum[7];wire[7:0]Mag=Sum[6:0];Prob_8_38M0(Sum,Car_Bor,Data_A,Data_B);initial#650$finish;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.275initialfork//Addition//AB#0beginData_A={1"b0,7"d25};Data_B={1"b0,7"d10};end//+25,+10#40beginData_A={1"b1,7"d25};Data_B={1"b1,7"d10};end//-25,-10#80beginData_A={1"b1,7"d25};Data_B={1"b0,7"d10};end//-25,+10#120beginData_A={1"b0,7"d25};Data_B={1"b1,7"d10};end//25,-10//BA#160beginData_B={1"b0,7"d25};Data_A={1"b0,7"d10};end//+25,+10#200beginData_B={1"b1,7"d25};Data_A={1"b1,7"d10};end//-25,-10#240beginData_B={1"b1,7"d25};Data_A={1"b0,7"d10};end//-25,+10#280beginData_B={1"b0,7"d25};Data_A={1"b1,7"d10};end//+25,-10//Additionofmatchingnumbers#320beginData_A={1"b1,7"d0};Data_B={1"b1,7"d0};end//-0,-0#360beginData_A={1"b0,7"d0};Data_B={1"b0,7"d0};end//+0,+0#400beginData_A={1"b0,7"d0};Data_B={1"b1,7"d0};end//+0,-0#440beginData_A={1"b1,7"d0};Data_B={1"b0,7"d0};end//-0,+0#480beginData_B={1"b0,7"d25};Data_A={1"b0,7"d25};end//matching+#520beginData_B={1"b1,7"d25};Data_A={1"b1,7"d25};end//matching–//Testofcarry(negativenumbers)#560beginData_A=8"hf0;Data_B=8"hf0;end//carry--//Testofcarry(positivenumbers)#600begin课后答案网Data_A=8"h70;Data_B=8"h70;end//carry++joinendmodulewww.hackshp.cn0190380570NameData_A[7:0]1999190a8a0a8a8000801999f070Data_B[7:0]0a8a0a8a199919800080001999f070Sign_ASign_BMag_A[6:0]2510025112Mag_B[6:0]1025025112Car_BorSum[7:0]23a38f0f23a38f0f80008032b2e060SignMag[7:0]3515351505096DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2768.39BlockdiagramandASMDchart:data_ARdata_BR1616zeroDatapathLd_regsAR...Add_decrBRController...startPRdone...reset_b16clockPRreset_bs0课后答案网doneAR<=data_ABR<=data_BstartPR<=01www.hackshp.cnLd_regsPR<=PR+BRs1AR<=AR-11Add_decrZeromoduleProb_8_39(output[15:0]PR,outputdone,input[7:0]data_AR,data_BR,inputstart,clock,reset_b);Controller_P8_39M0(done,Ld_regs,Add_decr,start,zero,clock,reset_b);Datapath_P8_39M1(PR,zero,data_AR,data_BR,Ld_regs,Add_decr,clock,reset_b);endmodulemoduleController_P8_16(outputdone,outputregLd_regs,Add_decr,inputstart,zero,clock,reset_b);parameters0=1"b0,s1=1"b1;regstate,next_state;assigndone=(state==s0);DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.277always@(posedgeclock,negedgereset_b)if(!reset_b)state<=s0;elsestate<=next_state;always@(state,start,zero)beginLd_regs=0;Add_decr=0;case(state)s0:if(start)beginLd_regs=1;next_state=s1;ends1:if(zero)next_state=s0;elsebeginnext_state=s1;Add_decr=1;enddefault:next_state=s0;endcaseendendmodulemoduleDatapath_P8_16(outputreg[15:0]PR,outputzero,input[7:0]data_AR,data_BR,inputLd_regs,Add_decr,clock,reset_b);reg[7:0]AR,BR;assignzero=~(|AR);always@(posedgeclock,negedgereset_b)if(!reset_b)beginAR<=8"b0;BR<=8"b0;PR<=16"b0;endelsebeginif(Ld_regs)beginAR<=data_AR;BR<=data_BR;PR<=0;endelseif(Add_decr)课后答案网beginPR<=PR+BR;AR<=AR-1;endendendmodule//Testplan–Verify;//Power-upresetwww.hackshp.cn//Dataisloadedcorrectly//Controlsignalsassertcorrectly//Statussignalsassertcorrectly//startisignoredwhilemultiplying//Multiplicationiscorrect//Recoveryfromreseton-the-flymodulet_Prob_P8_16;wiredone;wire[15:0]PR;reg[7:0]data_AR,data_BR;regstart,clock,reset_b;Prob_8_16M0(PR,done,data_AR,data_BR,start,clock,reset_b);initial#500$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkreset_b=0;#12reset_b=1;#40reset_b=0;#42reset_b=1;#90reset_b=1;#92reset_b=1;joinDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.278initialfork#20start=1;#30start=0;#40start=1;#50start=0;#120start=1;#120start=0;joininitialforkdata_AR=8"d5;//AR>0data_BR=8"d20;#80data_AR=8"d3;#80data_BR=8"d9;#100data_AR=8"d4;#100data_BR=8"d9;joinendmoduleName0306090120reset_bclock课后答案网startLd_regsAdd_decrwww.hackshp.cnzerostatedata_AR[7:0]534data_BR[7:0]209AR[7:0]0540543210BR[7:0]020020donePR[15:0]0020406080100DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2798.40Data_in[7:0]8Shift_inDatapathReadyAShift_regsGot_DataAdd_regsBDone_ProductControllerStartDecr_PQRunShift_outSend_DataCPreset_bclock8ZeroQ0Note:Q0=Q[0]Data_out[7:0]课后答案网www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.280resetS_idle/ReadyB[7:0]<=Data_in…B[31:24]<=Data_inQ[7:0]<=Data_in…Q[31:24]<=Data_inStart1Shift_inS_Ld_0...6Thebytesofdatawillbereadsequentially.Registers/Shift_inQandBareorganizedtoactasbyte-wideparallelshiftregisters,taking8clockcyclestofillthepipe.TheleastsignificantbyteofthemultiplicandentersS_Ld__7themostsignificantbyteofQandthenmoves/Got_DataS_wait_1throughthebytesofQtoenterB,thenproceedtooccupysuccessivebytesofBuntilitoccupiestheRunRunleastsignificantbyteofB,andsoforthuntilbothB1andQarefilled.WaitstatesareusedtowaitforRun1andSend_Data.S_addP<=P-1/Decr_P{C,A}<=A+B1课后答案网Q0Add_regsS_shiftwww.hackshp.cn/Shift_regsZero1S_productS_wait_2/Done_ProductSend_Send_DataData11Shift_outShift_outS_Send_0...6/Shift_outData_out<=P[7:0]…P[31:24]DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.281moduleProb_8_40(output[7:0]Data_out,outputReady,Got_Data,Done_Product,input[7:0]Data_in,inputStart,Run,Send_Data,clock,reset_b);ControllerM0(Ready,Shift_in,Got_Data,Done_Product,Decr_P,Add_regs,Shift_regs,Shift_out,Start,Run,Send_Data,Zero,Q0,clock,reset_b);DatapathM1(Data_out,Q0,Zero,Data_in,Start,Shift_in,Decr_P,Add_regs,Shift_regs,Shift_out,clock);endmodulemoduleController(outputregReady,Shift_in,Got_Data,Done_Product,Decr_P,Add_regs,Shift_regs,Shift_out,inputStart,Run,Send_Data,Zero,Q0,clock,reset_b);parameterS_idle=5"d20,S_Ld_0=5"d0,S_Ld_1=5"d1,S_Ld_2=5"d2,S_Ld_3课后答案网=5"d3,S_Ld_4=5"d4,S_Ld_5=5"d5,S_Ld_6=5"d6,S_Ld_7=5"d7,S_wait_1www.hackshp.cn=5"d8,//WaitstateS_add=5"d9,S_Shift=5"d10,S_product=5"d11,S_wait_2=5"d12,//WaitstateS_Send_0=5"d13,S_Send_1=5"d14,S_Send_2=5"d15,S_Send_3=5"d16,S_Send_4=5"d17,S_Send_5=5"d18,S_Send_6=5"d19;reg[4:0]state,next_state;always@(posedgeclock,negedgereset_b)if(~reset_b)state<=S_idle;elsestate<=next_state;always@(state,Start,Run,Q0,Zero,Send_Data)beginnext_state=S_idle;//PreventaccidentalsynthesisoflatchesReady=0;Shift_in=0;Shift_regs=0;Add_regs=0;Decr_P=0;Shift_out=0;Got_Data=0;Done_Product=0;DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.282case(state)//AssignbyexceptiontodefaultvaluesS_idle:beginReady=1;if(Start)beginnext_state=S_Ld_0;Shift_in=1;endendS_Ld_0:beginnext_state=S_Ld_1;Shift_in=1;endS_Ld_1:beginnext_state=S_Ld_2;Shift_in=1;endS_Ld_2:beginnext_state=S_Ld_3;Shift_in=1;endS_Ld_3:beginnext_state=S_Ld_4;Shift_in=1;endS_Ld_4:beginnext_state=S_Ld_5;Shift_in=1;endS_Ld_5:beginnext_state=S_Ld_6;Shift_in=1;endS_Ld_6:beginnext_state=S_Ld_7;Shift_in=1;endS_Ld_7:beginGot_Data=1;if(Run)next_state=S_add;elsenext_state=S_wait_1;endS_wait_1:if(Run)next_state=S_add;elsenext_state=S_wait_1;S_add:beginnext_state=S_Shift;Decr_P=1;if(Q0)Add_regs=1;endS_Shift:beginShift_regs=1;if(Zero)next_state=S_product;elsenext_state=S_add;endS_product:beginDone_Product=1;if(Send_Data)beginnext_state=S_Send_0;Shift_out=1;endelsenext_state=S_wait_2;endS_wait_2:if(Send_Data)beginnext_state=S_Send_0;Shift_out=1;endelsenext_state=S_wait_2;S_Send_0:课后答案网beginnext_state=S_Send_1;Shift_out=1;endS_Send_1:beginnext_state=S_Send_2;Shift_out=1;endS_Send_2:beginnext_state=S_Send_3;Shift_out=1;endS_Send_3:beginnext_state=S_Send_4;Shift_out=1;endS_Send_4:beginnext_state=S_Send_5;Shift_out=1;endS_Send_5:www.hackshp.cnbeginnext_state=S_Send_6;Shift_out=1;endS_Send_6:beginnext_state=S_idle;Shift_out=1;enddefault:next_state=S_idle;endcaseendendmodulemoduleDatapath#(parameterdp_width=32,P_width=6)(output[7:0]Data_out,outputQ0,Zero,input[7:0]Data_in,inputStart,Shift_in,Decr_P,Add_regs,Shift_regs,Shift_out,clock);reg[dp_width-1:0]A,B,Q;//SizedfordatapathregC;reg[P_width-1:0]P;assignQ0=Q[0];assignZero=(P==0);//counteriszeroassignData_out={C,A,Q};always@(posedgeclock)beginif(Shift_in)beginP<=dp_width;A<=0;C<=0;B[7:0]<=B[15:8];//TreatBandQregistersasapipelinetoloaddatabytesB[15:8]<=B[23:16];B[23:16]<=B[31:24];B[31:24]<=Q[7:0];Q[7:0]<=Q[15:8];DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.283Q[15:8]<=Q[23:16];Q[23:16]<=Q[31:24];Q[31:24]<=Data_in;endif(Add_regs){C,A}<=A+B;if(Shift_regs){C,A,Q}<={C,A,Q}>>1;if(Decr_P)P<=P-1;if(Shift_out)begin{C,A,Q}<={C,A,Q}>>8;endendendmodulemodulet_Prob_8_40;parameterdp_width=32;//Widthofdatapathwire[7:0]Data_out;wireReady,Got_Data,Done_Product;regStart,Run,Send_Data,clock,reset_b;integerExp_Value;regError;wire[7:0]Data_in;reg[dp_width-1:0]Multiplicand,Multiplier;reg[2*dp_width-1:0]Data_register;//FortestpatternsassignData_in=Data_register[7:0];wire[2*dp_width-1:0]product;assignproduct={M0.M1.C,M0.M1.A,M0.M1.Q};Prob_8_40M0(Data_out,Ready,Got_Data,Done_Product,Data_in,Start,Run,Send_Data,clock,reset_b课后答案网);initial#2000$finish;initialbeginclock=0;forever#5clock=~clock;endinitialforkwww.hackshp.cnreset_b=1;#2reset_b=0;#3reset_b=1;joininitialforkStart=0;Run=0;Send_Data=0;#10Start=1;#20Start=0;#50Run=1;//Ignoredbycontroller#60Run=0;#120Run=1;#130Run=0;#830Send_Data=1;#840Send_Data=0;join//TestpatternsformultiplicationinitialbeginMultiplicand=32"h0f_00_00_aa;Multiplier=32"h0a_00_00_ff;Data_register={Multiplier,Multiplicand};endinitialbegin//SynchronizeinputdatabytesDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.284@(posedgeStart)repeat(15)begin@(negedgeclock)Data_register<=Data_register>>8;endendendmoduleSimulationresults:Loadingmultiplicand(0f0000aaH)andmultiplier(0a0000ffH),4byteseach,insequence,beginningwiththeleastsignificantbyteofthemultiplicand.Note:ProductisnotvaliduntilDone_Productasserts.ThevalueofProductshownhere(25510)reflectsthecontentsof{C,A,Q}afterthemultiplierhasbeenloaded,priortomultiplication.Note:ThemachineignoresaprematureassertionofRun.thNote:Got_Dataassertsatthe8clockafterStartasserts,i.e.,8clockstoloadthedata.Note:Product,Multiplier,andMultiplicandareformedinthetestbench.课后答案网www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.285LaunchactivityLoading8bytesIgnoreRunWaitingforRunRespondtoatrisingedgeofRunofdataclockName04080120160clockreset_bStartRunSend_DataZeroQ0ReadyGot_DataDone_ProductShift_inShift_regsAdd_regsDecr_PShift_outstate[4:0]20012345678910910Data_in[7:0]1700152550100P[31:0]x323130B[31:0]课后答案网xxxxxxxx0f0000aaCA[31:0]00000000Q[31:0]0a0000ffMultiplicand[31:0]0f0000aaMultiplicand[31:0]www.hackshp.cn251658410Multiplier[31:0]0a0000ffMultiplier[31:0]167772415product[63:0]000000000a0000ffproduct[63:0]xxxX167772415Data_out[7:0]x170015255127DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.286Note:Product(64bits)isformedcorrectlyBeginsendingdatabytesMultiplicationcompleteWaitingforSend_Dataofproduct.Name735785835885935clockreset_bStartRunSend_DataZeroQ0ReadyGot_DataDone_ProductShift_inShift_regsAdd_regsDecr_PShift_outstate[4:0]课后答案网1091011121314151617181920Data_in[7:0]0P[31:0]10B[31:0]0f0000aaCA[31:0]www.hackshp.cn0096001500000000Q[31:0]9500a95600000000Multiplicand[31:0]0f0000aaMultiplicand[31:0]251658410Multiplier[31:0]0a0000ffMultiplier[31:0]167772415product[63:0]009600159500a956product[63:0]422213392007601500Data_out[7:0]881728602100DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.287BeginsendingdataDatasent-{C,A,Q}MultiplicationcompleteWaitingforSend_Databytesofproduct.empty.State=S_idleName735785835885935clockreset_bStartRunSend_DataZeroQ0ReadyGot_DataDone_ProductShift_inShift_regsAdd_regsDecr_PShift_outstate[4:0]1091011121314151617181920Data_in[7:0]0P[31:0]课后答案网10B[31:0]0f0000aaCA[31:0]0096001500000000Q[31:0]9500a95600000000Multiplicand[31:0]www.hackshp.cn0f0000aaMultiplicand[31:0]251658410Multiplier[31:0]0a0000ffMultiplier[31:0]167772415product[63:0]009600159500a956product[63:0]422213392007601500Data_out[7:0]881728602100DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.2888.41(a)DataP1[7:0]P0[7:0]888P1[7:0]P0[7:0]R0[15:0]{P1,P0}<={0,0}S_idleClr_P1_P01rstEn1P1<=DataLd_P1_P0P0<=P1{P1,P0}<={0,0}1P1<=DataS_1P0<=P1Ld_P1_P0Clr_P1_P0课后答案网S_fullld_P1_P0S_waitLdP1<=DataP0<=P1www.hackshp.cn111LdLd_R0EnR0<={P1,P0}(b)HDLmodel,testbenchandsimulationresultsfordatapathunit.moduleDatapath_unit(outputreg[15:0]R0,input[7:0]Data,inputClr_P1_P0,Ld_P1_P0,Ld_R0,clock,rst);reg[7:0]P1,P0;always@(posedgeclock)beginif(Clr_P1_P0)beginP1<=0;P0<=0;endif(Ld_P1_P0)beginP1<=Data;P0<=P1;endif(Ld_R0)R0<={P1,P0};endendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.289//Testbenchfordatapathmodulet_Datapath_unit();wire[15:0]R0;reg[7:0]Data;regClr_P1_P0,Ld_P1_P0,Ld_R0,clock,rst;Datapath_unitM0(R0,Data,Clr_P1_P0,Ld_P1_P0,Ld_R0,clock,rst);initial#100$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginrst=0;#2rst=1;endinitialfork#20Clr_P1_P0=0;#20Ld_P1_P0=0;#20Ld_R0=0;#20Data=8"ha5;#40Ld_P1_P0=1;#50Data=8"hff;#60Ld_P1_P0=0;#70Ld_R0=1;#80Ld_R0=0;joinendmodule050100Name课后答案网clockrstClr_P1_P0www.hackshp.cnLd_P1_P0Ld_R0Data[7:0]xxa5ffP1[7:0]xxa5ffP0[7:0]xxa5R0[15:0]xxxxffa5DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.290(c)HDLmodel,testbench,andsimulationresultsforthecontrolunit.moduleControl_unit(outputregClr_P1_P0,Ld_P1_P0,Ld_R0,inputEn,Ld,clock,rst);parameterS_idle=4"b0001,S_1=4"b0010,S_full=4"b0100,S_wait=4"b1000;reg[3:0]state,next_state;always@(posedgeclock)if(rst)state<=S_idle;elsestate<=next_state;always@(state,Ld,En)beginClr_P1_P0=0;//AssignbyexceptionLd_P1_P0=0;Ld_R0=0;next_state=S_idle;case(state)S_idle:if(En)beginLd_P1_P0=1;next_state=S_1;endelsenext_state=S_idle;S_1:beginLd_P1_P0=1;next_state=S_full;endS_full:if(!Ld)next_state=S_wait;elsebeginLd_R0=1;if(En)beginLd_P1_P0=1;next_state=S_1;endelsebeginClr_P1_P0=1;next_state=S_idle;ende课后答案网ndS_wait:if(!Ld)next_state=S_wait;elsebeginLd_R0=1;www.hackshp.cnif(En)beginLd_P1_P0=1;next_state=S_1;endelsebeginClr_P1_P0=1;next_state=S_idle;endenddefault:next_state=S_idle;endcaseendendmodule//Testbenchforcontrolunitmodulet_Control_unit();wireClr_P1_P0,Ld_P1_P0,Ld_R0;regEn,Ld,clock,rst;Control_unitM0(Clr_P1_P0,Ld_P1_P0,Ld_R0,En,Ld,clock,rst);initial#200$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginrst=0;#2rst=1;#12rst=0;endinitialfork#20Ld=0;#20En=0;#30En=1;//DrivetoS_wait#70Ld=1;//ReturntoS_1toS_fulltpS_wait#80Ld=0;#100Ld=1;//DrivetoS_idle#100En=0;#110En=0;#120Ld=0;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.291050100150NameclockrstEnLdClr_P1_P0Ld_P1_P0Ld_R0state[3:0]x12482481(c)IntegratedsystemNotethatthetestbenchfortheintegratedsystemusestheinputstimulifromthetestbenchforthecontrolunitanddisplaysthewaveformsproducedbythetestbenchforthedatapathunit.:moduleProb_8_41(output[15:0]R0,input[7:0]Data,inputEn,Ld,clock,rst);wireClr_P1_P0,Ld_P1_P0,Ld_R0;课后答案网Control_unitM0(Clr_P1_P0,Ld_P1_P0,Ld_R0,En,Ld,clock,rst);Datapath_unitM1(R0,Data,Clr_P1_P0,Ld_P1_P0,Ld_R0,clock);endmodulewww.hackshp.cnmoduleControl_unit(outputregClr_P1_P0,Ld_P1_P0,Ld_R0,inputEn,Ld,clock,rst);parameterS_idle=4"b0001,S_1=4"b0010,S_full=4"b0100,S_wait=4"b1000;reg[3:0]state,next_state;always@(posedgeclock)if(rst)state<=S_idle;elsestate<=next_state;always@(state,Ld,En)beginClr_P1_P0=0;//AssignbyexceptionLd_P1_P0=0;Ld_R0=0;next_state=S_idle;case(state)S_idle:if(En)beginLd_P1_P0=1;next_state=S_1;endelsenext_state=S_idle;S_1:beginLd_P1_P0=1;next_state=S_full;endS_full:if(!Ld)next_state=S_wait;elsebeginLd_R0=1;if(En)beginLd_P1_P0=1;next_state=S_1;endelsebeginClr_P1_P0=1;next_state=S_idle;endendS_wait:if(!Ld)next_state=S_wait;elsebeginDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.292Ld_R0=1;if(En)beginLd_P1_P0=1;next_state=S_1;endelsebeginClr_P1_P0=1;next_state=S_idle;endenddefault:next_state=S_idle;endcaseendendmodulemoduleDatapath_unit(outputreg[15:0]R0,input[7:0]Data,inputClr_P1_P0,Ld_P1_P0,Ld_R0,clock);reg[7:0]P1,P0;always@(posedgeclock)beginif(Clr_P1_P0)beginP1<=0;P0<=0;endif(Ld_P1_P0)beginP1<=Data;P0<=P1;endif(Ld_R0)R0<={P1,P0};endendmodule课后答案网//Testbenchforintegratedsystemmodulet_Prob_8_41();wire[15:0]R0;reg[7:0]Data;regwww.hackshp.cnEn,Ld,clock,rst;Prob_8_41M0(R0,Data,En,Ld,clock,rst);initial#200$finish;initialbeginclock=0;forever#5clock=~clock;endinitialbeginrst=0;#10rst=1;#20rst=0;endinitialfork#20Data=8"ha5;#50Data=8"hff;#20Ld=0;#20En=0;#30En=1;//DrivetoS_wait#70Ld=1;//ReturntoS_1toS_fulltpS_wait#80Ld=0;#100Ld=1;//DrivetoS_idle#100En=0;#110En=0;#120Ld=0;joinendmoduleDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.293Name04080120clockrstEnLdClr_P1_P0Ld_P1_P0Ld_R0state[3:0]x12482481Data[7:0]xxa5ffP1[7:0]xxa5ff00P0[7:0]xxa5ff00R0[15:0]xxxxa5a5ffff课后答案网www.hackshp.cnDigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved. ©2007PearsonEducation,Inc.,UpperSaddleRiver,NJ.Allrightsreserved.ThispublicationisprotectedbyCopyrightandwrittenpermissionshouldbeobtained课后答案网:www.hackshp.cnfromthepublisherpriortoanyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyformorbyanymeans,electronic,mechanical,photocopying,recording,若侵犯了您的版权利益,敬请来信告知!orlikewise.Forinformationregardingpermission(s),writeto:RightsandPermissionsDepartment,PearsonEducation,Inc.,UpperSaddleRiver,NJ07458.294CHAPTER99.1(a)Asynchronouscircutisdonotuseclockpulsesandchangestateinresponsetoinputchanges.Synchronouscircuitsuseclockpulsesandachangeofstateoccursinreponsetotheclocktransition.(b)Theinputsignalschangeoneatatimewhenthecircuitisstable.(c)Thecircuitisinastablestatewhentheexcitationvariables(Y)areequaltothesecondaryvariables(y)(seeF.9.1).Unstableotherwise.(d)Thetotalstateisthecombinationofbinaryvaluesoftheinternalstateandtheinputs.9.2Y1=x1"x2+y1x2Y2=x1y2+x2yxx112yy120001111000001101000100110101xx:00,10,11,01,11,10,0012x2yy:00,00,01,11,11,01,00121100111101x1课后答案网1000111100ywww.hackshp.cn29.3(a)Y=xx"+(x+x")yx12121xz=y2y(b)xx11xxxx1212yy00011110000111100000100000y11011y11111xx22(c)DigitalDesign–SolutionManual.M.Mano.M.D.Ciletti,Copyright2007,Allrightsreserved.'

您可能关注的文档