Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Generate random numbers between two numbers in ocean script

Status
Not open for further replies.

sitak

Newbie level 3
Joined
Dec 19, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
Hi,

I would like to generate random numbers between two decimal numbers in Ocean Script
eg: 2.5 to 3.5 i need to use this to vary lengths and widths of transistors from ocean script.(RAND_MAX is not known like in C)
Please help me doing this


Thanks,
Sita
 

most random number generators either give a result between 0-1 or give a result that is based on some limit, i.e. random(10) would give a result that is in the range 0-9.

If you want 2 significant digits then you can do something like 2.5+random(11)/10 (i.e. 2.5-3.5 inclusive).

Though I'm not sure if Ocean script allows for math to be performed. I did find that random(x_number) is the function used to generate random numbers.
 
  • Like
Reactions: sitak

    sitak

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top