1:实验目的:了解QuartusII以及ModelsimSE10的联合仿真。
2:实验代码:
module DEC2x4 (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 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,s1,c_in);
and (c2,s1,c_in);
or (c_out,c2,c1);
endmodule
3:实验截图: