- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have random adder error in FSM problem
the current result of reg [15:0]counter is : 1,2,3,4,5,4,5,6
but the correct result would be 1,2,3,4,5,6,7,8
Does anyone know how to fix this, any reply is appreciated.
always@(negedge CLOCK_50)
begin
case(CS)
S0:
begin
if(GPIO_1[9]==1'b0)
begin
counter=counter+1;
CS=S1;
end
else
begin
CS=S0;
end
end
S1:
begin
if(GPIO_1[9]==1'b1)
begin
CS=S0;
end
else
begin
CS=S1;
end
end
endcase
end
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you have to look at the toggling of GPIO_1[9] since that seems to be what's required to continue the count.
#iwork4intel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks and I solve it by add one flip-flop to eliminate the glitch, replace GPIO with synchronized register
always@(negedge CLOCK_50)
begin
REG_GPIO_1_9<= GPIO_1[9];
end
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page