Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- Don't read too much into my syntax and especially >, < etc. The purpose is to give the idea only. A neat way is to have two states (s1,s2) in s1 : count goes up and change state in s2: count goes down and change state --- Quote End --- I've managed to fix that code and it can now produce a PWM by comparing it with a sine wave , using a look up table in VHDL, but now I was asked to produce a sine wave with a C code written for a Nios II core. I've actually written one, but using sin function. Would it be better if I write one with the look up table instead? And plz do you have a simple example for such a code?