View Single Post
  #31   Report Post  
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
rickman rickman is offline
external usenet poster
 
Posts: 399
Default "Random" Circuit Needed.

On 4/2/2015 8:25 PM, rickman wrote:
On 4/2/2015 7:52 PM, John Fields wrote:
On 2 Apr 2015 10:42:50 GMT, Jasen Betts wrote:

r=(75*r+74)%65537 visits 0-65535 with no gaps.

not that i'd want to build it using 74LS logic.


---
But, if you had to, what would it look like, schematic-wise?


Not so bad. 75 = 64 + 8 + 2 + 1. Include the constant 74 addition that
would be four adders. I assume the modulo value is a typo and should be
65536 which comes free. I don't recall any 8 bit adder chips, so using
4 bit ones that would need chips 7 since when adding 64 * r, the lower 4
bits are always zero.


shl(6)
+----/----\ /--Just one chip on MS 4 bits
| \ L
| O-----\
| shl(3) / \
+----/----/ \
| \
r --+ O----\
| shl(1) / \
+----/----\ / \
| \ / O--- r'
| O-----/ /
| / /
+---------/ 74 ----/

Each 'O' is two 4 bit adders other than the one summing shf6 and shf3.
r is stored in an 8 bit register.

Maybe the modulo 65537 isn't a typo. With the addition of an even
number (74) the low order bit will never change unless the modulus is
odd. That's a whole different animal... But then the range is 0 to
65536, a 17 bit number. Anyone know the correct formula?

--

Rick