Re: Random Number Generator

Discussion in 'VHDL' started by bknpk@hotmail.com, Aug 13, 2013.

  1. Guest

    בת×ריך ×™×•× ×—×ž×™×©×™, 10 ביולי 1997 10:00:00 UTC+3, מ×ת Tim Holmes:
    > Could anyone tell me how to create a "random" number generator in
    > VHDL. I imagine that the only method is to use a LFSR approach with
    > a seed.
    >
    > If there are any other ideas, then please let me know.
    >
    > Cheers.
    >
    > Tim
    > Hewlett Packard


    Take a look at bknpk vhdl:
    "...
    This page explains how I randomize the TTL field values. In this project I have already discussed the issue of generating random numbers. While previous case was merely delay between packets, this one is a little bit complex.When the DUT is in learning state (see FSM description), small changes in the TTL are required. Later an attack scenario is presented to the DUT, by vhdl bench.

    --random numbers generation
    signal rand_ttl_delta : std_logic_vector(3 downto 0) := "1000";
    signal rand_ttl_deltai : integer := 8;
    ....
    rand_ttl_delta <= f_my_rand (4, rand_ttl_delta);
    -- 3 2 1
    -- 109876543210987654321098765
    if(o_tot_cnt(31 downto 5) = "000000000000000000000000000") then
    --small changes during average calculation (learning state)
    gen_rand := "00" & rand_ttl_delta(1 downto 0);
    else
    gen_rand := rand_ttl_delta;
    end if;
    tmp_ptr.data := tmp_ptr.data + gen_rand;
    --
    write(my_line, string'("gen_rand "));
    hwrite(my_line, tmp_ptr.data);
    write(my_line, string'(" "));
    --write(my_line, gen_ipv4);
    hwrite(my_line, o_tot_cnt);
    write(my_line, string'(" "));
    write(my_line, now);
    writeline(output, my_line);
    ...."
    http://bknpk.no-ip.biz/my_web/SDIO/ip_ttl_filter_ttl_rand.html
    , Aug 13, 2013
    #1
    1. Advertising

  2. Rob Gaddi Guest

    On Mon, 12 Aug 2013 23:15:25 -0700 (PDT)
    wrote:

    > בת×ריך ×™×•× ×—×ž×™×©×™, 10 ביולי 1997 10:00:00 UTC+3, מ×ת Tim Holmes:


    While your efforts to try to help out in the community are appreciated,
    you just replied to a string of threads ranging in date from 1998 to
    2005. I'm going to go out on a limb and say that those people either
    solved those problems already, or have moved on to where they no longer
    require solutions.

    --
    Rob Gaddi, Highland Technology -- www.highlandtechnology.com
    Email address domain is currently out of order. See above to fix.
    Rob Gaddi, Aug 13, 2013
    #2
    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. Kingsley Oteng

    Random Number Generator??

    Kingsley Oteng, Apr 27, 2004, in forum: VHDL
    Replies:
    11
    Views:
    52,133
    rahul.iyer
    Aug 9, 2010
  2. tshad

    Random number/letter generator

    tshad, May 5, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    9,555
    tshad
    May 6, 2005
  3. Wally
    Replies:
    1
    Views:
    2,778
    pvdg42
    Mar 20, 2006
  4. globalrev
    Replies:
    4
    Views:
    746
    Gabriel Genellina
    Apr 20, 2008
  5. VK
    Replies:
    15
    Views:
    1,126
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page