I'm trying my hand at teaching myself some Verilog. I'm trying to make a mod-10 counter that iterates every second or so. The code I'm trying to modify is some I found on an old forum.
I've tried to use a secondary counter that iterates on every rising edge of the 26th bit of "counter". Am I not allowed to check for such an event? How might I do this in other ways?
always @(posedge clk) begin
if (!enable) begin
counter <= counter + 1;
if (posedge counter[26]) begin
seven_output = seven_output + 1; //iterate the cumulative output state every second ish
end
end
end
Here, seven_output is just another counter whose purpose will be to iterate as described and will be passed to a separate module whose job it will be to determine what combined state of LEDs to return.
The only error description I'm being given is
Line 73: Syntax error near "posedge".
Line 73 is the inner-most if statement.