[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [oc] Again! modulo arithmetic hardware
On Tue, Mar 12, 2002 at 12:34:30PM -0800, Tantos Andras wrote:
> Hi!
>
> It seems I'll make quite of a thread on my own... :-)
ok - I'll bite
>
> There was a bug in the previous posting. Here's a better one:
>
> > if (Rand(3..0) < 10) then
> > Output <= Rand;
so there is 10 chances in 16 of getting 0..9
> > end if;
> > if (Rand(3..0) > 9) and (Rand(3..0) < 15) then
> > if (Rand(4) = 1) then
> > Output <= Rand(3..0) - 5;
and also (6 / 16) /2 of getting (10-15) - 5 or 5 ..10
> > else
> > Output <= Rand(3..0) - 10;
and also 6/16 /2 chances of getting (10..15) -10 or 0--5
the probability of getting 10 is different to all the others.
sorry - not flat enough for a cigar
john
> > end if;
> > end if;
> > if (Rand(3..0) = 15) then
> > Output <= Cnt;
> if (Cnt < 9) then
> > Cnt <= Cnt + 1;
> else
> Cnt <= 0;
> end if;
> > end if;
>
> Andras Tantos
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> --
> To unsubscribe from cores mailing list please visit http://www.opencores.org/mailinglists.shtml
--
To unsubscribe from cores mailing list please visit http://www.opencores.org/mailinglists.shtml