Tuesday, 15 May 2012

avr - Random number generator in assembly code -


Do anyone know how to code randomly generated 8 bit numbers in the assembly code?

I am using ATmega 8535 with ATMM ADR which is debug AVR simulator with I (AVR Studio 4)

Sorry I'm new on this and any Thank you for the help. Thanks

It really depends on what you mean by random. If you just want a sequence of numbers that can be guessed but statistically random, then the simplest one to implement on a microcontroller is an example of an implementation in the assembly on PIC device.

Variations with superior cross-correlation properties are gold-codes that are a bit more complicated but rely on the same principle. There are many other algorithms, but it really depends on the type of statistical properties you need.

If you want something with entropy levels (i.e. can not be predicted), then use a device's ADC to simulate the voltage on a reverse biased diode junction. is. The noise generated by this is a strong source of entropy, however, you need to be careful that you do not add any order in the system with the accident, so there is some need for care in the design.


No comments:

Post a Comment