Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Help about Random Number Generater function

hello everyone, I just start a project that need use some kind of random number generator function, but I failed to convert into a VHDL entity, could anyone give some suggestion how should do that?

This is the funtion:

unsigned F8(unsigned x)

{

x=(x*3+3)&0xFF;

x=x^(11);

return x;

}

Thank U guys

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I just start a project that need use some kind of random number generator function

    --- Quote End ---

    Read this:

    http://www.ovro.caltech.edu/~dwh/correlator/pdf/lfsr_tutorial.pdf

    --- Quote Start ---

    but I failed to convert into a VHDL entity, could anyone give some suggestion how should do that?

    This is the funtion:

    unsigned F8(unsigned x)

    {

    x=(x*3+3)&0xFF;

    x=x^(11);

    return x;

    }

    Thank U guys

    --- Quote End ---

    That's not VHDL.

    Cheers,

    Dave