+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Newbie level 6
    Points: 115, Level: 1

    Join Date
    Mar 2017
    Posts
    12
    Helped
    0 / 0
    Points
    115
    Level
    1

    Variable width data pulse generator

    Hi

    I wish to make a custom pulse pattern (see attachment). Typically the first bit should have larger duty cycle compare to the following bits. Also the following bits are random in nature...
    I could write the code for making a random sequence. Could you please help me writing the addendum first bit?!

    Thanks



    Click image for larger version. 

Name:	data_input.JPG 
Views:	6 
Size:	22.9 KB 
ID:	139281

    •   Alt8th June 2017, 23:09

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 33,436, Level: 44
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,127
    Helped
    1791 / 1791
    Points
    33,436
    Level
    44

    Re: Variable width data pulse generator

    What have you got so far and what problems are you having?



    •   Alt8th June 2017, 23:55

      advertising

        
       

  3. #3
    Super Moderator
    Points: 26,240, Level: 39
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    5,956
    Helped
    1462 / 1462
    Points
    26,240
    Level
    39

    Re: Variable width data pulse generator

    If the pulse width of the initial value is random in width then algorithmically you want to use the language's random function, i.e in Verilog $random, and perform the following operation:

    random_width = $random % max_range_of_values + offset_starting value;

    So if you want to have the number of bit times be 10-15...
    random_width = $random % 6 + 10;

    Of course none of this is synthesizable.



--[[ ]]--