my program is compile successfully without saving but when i save the project transcript shows error unexpected integers errormodule auto_segment (output [6:0]hex 0,input clk); integer count; always@(posedge clk); begin if(count<9) count<=count+1; else count<=0; end endmodule
Notice the semi-colon after the always? It shouldn't be there - you basically ended the always block after that line. Always indent your code properly, and always use begin and end statements after each "always", "if", "else", "for", and "initial" block. Even if that statement is just one line. It makes it far easier to see what is going on. I also always put the begin on the same line as the "always"/"if"/"else"/etc. statement because it's easier to avoid making mistakes like semi-colons where they shouldn't be.
You also don't have either an initial value (integer count = 0;), or a reset signal, meaning modelsim will never output anything other than 'xxxxx' for count because there is never any time that it gets set to a known value, not depending on its current value.
Hi Adnan Riar,Error in line 4. remove semicolon from always statement. Please find the correct code.
module auto_segment(output hex,input clk); integer count; always@(posedge clk) begin if(count<9)begin count<=count + 1; end else begin count<=0; end end endmoduleBest Regards, Tzi Khang, Lim (This message was posted on behalf of Intel Corporation)