Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/30/09 18:52
Read: times


 
#170260 - Both interrupt or gating possible
Responding to: ???'s previous message
Kai Klaas said:
What interrupt? My scheme doesn't use interrupts.

Your drawing shows the signal being sent to /INT0. I wasn't sure if you intended to use it to generate interrupts, or as timer 0 gate control.

If it is used as interrupt, you can read out the timer but depending on timer speed, you may get one or two bits for each interrupt, since the high-order bits of the counter value suffers from aliasing relative to the previous read-out.

Kai said:
Also, I wouldn't read out the timer every 1msec.

The reason I did mention 1ms was because of this:
Kai said:
With a corner frequency of 2.5kHz the counter register should not be read earlier than about every 1msec.

I used 1ms as an example to show that the theoretical amount of random data available is greatly affected by the timer speed in relation to the bandwidth of the noise data. That was also why I noted that a program that needs a lot of random data would need to use the hw-generated noise as internal state for a PRNG.

With a 1MHz timer speed, a user may get n*1000 bits/s, where n will depend a bit on required quality of the bits. If a low quality is accepted, then each read of the timer can make use of several bits. For maximum quality, only the least significant bit may be accepted. Having a faster timer in relation to the bandwidth limit of the noise will obviously affect the number of bits/read that has a minimum quality.

Kai said:
I only wanted to say, that the lower corner frequency of the bandpaß does not allow to read out the timer too early, because then the timer could not have been clocked.

Meaning now clarified.

Kai said:
The reason, why the timer should not be read out every 1msec, is, that then the numbers 0 to 255 are not equally probable to be be read out. With only 1000 ticks some of them might be more probable than others. Ok, this will average out the next subsequent read outs, but is a slight deviation from the ideal distribution.

That was the reason why I wrote "Either a few of the least significant bits may be picked up and used, or a good one-way hash should be used."

For many problems, the distribution can't be averaged out. Using all bits from the timer every time may get a good distribution of numbers, but it would not get a good distribution of the difference between consecutive random values. Quite a lot of timer-based implementations are "validated" by computing the average of all values, and the total count of all values, but forgets to look at the distribution of the difference. 1 million throws of a 6-sided dice may produce very similar counts for 1 to 6, but knowing that the last throw was a 6, the probability that the next throw is a 6 too may be way off from 1/6.

Kai said:
More, I didn't want to recommend to read out the timer in a periodic way. The time intervals between subsequent read outs must not be equal at all.

A sw package would then have to either make use of a PRNG driven by the hw noise, or have a function read_random_bits(count,timeout) or a function get_current_entrophy(). The first alternative gives the user access to infinite amounts of pseudo-random numbers with random seed. The second two alternatives give the user a way to pace the consumption of randomnes.

Kai said:
Don't expect too much from this little circuit. It shows two advantages. After powering on the circuit, the noise generator always starts with a fresh truly random number. Also, each read out of timer gives a truly random number. But if you want an ideal distribution, then you should wait between subsequent read outs, the longer the better.

The circuit alone has a number of limitations, but combined with an entrophy pool it can produce very good results. Combined with a PRNG and some post-processing, the capacity can also be scaled quite well.

List of 67 messages in thread
TopicAuthorDate
Random numbers            01/01/70 00:00      
   How random?            01/01/70 00:00      
   extract?            01/01/70 00:00      
      Time for Google            01/01/70 00:00      
      Extract            01/01/70 00:00      
   you can't            01/01/70 00:00      
      a very good way to get random numbers            01/01/70 00:00      
      Interesting anecdote regarding timers:            01/01/70 00:00      
      Periodicity            01/01/70 00:00      
   Just curious...            01/01/70 00:00      
      Didn't search first!            01/01/70 00:00      
         New Information not searchable            01/01/70 00:00      
            Using life itself as part of its computational matrix...            01/01/70 00:00      
               Sure it is            01/01/70 00:00      
         Show me any real new thread...            01/01/70 00:00      
            But...            01/01/70 00:00      
               It really means...            01/01/70 00:00      
                  No "Come In!", but a "Go Home!"            01/01/70 00:00      
                     Exclusive information...            01/01/70 00:00      
                        Thanks...            01/01/70 00:00      
                        First and ONLY Time I reply to this            01/01/70 00:00      
                           Completely ridiculous might be a bit strong            01/01/70 00:00      
                           Lazyness...            01/01/70 00:00      
                              ...is already ignored            01/01/70 00:00      
                                 But we restrict ourselves!            01/01/70 00:00      
                                    No, you are restricting the definition of "help"            01/01/70 00:00      
                                       Your propaganda again...            01/01/70 00:00      
                                          People ARE posting code snippets etc            01/01/70 00:00      
                                             Come on, how many do so?            01/01/70 00:00      
                                                Do what?            01/01/70 00:00      
                                          The limiting factor            01/01/70 00:00      
                                             Mixing subjects            01/01/70 00:00      
                                                Not a valid answer            01/01/70 00:00      
                                                   Are we poluting this thread?            01/01/70 00:00      
                                                      Yes, but Roberto has gone already...            01/01/70 00:00      
                              true for good schools, but not for diploma mills            01/01/70 00:00      
                     Balance            01/01/70 00:00      
                        Warding people away is no good policy either            01/01/70 00:00      
                           Bully for seeing problems with negative votes???            01/01/70 00:00      
                              Its his will            01/01/70 00:00      
                              Its just a biginning!            01/01/70 00:00      
                                 Still extrapolating            01/01/70 00:00      
                                    Relativity?            01/01/70 00:00      
                                    Extrapolating What            01/01/70 00:00      
                                       Not a valid conclusion!            01/01/70 00:00      
                                       Still extrapolating            01/01/70 00:00      
                           Wrong link?            01/01/70 00:00      
                              link to link            01/01/70 00:00      
                                 But nothing about fear of 8052.com?            01/01/70 00:00      
                                    At least,...            01/01/70 00:00      
   This method might work...you can try it....            01/01/70 00:00      
      Unnecessary complication!            01/01/70 00:00      
         Watch out for distribution problems for small ranges            01/01/70 00:00      
         Yes..But for added randomness, use the table            01/01/70 00:00      
            Incorrect - the table adds nothing!            01/01/70 00:00      
               Quality often important even for simple devices            01/01/70 00:00      
                  can be dangerous            01/01/70 00:00      
                     Bus arbitration needs a lot            01/01/70 00:00      
            HUH????            01/01/70 00:00      
      he can't            01/01/70 00:00      
      Modulating the /INT0 input by a simple noise generator            01/01/70 00:00      
         Post-processing needed            01/01/70 00:00      
            What interrupt?            01/01/70 00:00      
               Both interrupt or gating possible            01/01/70 00:00      
                  Full agree with everything you wrote!            01/01/70 00:00      
         Addendum...            01/01/70 00:00      
   Google as a resource?            01/01/70 00:00      

Back to Subject List