This Phase Increment Calculator is built specifically for hardware implementation of a Numerically Controlled Oscillator (NCO).
Specify the desired frequency of the output signal of the NCO, the system (or input) clock frequency and the accumulator bit width, to obtain the accumulator value you should use for the NCO.
f_out = [phase_inc/(2N)] * input_clk
Review code: 2-bit Signal Generator (NCO) in Verilog
Recently started using version control BitBucket and I must say sharing code is definitely easier.
So here is the link to the code that generates sin and cos signals according to the required frequency.
It is 2 bit only because the range of values is between [-1,1].
If you are looking for something in the range of [0,1], that would make it a 1 bit NCO which is even easier (you just have to ignore the LSB). Focus only on sin or cos.
This module is great if you have to quickly test something like demodulators etc.
If you figure there are issues or even found a simpler way please feel free to share them.
Alright, I’m onto figuring out the next task, atan in verilog!
P.S. I’m also going to make sharing the code easier on the blog… will try to embed it here.