Random function - How to limit it ??


Results 1 to 19 of 19

Threaded View

  1. #9
    martarse's Avatar
    martarse Guest


    Did you find this post helpful? Yes | No

    Default Random is not a real random

    Hello,

    I've got another question about the Random function.

    Is it a real random function that comes with PBP ??

    I've write every result of the Random function (with the 0-38 trick listed above) in the internal EEPROM of my PIC16F84A and I found that the result seems to follow a patern.

    Here are the results of the random function (in Hex format)
    18 0A 15 03 07 0E 1C 11 23 07 0E 1C 11 23 07 0E 1C 11 23 07 0E 1C 11 23 07 0E 1C 11 23 07 0E 1C 11 23 07 0E 1C 11 23 07 0E 1C 11 23 07....

    the patern seems to be : 07 0E 1C 11 23 (Hex) or 7 14 28 17 35 in decimal format.

    Everything seems to be good on the first results but after some loop the results seems to follow a patern. I also found that every time I reset the chip, it start with the same result : 18, 0A, 15, 03...

    Is there a method to get a "real" random ?

    thanks
    Last edited by martarse; - 29th November 2004 at 08:06.

Similar Threads

  1. Questions on random numbers and multiplexing LEDs
    By AaronM in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th June 2009, 05:22
  2. Random Numbers
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 18th December 2008, 09:47
  3. 6 random numbers limiting to 49 ?????
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th June 2005, 00:27
  4. Random number results
    By bartman in forum mel PIC BASIC
    Replies: 3
    Last Post: - 9th March 2005, 18:39
  5. more random number questions
    By bartman in forum mel PIC BASIC
    Replies: 1
    Last Post: - 14th November 2004, 18:55

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts