• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Generating real random number in AMS

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 125
  • Views 11968
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Generating real random number in AMS

RFStuff
RFStuff over 4 years ago

Dear All,

Is there any way we can generate real random number with a given mean and sigma  in AMS (without any any analog block) ?

Kind Regards,

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    You could use the $dist_normal function (which is standard Verilog) and produces an integer random number with the given mean and standard deviation, and then scale the result. For example:

    //
    
    module forum7;
    
    real rnd1;
    integer seed;
    parameter real dmean=1.0;
    parameter real dstddev=0.1;
    parameter integer dscale=1000;
    
    initial begin
        seed=1;
        #2000 $finish;
      end
    
    always #50 begin
        rnd1=($dist_normal(seed,dmean*dscale,dstddev*dscale)+0.0)/dscale;
        $strobe("dist_normal:",rnd1);
      end
    
    endmodule
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RFStuff
    RFStuff over 4 years ago in reply to Andrew Beckett

    Dear Andrerw,

    Thanks  a lot.

    Kind Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information