一、实验名称:
1.modelsim 工程仿真流程
二、实验目的:
1.进一步学会仿真流程
三、实验截图:
四、实验代码:
module
ful ladd(sum,c_ out,a,b,c_ in) ;
output
sum, C out ;
inputa,b,c in;
wi re
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(sun,c_ out,a,b,c_ in) ;
/*
initia1
begin
#15 force fadd. sun=a&b&c_ in;#20 release fadd. sun;
#10 $stop;
end
*/
initia1
begin
a=0;b=0;c_ in=0;
#10 a=0;b=0;c_ in=1;#10 a=0;b=1;c_ in=0;#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