Searching \ for 'random values on RAM at startup' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/method/math.htm?key=random
Search entire site for: 'random values on RAM at startup'.

Truncated match.
PICList Thread
'random values on RAM at startup'
1997\03\06@100726 by obo (Ingenieria Fotonica)

flavicon
face
Hello,
I would like to know if the random values of the RAM locations at startup
are always the same for the same chip, or they change every time you switch
on the chip. What i'm looking for is a *TRUE* random number generator (that
is, as true as posible!)
Thanks in advance.


-----------------------------------------------------------------------
|         Adolfo Cobo Garcia  -  UNIVERSIDAD DE CANTABRIA               |
|    E.T.S.I.I. y Telecomunicacion, Grupo de Ingenieria Fotonica        |
|        Avda. Los Castros s/n  E-39005  Santander  SPAIN               |
|  Tfno. +34-42-201539  Fax +34-42-201873  Email: spam_OUTacoboTakeThisOuTspamteisa.unican.es |
-----------------------------------------------------------------------

1997\03\06@102140 by myke predko

flavicon
face
>Hello,
> I would like to know if the random values of the RAM locations at startup
>are always the same for the same chip, or they change every time you switch
>on the chip. What i'm looking for is a *TRUE* random number generator (that
>is, as true as posible!)
> Thanks in advance.

Adolfo,

What I've found is, some tend to always be the same, while others change.

If you want a "true" Random Number Generator.  Use something like a free
running clock that stops when you get some user input.

ie

Loop                            ;  Wait for Input to Start/Get Random Number
 incf   Random
 btfsc  PORTA, Button          ;  Drop out of the Loop when Button's pressed
  goto  Loop

myke

"Some people say that foreign cars handle best, while others say domestic.
For my money, nothing handles as well as a rental car." - P.J. O'Rourke

1997\03\06@111701 by robin.bussell

picon face
> >on the chip. What i'm looking for is a *TRUE* random number generator (that
> >is, as true as posible!)
> > Thanks in advance.
>
If you're using a pic with A/D conversion capabilities then the best
you can do is
to hook up a reverse biased diode as a noise source and sample it when
you need
a random number.. that way they end up proper quantum physics type
random!

Cheers,
    Robin.

1997\03\06@184858 by Steve Hardy

flavicon
face
> From: robin bussell <.....robin.bussellKILLspamspam@spam@lucent.com>
>
> > >on the chip. What i'm looking for is a *TRUE* random number generator (that
> > >is, as true as posible!)
> > > Thanks in advance.
> >
>  If you're using a pic with A/D conversion capabilities then the best
> you can do is
> to hook up a reverse biased diode as a noise source and sample it when
> you need
> a random number.. that way they end up proper quantum physics type
> random!

... or if you don't have ADC, try timing the interval between two
geiger counter pulses (cosmic rays will do, no need for radioactive
material).

Regarding diodes as noise sources, this should be a zener diode in
reverse breakdown, or a transistor BE junction in same condition
(about 8V typically).

For true uniform distribution, the output of the above techniques
should be fed into a polynomial generator, as in CRC generator, or into
a linear congruential generator i.e. r = r*a + b.  See Knuth,
Seminumerical Algorithms, for more details.  Merely sampling the level
of white noise will give you more or less Gaussian distribution.
Sampling geiger counter intervals will give Poisson distribution,
I think (my memory of uni physics is fading fast).

Regards,
SJH
Canberra, Australia

1997\03\06@231439 by Matt Calder

flavicon
face
On Fri, 7 Mar 1997, Steve Hardy wrote:

> > > >on the chip. What i'm looking for is a *TRUE* random number generator
(that
> > > >is, as true as posible!)
>
> For true uniform distribution, the output of the above techniques
> should be fed into a polynomial generator, as in CRC generator, or into
> a linear congruential generator i.e. r = r*a + b.  See Knuth,
> Seminumerical Algorithms, for more details.  Merely sampling the level
> of white noise will give you more or less Gaussian distribution.
> Sampling geiger counter intervals will give Poisson distribution,
> I think (my memory of uni physics is fading fast).
>
       As a student of probability I find this thread to irresistable
