+ Post New Thread
Results 21 to 27 of 27
-
7th January 2018, 11:58 #21
- Join Date
- Jan 2008
- Location
- Bochum, Germany
- Posts
- 41,891
- Helped
- 12754 / 12754
- Points
- 241,334
- Level
- 100
Re: irrational clk period
Your question has been already answered, the problem is that you apparently don't understand the answers.
Just run the code in post #1 with any simulation time step resolution according to your requirements, e.g. 10 ps, 1 ps, as you like. The time variable is a real type with sufficient resolution, but the actual wait time interval is rounded according to the simulation time step.
1 members found this post helpful.
-
7th January 2018, 11:58
-
7th January 2018, 20:10 #22
- Join Date
- Mar 2005
- Location
- California, USA
- Posts
- 3,919
- Helped
- 845 / 845
- Points
- 20,317
- Level
- 34
Re: irrational clk period
First of all, your basic premise is wrong. You can't have an "irrational" period. That's a purely mathematical concept.
Set your timing resolution to 1 ps.
Set t_high and t_low=6.849 ns.
Your frequency will be 73003358.1545
1 members found this post helpful.
-
7th January 2018, 20:10
-
7th January 2018, 21:04 #23
- Join Date
- Apr 2016
- Posts
- 1,218
- Helped
- 218 / 218
- Points
- 5,786
- Level
- 18
-
7th January 2018, 21:04
-
8th January 2018, 14:34 #24
- Join Date
- Aug 2016
- Location
- Bangalore, India
- Posts
- 94
- Helped
- 11 / 11
- Points
- 753
- Level
- 6
Re: irrational clk period
You can try this.
Code:procedure cgen(signal clk : out std_logic;) is constant P: time := 13698 ps; constant HIGH_T : time := P/2; constant LOW_T : time := P/2; begin loop clk <= '1'; wait for HIGH_T; clk <= '0'; wait for LOW_T; end loop; end procedure;
And ensure time resolution of your simulator to be 1ps.
-
8th January 2018, 16:06 #25
- Join Date
- Jan 2008
- Location
- Bochum, Germany
- Posts
- 41,891
- Helped
- 12754 / 12754
- Points
- 241,334
- Level
- 100
Re: irrational clk period
Just a minor modification in your code.
-
8th January 2018, 16:30 #26
-
8th January 2018, 16:30
-
8th January 2018, 17:00 #27
- Join Date
- Aug 2016
- Posts
- 10
- Helped
- 1 / 1
- Points
- 352
- Level
- 4
Re: irrational clk period
I think post #4 had your answer, or at least outlined the questions you need answered.
You or somebody else must decide on a clock frequency, its resolution and jitter.
Then match these numbers in your simulator.
Also: it's not an 'irrational' period; it's a repeating fraction
+ Post New Thread
Please login