Electronic – Old-school pseudorandom pulse generator (requesting assistance with hardware design)

analoglogic-gatespulserandomvintage

I would like to design an old-school pseudorandom pulse generator to trigger various types of events (hardware suggestions only please – no programmable ICs). The events that I want to control need to happen, generally speaking, in the following categories of frequency: many times a minute, a few times a minute, once a minute, once every few minutes, once or twice an hour. Within each category of frequency, the event should occur "randomly," which is to say, the event's recurrence should not be exactly predictable. To give you a sense for why I want to build this: imagine a video game that has various scene elements, some of which occur very often, some that happen pretty frequently, and others which are infrequent… you get the idea, I hope.

The reason that I would like a hardware-only solution is that I am purposefully trying to learn about discrete logic – things like shift registers, multiplexers, Boolean logic, etc. Efficiency, speed, size, and cost are not my primary concerns. Hopefully there are some vintage electronics fanatics out there who will help me in my quest for knowledge! Thanks ๐Ÿ™‚ PS: a drawn schematic would be tremendously appreciated since I am learning and probably won't be able to understand or build vague suggestions.

Best Answer

A good way to generate randomness using discrete logic is to exploit the metastability characteristics of a flip-flop.

A D flip-flop is a type of flip-flop that has a clock (triangle looking input) and a data input (D input) as shown below. Normally, the state of the D input is transferred to the Q/!Q output one propagation delay after a rising edge on the clock.

D Flip Flop

(from http://www.learningaboutelectronics.com/images/D-flip-flop.png)

The data must "set up" a specific amount of time before the clock edge and "hold" a specific amount of time after the clock edge in order to assure that the input is correctly transferred to the output. If the setup and hold times are not met, then the state of the output at the normal propagation delay time for the flip flop becomes random. The randomness can be tuned by varying the frequency and phase of the clock and data and the amount of time that you wait to check the state of the output.

The graph below is from a TI paper that discusses the metastability characteristics of various 5V logic families. In general, the slower the logic, the worse the metastability and the more often random errors occur. This means that older logic families are more useful for generating random errors. The graph shows that using 74HC style logic, the error rate can be tuned from thousands of times per second to once per day by varying the wait time after a clock at which you look at the output of the flip-flop (tx). This specific graph is for a 1 MHz clock and a 500 KHz data input.

enter image description here

Note that metastability is delay, temperature, and voltage sensitive, so tuning to a specific event rate could be challenging. But it might be possible to build something good enough for your needs.

The test circuit from the TI paper is shown below. It can be a starting point to a random event generation circuit.

metastability test circuit