Sine and Cosine Generator#

This small module is a free running DDS sine and cosine generator.
The frequency is set by the phase_increment input, which is a 32 bit unsigned number that encodes 0 to 2pi (the msb has value pi).
The initial phase is the phase_offset input, which is encoded in the same way as the increment.

The valid input signal loads all inputs into the generator’s internal registers.

Phase Coherency#

The generator has a free running counter that keeps track of time, it has the same parallelism as the phase increment.
The instantanious phase is therefore computed as phase_increment*counter + phase_offset.
If you wish to reset the counter, you can set the rst_coherency_counter input, which resets the counter when it and the valid input are asserted.
By resetting the counter, the “zero time” (e.g. the instant when the phase is phase_offset) is shifted to the time instant when the reset is executed.