EveryCircuit
Powering up...
Circuit
Public
Private
Unlisted
Save

Pseudo Random Number Generator

@miaoyinwang
4 years ago
https://everycircuit.com/circuit/4836182476980224
This is a “real” pseudo random number generator. It use a Linear Congruential Generator (LCG) to create random number between 0 and 16. The red signal is the random number generated. Each cycle the next number is calculated by the circuit: V(n+1) = [ V(n) * a + b ] MOD m Where in this circuit a= 5.17, b=2.59V, m=16. Right side is a counter with a 4-1 selector, to generate the control pulse. Blue pulse - generate V(n)*a + b, and save it to left top capacitor Green pulse - load capacitor value to ADC, and reset counter, to prepare for the MOD. Orange pulse - do MOD. Load ADC output to counter. Counter output only last 3 digits to DAC. DAC value is then compared with incoming voltage. If < 0, a signal will be sent to “down” on counter. The final result is then saved to right bottom capacitor.
Comments
Post