|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
新手,想写一个除16位数除以400,商四舍五入的模块,折腾了半天,quartus总是报错,不知道什么原因,请高手帮忙看看?
module div_400(A,Div);
input [15:0] A;//被除数
output [8:0] Div;//商
parameter B=16'd400;
reg [8:0] Div;
reg [8:0] Div_temp;
reg [15:0] A_temp;
always@(A)
begin
A_temp=A;
Div_temp=0;
while (A_temp>B)
begin
Div_temp=Div_temp+1;
A_temp=A_temp-B;
end
if (A_temp>=200)
begin
Div=Div_temp+1;
end
else
begin
Div=Div_temp;
end
end
endmodule
编译总是报错Verilog HDL Loop Statement error : loop with non-constant loop condition must terminate within 250 iterations
是什么原因呢? |
|