Current area: HOME -> Download page

Fast Random Number Generator - Keil Shell V1.0

  Rate and comment this resource

No Screenshot provided
Download Fast Random Number Generator - Keil Shell V1.0 Download file
View the content of the 'Fast Random Number Generator - Keil Shell V1.0 'zip File View Zip File Contents

   (report broken link)
NOTE: Some downloads must be obtained through the publisher's site.
Author: Graham Cole  (View all listings)

Fast Random Number Generator - Keil Shell V1.0
The function rand16() returns a 16-bit (unsigned int)
pseudo-randomly generated value. The functions are written in a
Keil shell and are easily incorporated into a Keil C51 based
project. However, all the functionality is expressed in
assembler and the functions may easily be converted to work
with any assembly language environment. A test harness is also
provided.

File name: 32219.zip
Product homepage: Unknown
Order page: Unknown
Languages: Asm: 8051
Platforms:
Release Date: 22 January, 2004
Licence Type: Full Version
Size: 18 Kb
Price/fee (US$): 0.00 $
Number of downloads: 3705

  User Comments
Keil C51 rand() Comparison
by Graham Cole , UK, on Tuesday Jun 22, 2004
The most recent versions of the Keil C51 library have a revised rand() function based upon my suggestions. The Keil version uses the generator (MASKXn) that is given as the default in this download. The Keil version places lfsr in memory in accordance with the selected memory model, but always generates code similar to rand16() for the large model. As a consequence, the Keil library version is not as well optimised as rand16() built with the small or compact memory model. The Keil library version returns a 15-bit value to match the usual value of RAND_MAX of 32767. Laudably, the Keil library rand() automatically initialises lfsr if it is found to be in the uninitialised state. Keil state that rand() is re-entrant http://www.keil.com/support/man/docs/c51/c51_lib_math.htm). Keil rand() may generate unexpected results if it is called both from main() and from an ISR, but rand()'s automatic initialisation feature will prevent it getting stuck. rand16() does not have this feature and is not re-entrant.
Reply To this Post  Report as abusive.
Excellent and very interesting.
by Unknown, on Thursday Sep 16, 2004
I learn a lot about LFSRs from this. Having several versions of the rand16 was at first a little confusing, but the text gives a full explanation.
Reply To this Post  Report as abusive.

View all comments  Rate and comment this resource


Do you want to get your software listed on this site? If so, click here to find out more.


Sponsored links

Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
Virtual File System SDK
Create your own file systems in Windows and .NET applications
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Software Localization Tool Sisulizer
Localize DotNet, C++ Builder, Delphi, C/C++, Visual Basic & Java apps & html help. Try Sisulizer now
Attend WINDOWS EMBEDDED ACCELERATION WORKSHOPS
Are you ready to learn how you can bring your next-generation embedded device to market faster?

Advertisement



Free Magazine

Free Magazines
eWeek The essential technology information source for builders of e-business.... subscribe now

Newsletter | Submit Content | About | Advertising | Awards | Contact Us | Link to us |
© 1996-2008 Community Networks Ltd All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Synchron Data - .NET development.