|
发表于 2009-2-23 17:40:20
|
显示全部楼层
You ask a very good question.
According IEEE 1364-2005 page 341:
The system function $random provides a mechanism for generating random numbers. The function returns
a new 32-bit random number each time it is called. The random number is a signed integer; it can be positive
or negative. For further information on probabilistic random number generators, see 17.9.2.
The seed argument controls the numbers that $random returns so that different seeds generate different
random streams. The seed argument shall be either a reg, an integer, or a time variable. The seed value
should be assigned to this variable prior to calling $random.
For example:
Example 1—Where b is greater than 0, the expression ($random % b) gives a number in the following
range: [(-b+1): (b-1)].
So I think your assumption is wrong. |
|