|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
源程序如下:在但是仿真波形输出的 y值是 xxxxxxx
module hanshu(x,y
);
input [3:0]x;
output integer y;
function automatic integer factor;
input [3:0]a;
reg [3:0]i;
begin
factor=1;
for(i=2;i<=a;i=i+1)
begin
factor=factor*i;
$display("the value of fanctor at present is :%e",factor);
end
end
endfunction
always@(x)
begin
y=factor(x);
end
endmodule |
|