to pass up. As far as I know the so called "pseudo-random" number
generators are "TRUE"-ly random in any measurable sense (shades of
Turing's test here). It is probable that a PIC could generate from
the best of such algorithms with a little programming ingenuity as
they typically depend on modest arrays of integers and modulo arithmetic.
       If you insist on resorting to physical methods you should sample
the physical cicuit so as to generate random bits and then merge these
into a larger random number. Beware however that testing for hidden
correlation in such a sequence can be extremely difficult. (Pseudo
random number generators on the other hand can have their statistical
properties proven mathematically - don't you just love the irony?)
       One final note, the number of geiger counts per unit time
will have a Poisson distribution, whereas the time between geiger
counts will have an exponential distribution.

Matt


/*****************************************/
/* Matt Calder, Dept. of Statistics, CSU */
/* http://www.stat.colostate.edu/~calder */
/*****************************************/

1997\03\06@233303 by tjaart

flavicon
face
Steve Hardy wrote:
>
> > From: robin bussell <robin.bussellspamKILLspamlucent.com>
> >
> > > >on the chip. What i'm looking for is a *TRUE* random number generator
(that
{Quote hidden}

Here's the easiest way. You can do it in hardware or software. Although
it is not *truly* random, it is quite good indeed :

Take a shift register (the longer the better), and tap two or three of
the
stages. Add the taps (discard the carry - it is the same as XORing) and
feed
back into the input of the shift register.

--
Friendly Regards

Tjaart van der Walt
.....tjaartKILLspamspam.....wasp.co.za
_____________________________________________________________
| Another sun-deprived R&D Engineer slaving away in a dungeon |
|             WASP International  http://wasp.co.za           |
|             GSM and GPS value-added applications            |
|  Voice : +27-(0)11-622-8686   |   Fax : +27-(0)11-622-8686  |
|_____________________________________________________________|

1997\03\07@013844 by Andrew Warren

face
flavicon
face
Tjaart van der Walt <EraseMEtjaartspam_OUTspamTakeThisOuTwasp.co.za> wrote:

> Here's the easiest way. You can do it in hardware or software.
> Although it is not *truly* random, it is quite good indeed :
>
> Take a shift register (the longer the better), and tap two or three
> of the stages. Add the taps (discard the carry - it is the same as
> XORing) and feed back into the input of the shift register.

Tjaart:

This only works well if you pick the CORRECT two or three taps...
Just choosing an arbitrary pair is unlikely to give a reasonably-long
sequence.

There are a couple of linear-feedback shift-register routines on my
web page...

-Andy

=== Andrew Warren - fastfwdspamspam_OUTix.netcom.com
=== Fast Forward Engineering - Vista, California
===
=== Custodian of the PICLIST Fund -- For more info, see:
=== www.geocities.com/SiliconValley/2499/fund.html

1997\03\07@081024 by tjaart

flavicon
face
Andrew Warren wrote:
>
> Tjaart van der Walt <@spam@tjaartKILLspamspamwasp.co.za> wrote:
>
> > Here's the easiest way. You can do it in hardware or software.
> > Although it is not *truly* random, it is quite good indeed :
> >
> > Take a shift register (the longer the better), and tap two or three
> > of the stages. Add the taps (discard the carry - it is the same as
> > XORing) and feed back into the input of the shift register.
>
> Tjaart:
>
> This only works well if you pick the CORRECT two or three taps...
> Just choosing an arbitrary pair is unlikely to give a reasonably-long
> sequence.
>
> There are a couple of linear-feedback shift-register routines on my
> web page...

I agree. The ideal is to use one of the configurations for the P-code
generation for GPS pseudo random codes. (A couple of hundred days at
10.23Mbps before it repeats itself)

The normal C/A code is easy to generate with just two shift registers
(1023 bits before it repeats itself).

--
Friendly Regards

Tjaart van der Walt
KILLspamtjaartKILLspamspamwasp.co.za
_____________________________________________________________
| Another sun-deprived R&D Engineer slaving away in a dungeon |
|             WASP International  http://wasp.co.za           |
|             GSM and GPS value-added applications            |
|  Voice : +27-(0)11-622-8686   |   Fax : +27-(0)11-622-8686  |
|_____________________________________________________________|

1997\03\07@081031 by Steve Hardy

flavicon
face
> From: Andrew Warren <RemoveMEfastfwdTakeThisOuTspamIX.NETCOM.COM>
>
> Tjaart van der Walt <spamBeGonetjaartspamBeGonespamwasp.co.za> wrote:
>
> > Here's the easiest way. You can do it in hardware or software.
> > Although it is not *truly* random, it is quite good indeed :
> >
> > Take a shift register (the longer the better), and tap two or three
> > of the stages. Add the taps (discard the carry - it is the same as
> > XORing) and feed back into the input of the shift register.
>
> Tjaart:
>
> This only works well if you pick the CORRECT two or three taps...
> Just choosing an arbitrary pair is unlikely to give a reasonably-long
> sequence.
>
> There are a couple of linear-feedback shift-register routines on my
> web page...

This is true, but getting off-track from the original request, which
was a way to determine a 'really random' seed value on power up.
With a deterministic machine such as a PIC, one must refer to some
'random' external event to initialise a shift register etc. otherwise
the machine will repeat the same sequence each time.

Regards,
SJH
Canberra, Australia

1997\03\10@064142 by Keith Dowsett

flavicon
face
At 18:31 07/03/97 EST, you wrote:
{Quote hidden}

If you use a mathematical pseudo-random algorithm (as one of the other
posters suggested) you simply store the seeds in EEPROM and update them
after each use. That way each random number is simply the next in the
sequence.  A careful choice of original values should result in a sequence
of good random numbers which are almost impossible to second-guess (unless
you know both the algorithm and seeds).

If you don't have EEPROM then the next best thing is waiting for a user
interaction while counting microseconds mod 65536. This value is added to
the seed for a pseudo-random number generator.

If this is not suitable you might like to write some code which adds all the
values of the RAM (mod 65536) and posts it to the PC, then triggers a power
off circuit. Stuff the resulting data into a stats package (sorry I can't
recommend one - not my speciality) and look for correlations. If you're
_lucky_ this will be fairly random, but I don't know.

When all else fails there's no substitute for trying it out and getting some
real data.

Keith.



==========================================================
Keith Dowsett         "Variables won't; constants aren't."

E-mail: kdowsettEraseMEspam.....rpms.ac.uk
  WWW: http://kd.rpms.ac.uk/index.html

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...