EveryCircuit
Contact
Reviews
Home
emogenet
modified 9 years ago

Infinite Noise Random Number Generator 2

22
13
687
09:21:52
EDIT: new and improved version with 2 major changes: - the circuit now has *two* pipelined modular multipliers and produces two independent random bitstreams. The circuit is therefore two times faster. - the circuit now includes a "kick in the nuts" bootstrap circuit (at the bottom) to prevent it from getting stuck at zero volts overall (without this, zero is a fixed point of the loop). Not particularly useful in a simulator, but indispensable IRL: with the bootstrap, the circuit is sure-start and can easily be pushed in the MHz range, even with cheapo jellybean components. Original description: This is a neat little hardware random number generator that does *not* use the traditional reverse biased PN junction trick but uses switched capacitors instead. At every clock tick, the voltage on both switched caps changes to a new random value between 0 and 5V, and the voltage outputs of the lower opamps (comparators) are two new random bits. Theory of operation: the circuit is driven by two complementary clocks that control two switches (here we use relays, this app doesn't provide analog mux ics). The two switches in turn control the charging of the two switched capacitors. When a cap is connected by its switch (sample mode), it "reads" and "stores" its input voltage. When disconnected (hold mode), it "writes" that voltage to the opamps downstream of it. The open loop opamps at the bottom are used as comparators: they output 5v if input signal is larger than 2.5v, else 0v. They serves the dual purpose of bitifying the RNG output as well as providing a useful signal to the modular multiplier opamps on top. The opamps at the top are the heart of the circuit: they computes an analog modular multiplication of their input signal, using the output of the comparator below to do the modulo when needed (i.e. when output of the multiplication would go above 5v, 5v is subtracted). The result of the modular multiplication is then fed back in the other section of the circuit for further processing. The net result is that the circuit more or less computes an infinite binary decomposition of an analog voltage value, delving deep into the noise floor. A very nice example of an analog/digital hybrid circuit. Slow down time to understand how it works (see data travel through the loop) Note that the bitstream generated does not have a uniform distribution (some bit patterns are more likely than others, especially if the opamp isn't rail to rail) and therefore can't be used directly for crypto or Monte-Carlo integration,. However, the stream is good enough to feed to a software whitener and get a very strong RNG.
published 9 years ago
Skyleth
9 years ago
Awesome.
thebugger
9 years ago
No derivative of a periodic signal can be random.
hurz
9 years ago
I was looking at it for a while and its like a sigma delta modulator. As you said, the top left opamp is the heart... The loop is jumping around discreet 2.5V which is the only "stable" point it tries to reach. Actually 2.5V itself is a unstable point. So all in all one can say this circuit is labile. And because this labile point 2.5V can not be taken for a long time, it does run up or down. A good sigma delta modulator generates noise, but still does some periodic hotspots and the noise is shaped. Thats why its sometimes called noise shaper. I think "noise shaper" is what this circuit comes close.
emogenet
9 years ago
@thebugger: another impossible circuit that actually works IRL. My specialty it seems.
hurz
9 years ago
http://everycircuit.com/circuit/4619270947864576
hurz
9 years ago
@emogenet, check topic "noise shaper" or sigma delta modulator. You will find many parralel properties to your circuit. Very interesting topic!
emogenet
9 years ago
@hurz: actually, 2.5v is not a stable or even a fixed point: 2.5*2 mod 5 is zero. The stable point would be zero if not for the resistor divider at the far right that "lifts" the signal back up from zero when we get too close.
emogenet
9 years ago
Oh and I don't know what sigma delta modulators are. Will go educate myself.
hurz
9 years ago
👍😋
hurz
9 years ago
You must google it! Its an extremly interesting technology. BTW, most audio DACs in CD player work that way. 1 bit dac with high oversampling rates. And its coming in more and more RF frequency applications as well. Check it out
thebugger
9 years ago
What's an IRL?
rich11292000
9 years ago
In real life
ansiwen
8 months ago
You should give credits to the source: https://github.com/waywardgeek/infnoise

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2025 by MuseMaze, Inc.     Terms of use     Privacy policy