电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

VerilogHDL数字设计与综合(第二版)第五章课后习题答案VIP免费

VerilogHDL数字设计与综合(第二版)第五章课后习题答案_第1页
1/8
VerilogHDL数字设计与综合(第二版)第五章课后习题答案_第2页
2/8
VerilogHDL数字设计与综合(第二版)第五章课后习题答案_第3页
3/8
1.利用双输入端的nand 门,用Verilog 编写自己的双输入端的与门、或门和非门,把它们分别命名为 my_or,my_and 和 my_not,并通过激励模块验证这些门的功能。 答:`timescale 1ns/1ns /**************************** ********** my_and *********** ****************************/ module my_and(in1,in2,out); input in1,in2; output out; wire out1; nand a1(out,out1,out1); nand a2(out1,in1,in2); endmodule /**************************** ********** my_or ************ ****************************/ module my_or(in1,in2,out); input in1,in2; output out; wire out1,out2; nand o1(out,out1,out2); nand o2(out1,in1,in1); nand o3(out2,in2,in2); endmodule /**************************** ********** my_not *********** ****************************/ module my_not(in,out); input in; output out; nand n1(out,in,in); endmodule /**************************** ********** test *********** ****************************/ module test; reg a,b; wire and_c,or_c,not_c; initial begin a<=0;b<=0; #10 a<=0;b<=1; #10 a<=1;b<=0; #10 a<=1;b<=1; #10 $stop; end my_and myand1(a,b,and_c); my_or myor1(a,b,or_c); my_not mynot1(a,not_c); endmodule 2.使用上题中完成的my_or,my_and 和 my_not 门构造一个双输入端的x or 门,其功能是计算 z 第5章 门 级 建 模 4 1 = x’y + x y’,其中x 和y 为输入,z 为输出;编写激励模块对x 和y 的四种输入组合进行测试仿真。 答:在上题代码的基础上,添加如下代码:(注意,xor 在仿真器中已自备,这里用 my_xor) /**************************** ********* my_xor ********** ********* z=x'y+xy' ********* ****************************/ module my_xor(in1,in2,out); input in1,in2; output out; wire not_in1,not_in2,out_a1,out_a2; my_not mynot1(in1,not_in1); my_not mynot2(in2,not_in2); my_and myand1(in1,not_in2,out_a1); my_and myand2(in2,not_in1,out_a2); my_or myor1(out_a1,out_a2,out); endmodule module test52; reg x,y; wire z; initial begin x<=0;y<=0; #10 x<=0;y<=1; #10 x<=1;y<=0;...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

VerilogHDL数字设计与综合(第二版)第五章课后习题答案

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部