-1
我剛開始的時候我想檢查我寫的代碼與CRC32.So工作,我得到XXXXXX爲output.I我不知道如果代碼是正確的,雖然CRC32代碼不起作用
module last_time(input [127:0]finalinput,output [31:0]crcout1
,input clk);
wire [31:0]poly;
assign poly=32'h04c11db7;
reg [7:0]lsb;
reg [3:0]i;
reg [7:0]ans;
reg [31:0]nextcrc;
reg [31:0]newcrc;
reg [31:0]crcout;
reg [7:0] lut [255:0];
[email protected](posedge clk)
begin
crcout=32'hffffffff;
lsb=finalinput;
for(i=0;i<16;i=i+1)
begin
ans=(8'hff^(lsb));
newcrc = lut[ans];
$readmemh("table.txt",lut); // to fill lut
nextcrc=(newcrc)^(crcout>>8);
lsb=lsb>>8;
end
end
assign crcout1=nextcrc^32'hffffffff;
endmodule
請,空格是免費的,在例子中使用它們。 – Serge
好的,謝謝你讓我知道。 – Ashley
爲什麼在給它一個值之前抽取'lut'?你爲什麼要加載它16次? – Greg