Random (heh) discussion for the day...

62 views
Skip to first unread message

Bill E

unread,
May 13, 2026, 9:03:03 AM (9 days ago) May 13
to [PiDP-1]
Just how random is the common random number generator used in several games? Answer, depends. I used it to generate successive pairs of of values, took the low 10 bits, used those for x,y point coordinates, and displayed them. Very poor distribution.

But with a minor change, rotate the first value right 5, the second left 5:
random1.png

Not bad. Click them to actually see them well.
Bill

Bill E

unread,
May 13, 2026, 9:04:51 AM (9 days ago) May 13
to [PiDP-1]
Hmm, looks like it lost the first, less random image.

Here it is.
random2.png

Bob Geisel

unread,
May 13, 2026, 2:27:30 PM (9 days ago) May 13
to Bill E, [PiDP-1]
My experience it that the results are random enough for games or casual programming but NOT for any cryptographic applications. 

Your results were very interesting. 

Great question!

-Bob


--
You received this message because you are subscribed to the Google Groups "[PiDP-1]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-1+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-1/e645265e-11fd-4327-9fe8-861f8a05b295n%40googlegroups.com.

Clem Cole

unread,
May 13, 2026, 3:55:26 PM (8 days ago) May 13
to Bill E, [PiDP-1]
Admittedly, this is a PDP-1, not a PDP-6 or PDP-10, but ITS always had two interesting devices: Hardware Random Number Generator: KN; and the Null Device NUL;

For the random number generator, the physical hardware was an electronic noise generator built into the Knight TV terminal system interface (hence the abbreviation KN).   When a program opened a read stream from the KN; device, the OS fetched data directly from this hardware interface. The thermal/electronic noise generated by the circuitry was converted into truly random 36-bit words.

For the null device, like UNIX /dev/null, when writing data to NUL; would immediately discard it and return a successful status. Reading from NUL; would instantly return an End-of-File (EOF) marker.

--
You received this message because you are subscribed to the Google Groups "[PiDP-1]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-1+un...@googlegroups.com.

Bill E

unread,
May 13, 2026, 8:52:13 PM (8 days ago) May 13
to [PiDP-1]
A hardware RNG for our PDP-1s could be a fun project for someone. Add an IOT (easy with dynamic IOTS), use a transistor base-emitter junction or a zener in breakdown to generate the noise, an opamp, use a gpio pin on the Pi, I think 1 or 2 are still free.
Doesn't even violate the spirit of the -1, they were hacked frequently.

Speaking of which, this is an interesting document that talks about the -1Ds, all 2 of them that were built.
Note that a number of the  -1D added instructions are supported in my version, but no ring, 2's complement, or memory management. I might eventually add some of the ring stuff, but not all of it. Some of the stuff was a real hack.

Bill
pdp1d.pdf

Matthias Barthel

unread,
May 14, 2026, 3:31:04 AM (8 days ago) May 14
to Bill E, [PiDP-1]
Bill,

This sounds like a project for me 🙃 generate noise and put it with a ADC to the IO-Ports of my Backplane 👍 

But my Time is very limited, because of Work, House and Family, i put the Random-Number-Generator-Device on my Pdp1-Wishlist for later 🙃

Best matthias 🙋🏼‍♂️

--
You received this message because you are subscribed to the Google Groups "[PiDP-1]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-1+un...@googlegroups.com.

Malcolm Ray

unread,
May 14, 2026, 6:44:01 PM (7 days ago) May 14
to pid...@googlegroups.com
I believe the Raspberry Pi's SoC already has a hardware RNG, exposed by the OS at /dev/hwrng.

If you install rng-tools5, this provides the rngtest tool which can be used to run a FIPS 140-2 test on its randomness.

It should be pretty easy to write an IOT which pulls 18 bits from /dev/hwrng. Or /dev/random.
--
You received this message because you are subscribed to the Google Groups "[PiDP-1]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-1+un...@googlegroups.com.

Bill E

unread,
May 15, 2026, 7:46:47 AM (7 days ago) May 15
to [PiDP-1]
They do, and all of the Linuixes have a getrandom() which will return a cryptographic quality number.
And also yes, the IOT is trivial. Here it is. I'll add this to the IOT examples in my distro but it won't be installed automatically.
Anyone that wants to use it, just drop the c file into IOTs and type make. You don't even have to restart your pidp-1.
It returns a 36 bit random number in AC and IO.

BUT, a separate hardware impl would be more in the spirit of the original -1 hackers.

Bill
IOT_34.c

Bill E

unread,
May 15, 2026, 2:28:59 PM (7 days ago) May 15
to [PiDP-1]
Some more experiments with the software random. A tiny change really improves the apparent randomness. All that's needed is to change the rotate in it from 1s to 9s.
It then gives a visually very similar distribution as using the IOT 34 real random generator. So, if you want better randomness in what you're doing, try this. BTW, it's the same one that the lander and I think spacewar uses. Source attached. It will work with the standard Type 30. Here's the program, I even changed the am1 syntax to mac.
It does use the -1D instruction lia, load IO from AC. The regular distribution supports this (if it was compiled in, I forget). Minor change if not.

Bill
scatter.mac
Reply all
Reply to author
Forward
0 new messages