- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
my program is compile successfully without saving but when i save the project transcript shows error unexpected integers error
module 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 endmoduleLink Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI,
Try changing your code from integer count; to reg [3:0] count; Thanks. Regards, spdl2001 (This message was posted on behalf of Intel Corporation)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not post the actual error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
always@(posedge clk);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
endmodule
Best Regards, Tzi Khang, Lim (This message was posted on behalf of Intel Corporation)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page