WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2017-Jan-17 09:20:06

marco
Member
Registered: 2016-Nov-06
Posts: 21

Random numbers generation

Hi,

I am working with 802.11 Ref Design and I want how to generate random numbers between 0 and MAX_BOUND. Is it possible to use rand() function and how to seed the generator in this case?

Thanks

Offline

 

#2 2017-Jan-17 09:27:09

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Random numbers generation

The MicroBlaze stdlib includes a rand() function; we use this in the 802.11 ref design rand_num_slots() function, for example. The rand() function returns pseudo-random values uniformly distributed between 0 and RAND_MAX (2^31 I think). You can scale the return values as needed to realize a different range.

Offline

 

Board footer