Jinx wrote: > Take the example of a table that has 1000 entries. I'd be looking > for a number between 000 and 3e7. Therefore the first random byte > (address high) is 0,1,2 or 3 and the second random number (address > low) is 00-FF if address high = 0,1, or 2 and 00-e7 if address high = > 03. The third random number is the bit position, 00 to 0d > > Rejection is done simply on the basis of the number being too big, > but every number accepted is random I think rejection is the only "fair" way to do this, unless you want to do a division/scaling of 1024 -> 1000. The smartest solution would be to use 1024 element table, but maybe that is not possible? -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.