This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About keil random number

Hi,guys! I study about how to generate a random number recently,a lot of articles said "Linear Congruential Generator" is a frequently-used method!However,I used
the mothod rand() in the stdlib.h,which is a lib function of keil,I observed it seems as if it don't use this kind of method,do it???

Parents
  • "but i can't read it clearly!"

    Seriously? Even a quick glance shows it's an LSFR implementation.

    If you don't get that right off the bat, play computer and write down the register values and all the effects of instructions interacting on said registers. Imagine objects of 16 or 32 bits in size being acted upon. Model that in C and it will boil down to a handful of C statements.

Reply
  • "but i can't read it clearly!"

    Seriously? Even a quick glance shows it's an LSFR implementation.

    If you don't get that right off the bat, play computer and write down the register values and all the effects of instructions interacting on said registers. Imagine objects of 16 or 32 bits in size being acted upon. Model that in C and it will boil down to a handful of C statements.

Children