|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
今天遇到一个二进制转BCD码的代码如下:module bin_to_BCD(
input [5:0] bin_in,
output reg [3:0] bcd_unit,bcd_dec);
reg [7:0] bcd_temp;
reg [5:0] bin_data;
integer i;
always@(bin_in)
begin
bcd_temp=8'b0;
bin_data=bin_in;
for(i=0;i<5;i=i+1)
begin
bcd_temp={bcd_temp[6:0],bin_data[5]};
if(bcd_temp[3:0]>4'd4)
bcd_temp[3:0]=bcd_temp[3:0]+4'd3;
else if(bcd_temp[7:4]>4'd4)
bcd_temp[7:4]=bcd_temp[7:4]+4'd3;
bin_data=bin_data<<1;
end
{bcd_dec,bcd_unit}={bcd_temp[6:0],bin_data[5]};
end
endmodule
最后综合的时候却提示:
WARNING:Xst:646 - Signal <bin_data> is assigned but never used. This unconnected signal will be trimmed during the optimization process.
WARNING:Xst:646 - Signal <bcd_temp<7:4>> is assigned but never used. This unconnected signal will be trimmed during the optimization process.
程序经过了功能仿真,看了半天也没琢磨透为什么会有这个警告,求大神指导啊!!! |
|