Truncated match.
PICList
Thread
'random values on RAM at startup'
1997\03\06@100726
by
obo (Ingenieria Fotonica)
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 E39005 Santander SPAIN 
 Tfno. +3442201539 Fax +3442201873 Email: spam_OUTacoboTakeThisOuTteisa.unican.es 

1997\03\06@102140
by
myke predko
>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
> >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

> From: robin bussell <.....robin.bussellKILLspam@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

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 "pseudorandom" 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

Steve Hardy wrote:
>
> > From: robin bussell <robin.bussellKILLspamlucent.com>
> >
> > > >on the chip. What i'm looking for is a *TRUE* random number generator
(that
{Quote hidden}> > > >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
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
.....tjaartKILLspam.....wasp.co.za
_____________________________________________________________
 Another sundeprived R&D Engineer slaving away in a dungeon 
 WASP International http://wasp.co.za 
 GSM and GPS valueadded applications 
 Voice : +27(0)116228686  Fax : +27(0)116228686 
_____________________________________________________________
1997\03\07@013844
by
Andrew Warren
Tjaart van der Walt <EraseMEtjaartspam_OUTTakeThisOuTwasp.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 reasonablylong
sequence.
There are a couple of linearfeedback shiftregister routines on my
web page...
Andy
=== Andrew Warren  fastfwdspam_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

Andrew Warren wrote:
>
> Tjaart van der Walt <@spam@tjaartKILLspamwasp.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 reasonablylong
> sequence.
>
> There are a couple of linearfeedback shiftregister routines on my
> web page...
I agree. The ideal is to use one of the configurations for the Pcode
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
KILLspamtjaartKILLspamwasp.co.za
_____________________________________________________________
 Another sundeprived R&D Engineer slaving away in a dungeon 
 WASP International http://wasp.co.za 
 GSM and GPS valueadded applications 
 Voice : +27(0)116228686  Fax : +27(0)116228686 
_____________________________________________________________
1997\03\07@081031
by
Steve Hardy

> From: Andrew Warren <RemoveMEfastfwdTakeThisOuTIX.NETCOM.COM>
>
> Tjaart van der Walt <spamBeGonetjaartspamBeGonewasp.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 reasonablylong
> sequence.
>
> There are a couple of linearfeedback shiftregister routines on my
> web page...
This is true, but getting offtrack 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

At 18:31 07/03/97 EST, you wrote:
{Quote hidden}>> From: Andrew Warren <
TakeThisOuTfastfwdEraseMEspam_OUTIX.NETCOM.COM>
>>
>> Tjaart van der Walt <
RemoveMEtjaartTakeThisOuTwasp.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 reasonablylong
>> sequence.
>>
>> There are a couple of linearfeedback shiftregister routines on my
>> web page...
>
>This is true, but getting offtrack 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.
>
If you use a mathematical pseudorandom 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 secondguess (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 pseudorandom 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."
Email: kdowsettEraseME.....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...