How to implement Random function

Discussion in 'VHDL' started by Karthikeyan Subramaniyam, Feb 24, 2006.

  1. Hi all,
    I'm trying to port Verilog code to VHDL. In that I've $random system
    task in verilog code. Can anyone support me to implement in VHDL
    simplest way.

    ----
    reg seq;
    always
    begin
    #10 seq = $random;
    end
    ----

    like,

    signal seq : std_logic;
    .....

    Thanks & Regards,
    Karthik
     
    Karthikeyan Subramaniyam, Feb 24, 2006
    #1
    1. Advertising

  2. Karthikeyan Subramaniyam wrote:
    > Hi all,
    > I'm trying to port Verilog code to VHDL. In that I've $random system
    > task in verilog code. Can anyone support me to implement in VHDL
    > simplest way.


    See the function "randomize" in the process tb_clk
    in the testbench here:

    http://home.comcast.net/~mike_treseler/test_uart.vhd


    -- Mike Treseler
     
    Mike Treseler, Feb 24, 2006
    #2
    1. Advertising

  3. Karthikeyan Subramaniyam

    Barry Brown Guest

    Package IEEE.math.real defines a function uniform for random variables.


    "Karthikeyan Subramaniyam" <> wrote in message
    news:dtm45f$3u3$...
    > Hi all,
    > I'm trying to port Verilog code to VHDL. In that I've $random system
    > task in verilog code. Can anyone support me to implement in VHDL
    > simplest way.
    >
    > ----
    > reg seq;
    > always
    > begin
    > #10 seq = $random;
    > end
    > ----
    >
    > like,
    >
    > signal seq : std_logic;
    > ....
    >
    > Thanks & Regards,
    > Karthik
     
    Barry Brown, Feb 24, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruza
    Replies:
    18
    Views:
    625
    Neil Cerutti
    Nov 19, 2007
  2. J. Clifford Dyer

    Re: implement random selection in Python

    J. Clifford Dyer, Nov 17, 2007, in forum: Python
    Replies:
    1
    Views:
    494
    Scott David Daniels
    Nov 20, 2007
  3. xz
    Replies:
    2
    Views:
    400
    James Kanze
    Mar 14, 2008
  4. globalrev
    Replies:
    4
    Views:
    775
    Gabriel Genellina
    Apr 20, 2008
  5. VK
    Replies:
    15
    Views:
    1,184
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page