一、实验目的
使初学者很快能够熟悉ModelSim的基本,功能,更详细的软件说明和应用举例讲在后续的章节中进行介绍。
二、实验工具
pc机和Quartur ii软件和modlsim软件。
三、实验代码
//Structural specification of a full-adder
module fulladd(Cin,x,y,s,Cout);
input Cin,x,y;
output s,Cout;
and (z1,x,y);
and (z2,x,Cin);
and (z3,y,Cin);
or (Cout,z1,z2,z3);
xor (z4,x,y);
xor (s,z4,Cin);
endmodule
//Structural specification of a full-adder
module fulladd(Cin,x,y,s,Cout);
input Cin,x,y;
output s,Cout;
wire z1,z2,z3,z4;
and And1 (z1,x,y);
and And2 (z2,x,Cin);
and And3 (z3,y,Cin);
or Or1 (Cout,z1,z2,z3);
xor Xor1 (z4,x,y);
xor Xor2 (s,z4,Cin);
endmodule
四、实验截图
五、实验视频