+ Post New Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 27 of 27
  1. #21
    Super Moderator
    Points: 241,334, Level: 100
    Awards:
    1st Helpful Member

    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.

    •   Alt7th January 2018, 11:58

      advertising

        
       

  2. #22
    Advanced Member level 5
    Points: 20,317, Level: 34
    barry's Avatar
    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.

    •   Alt7th January 2018, 20:10

      advertising

        
       

  3. #23
    Advanced Member level 4
    Points: 5,786, Level: 18

    Join Date
    Apr 2016
    Posts
    1,218
    Helped
    218 / 218
    Points
    5,786
    Level
    18

    Re: irrational clk period

    Quote Originally Posted by nsgil85 View Post
    Yes
    Sorry but I do not understand why it is difficult to answer my question
    because you are asking it wrong.
    Really, I am not Sam.



    •   Alt7th January 2018, 21:04

      advertising

        
       

  4. #24
    Member level 5
    Points: 753, Level: 6

    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;
    Just a minor modification in your code.
    And ensure time resolution of your simulator to be 1ps.



  5. #25
    Super Moderator
    Points: 241,334, Level: 100
    Awards:
    1st Helpful Member

    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.
    The code in post #1 will achieve the same.



  6. #26
    Advanced Member level 5
    Points: 20,317, Level: 34
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    3,919
    Helped
    845 / 845
    Points
    20,317
    Level
    34

    Re: irrational clk period

    Quote Originally Posted by FvM View Post
    The code in post #1 will achieve the same.
    25 posts and we have now circumnavigated the thread.



    •   Alt8th January 2018, 16:30

      advertising

        
       

  7. #27
    Newbie level 5
    Points: 352, Level: 4

    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



--[[ ]]--