Forum Discussion
Altera_Forum
Honored Contributor
15 years agoThe testbench doesnt match the PWM code you posted. In your PWM code, there is no SW bus.
One other things: When you use a std_logic_vector as a counter (I highly recommend you dont, use the numeric_std library instead of std_logic_arith/unsigned) you dont need to reset it if it gets to max. It will roll over if you get to all ones and roll under if you get to all zeros. You only have to check the value if LED was an integer rather than std_logic_vector.