一.实验目的
能运用Quartus 与 Modelsim 联合仿真
二.实验内容
参照视频内容完成仿真
三.实验原理
按照视频上的内容,书写和运行代码,完成仿真
四.实验工具
电脑和Quartus软件 , Modelsim软件
五.实验过程截图
六.实验视频 打开哔哩哔哩搜索
【大学课程-哔哩哔哩】https://b23.tv/RWyF2Y
七.实验代码
module fulladd(sum,c out,a,b,c in); output sum,c out;
input a,b,c_in;
wire s1,c1,c2;
XOr (s1,a,b);
and(c1,a,b);
XOr (sum,sl,c_in);
and(c2,sl,c in);
(c_out,c2,c1);
endmodule
moduleDEC2x4 (Z A, B , Enable );output[3:0] Z;
input A, B, Enable;
wire Abar, Bbar;
not
not0 ( Abar, A) ,
not1 ( Bbar,B);
nand
nand0 (Z[3],Enable, A,B),
nand1 (Z[0],Enable, Abar,Bbar)nand2 (Z[1],Enable, Abar,B),nand3 (Z[2],Enable, A,Bbar);
endmodule
module tb 22;
reg a,b,e;
wire [3:0]z;
initial
begin
a=0;b=0;e=0;
#10a=0;b=0;e=1;
#10 a=0;b=1;
#10a=1;b=0;
#10a=l;b=1;
#10a=1'bx;b=1'bx;
#10 $stop;
end
DEC2x4 my_dec2x4 (z,a,b,e);
endmodule