Help, Verilog code for frequency "adder and substractor"

Status
Not open for further replies.

sebastian.barbosa

Newbie level 1
Joined
May 12, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
Hello, im new to verilog and i need your help.
I have to create a verilog code capable of "add or substract" frequencies (+-1 Hz).
What i mean is this:

I need a code with (for example) input A, and input B


If I have a 1K [Hz] clock input , I can divide its frequency to (for example) 500 hz . Then the my code has to do this:
If A then add 1 hz to 500hz (now the frequency is 501 hz) , If B then substract 1 hz from my current frequency.


I cant think how to make this code. I know i can divide frequency with counters but add or substract 1 hz is out of my knowledge. Thank you
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…