Forum Discussion
Altera_Forum
Honored Contributor
15 years agoI guess, pwm_trig is unrelated to clk, at least not guaranteed to meet the required setup and hold time? Then it's not correct to use it, as you do in your logic, it has to be synchronized to clk by two flip-flops.
I assume, this is not the real code.if (pwm_trig==1) //control the slope of the triangle wave.
b=-1;
if (pwm_trig==1)
b=1