Apr 29, 2004 #1 D dd2001 Full Member level 4 Joined Apr 14, 2002 Messages 236 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,298 Activity points 1,912 How to write a variable clock generator? always #cycle clk = ~clk; want to cycle auto increse 10 every #500. Any one guru can help?
How to write a variable clock generator? always #cycle clk = ~clk; want to cycle auto increse 10 every #500. Any one guru can help?
Apr 30, 2004 #2 S sandusty Member level 5 Joined Apr 19, 2004 Messages 89 Helped 3 Reputation 6 Reaction score 1 Trophy points 1,288 Activity points 910 Use several clock sources, then mux those clocks together and that mux controled by counter(s). Since its not synthesisable, you need NOT to worry about the glitchs, load....
Use several clock sources, then mux those clocks together and that mux controled by counter(s). Since its not synthesisable, you need NOT to worry about the glitchs, load....
May 1, 2004 #3 K karlheinz Member level 1 Joined Feb 9, 2003 Messages 32 Helped 1 Reputation 2 Reaction score 0 Trophy points 1,286 Activity points 252 Is this what you want ? `define cycle_main 100 `define cycle_inc 500 `define inc 10 integer tinc; initial begin tinc = 0; clk <= 0; end always begin #(`cycle_main + tinc) clk <= ~clk; end always begin #(`cycle_inc) tinc = tinc + `inc; end
Is this what you want ? `define cycle_main 100 `define cycle_inc 500 `define inc 10 integer tinc; initial begin tinc = 0; clk <= 0; end always begin #(`cycle_main + tinc) clk <= ~clk; end always begin #(`cycle_inc) tinc = tinc + `inc; end
May 3, 2004 #4 D dd2001 Full Member level 4 Joined Apr 14, 2002 Messages 236 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,298 Activity points 1,912 Well, karlheinz: It is very close, I just want it functions like a VCO, if feedback 7-bit data changed, then frequency also follow. Thnaks.
Well, karlheinz: It is very close, I just want it functions like a VCO, if feedback 7-bit data changed, then frequency also follow. Thnaks.