I'm actually trying for 3 days to make my code works. I have an dev board with multiplexed 7-seg display - it's working. The problem is, when I'm trying to increment a variable. I written code below:
assign buttons = debouncedL | debouncedR;
always @(posedge buttons or negedge RES) begin
if(~RES) number <= 0;
else if(debouncedL) number <= (number + 10);
else if(debouncedR) number <= (number + 1);
end
And it's not working. When I'm pressing R button, variable is incremented by 1, but when I'm pressing L nothing happens. After changing positions of both else if, L button still not work and displayed number is toggling between 0000 and 0001 after pressing R button. It might be newbie question, but I can't find solution in book and on Internet. Can you help me? Thank you in advance.
numberdefined?reg [13:0] number;