1.实验目的:掌握ModelSim仿真流程
2.实验内容:ModelSim基本仿真流程
3.实验代码:
module fulladd(sum,c_cut,a,b,c_in);
output sum,c_cut;
input a,b,c_in;
wire s1,c1,c2;
xor (s1,a,b);
and (c1,a,b);
xor (sum,s1,c_in);
and (c2,s1,c_in);
or (c_out,c2,c1);
endmodule
module test;
wire sum,c_out;
reg a,b,c_in;
fulladd fadd(sum,c_out,a,b,c_in);
initial
begin
a=0;b=0;c_in=0;
#10 a=0;b=0;c_in=1;
#10 a=0;b=1;c_in=1;
#10 a=0;b=1;c_in=1;
#10 a=1;b=0;c_in=0;
#10 a=1;b=0;c_in=1;
#10 a=1;b=1;c_in=0;
#10 a=1;b=1;c_in=1;
#10 $stop;
end
endmodule
4.实验截图:
1.建工程:
2.输入工程名并选择路径:
3.添加源文件和测试文件:
4.编译:
5.仿真:
5.实验视频:2.0 Gv:/ Modelsim仿真基本流程;ΦΦPkZ1b3vmui8ΦΦ打開Dou愔搜索
6.实验结果: