Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pseudo-Random number generator with a complete numerical sequence

Status
Not open for further replies.
You are right, and what you say is what gets implemented in a lot of applications, add one more bit to a lfsr than you can get all the numbers.
And you are right it would be harder to predict the sequence.

But it is fair to say that the approach you describe is a way around the problem, and not the circuit I proposed, which solves that problem.
The same concepts can simply apply to a nlprg, add one more bit than it is harder to predict the sequence.

On the topic of what is faster of slower, it depends on the implementation, for a software implementation you are right. In hardware both the circuit (lfsr and nlprg) work at the same speed, since 1 ck cycle is enough to compute the next state, so there is not difference in terms of latency or speed.

Furthermore, a practical implementation of the nlprg algorithm is more safe than a lfsr, since there are not checks on the seed and not error handling.
Even if you add more bits to a lfsr, you need to make sure that the lfsr will never be in the dead-state.

I hope I answered your questions.
 
that's why all the external gates... also be aware that some combinations of taps and injection points will give an easily guessed sequence (i suppose theoretically there's just such a combination that might do something like count up by even numbers and count back down by odd numbers)... which would be a severe weakness. i once wrote a program that generated Vigenere tables for fun, and had a hard time getting it to produce really random pages. the RND(x) function in quickbasic uses a PRNG with a length of 65535. by seeding the RANDOMIZE statement by reading the DOS timer, and then generating a line of text where no characters repeat, i accomplished two things, the DOS timer would not read the same on two identical computers, because it updated every 10mS, and keeping two DOS machines that closely sync'ed wasn't possible. the sort routine that generated the line of text didn't have a well defined time span of operation because it was insuring that a character only appeared once on the line, and every character generated before the sort used a new seed for the PRNG. actually it wasn't just for fun, but i was teaching a history class, and one of the lessons was the use of cryptology during wwii, so i printed up a set of pads to show the class how a polyalphabetic cipher works.
 
That is very nice, teaching through examples. Hopefully that will spark the imagination of some student.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top