from the compiler with this code"Bin_BCD.v" line 31 expecting 'endmodule', found 'for'
- Code: Select all
- module Bin_BCD(
 input [7:0] binNum, clk,
 output [9:0] BCDNum
 );
 
 reg [9:0] tmp;
 reg [7:0] count;
 initial tmp = 0;
 // initial count =7;
 
 for( i=7; i >= 0;i=i-1)
 begin
 tmp = tmp << 1;
 tmp[0] = binNum[i];
 if(tmp[3:0] > 4'b0100)
 begin
 tmp[3:0] = tmp[3:0] + 1;
 end
 if(tmp[7:4] > 4'b0100)
 begin
 tmp[7:4] = tmp[7:4] + 1;
 end
 end
 
 endmodule
but I have no idea why or how to fix it could someone please help me?

