The following code is my first Verilog program. It's running at 25MHz and that's what the counter is for. I'm trying to accomplish the same thing by shifting bits instead of hard coding the output in case statements. I tried LED>1 to no avail. Any comments and suggestions are appreciated!
First, it's worth noting that you are more likely to get an answer on comp.lang.verilog than here - although many of us read both groups.
Second, you can't manipulate output LED as you tried, because it's a wire, not a reg - you declared it correctly as an output, but outputs are wires by default. You need to do the shift operations on the register you've represented as a,b,c,d.
Third, although I can see the sense in your counter arrangement, the second counter is not really necessary - you could use the "bouncing bit" 4-bit register as its own counter.
Fourth, you REALLY need to think about reset strategy - in many FPGA and CPLD devices, flip-flops start life with zero in them, but it's a bad idea to rely on this.
So, here's my suggestion:
(1) Throw away your cnt2 logic and registers a,b,c,d. (2) Make the bouncing-bit counter like this:
reg LeftNotRight; reg [3:0] LED; // This in addition to the output declaration ... always @(posedge clk or posedge reset) if (reset) begin LED