Go to Post FIRST is not about building a robot, it's about the experience of it all... - Beth Sweet [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 21-04-2008, 22:55
Los Frijoles's Avatar
Los Frijoles Los Frijoles is offline
Stormin' Mormon
AKA: Kevin Cuzner
FRC #2062 (C.O.R.E.)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Waukesha, WI
Posts: 27
Los Frijoles has a spectacular aura aboutLos Frijoles has a spectacular aura about
Send a message via AIM to Los Frijoles
Psuedorandom numbers

Well I have been studying psuedorandom sequences for Microchip microcontrollers based on seeds and so far the fastest I have found is thusly from mondo technology:
Code:
chop    movf    val1,w     ;get the 1st
        addwf   val2,w     ;add the 2nd
        movwf   val2       ;store the 2nd
        addwf   val3,w     ;add the 3rd & store
        movwf   val3       ;back in 3rd
        addwf   val1       ;add back to 1st
        swapf   val1       ;swap nibbles
        movf    val1,w     ;return one byte
        ret
It looks to be 10 instruction cycles long. However, I would like to see some other methods as I have found that this particular algorithm tends to repeat numbers after a short while with only a 24-bit seed. Does anyone else know of some psuedorandom sequences (C, ASM, or Psuedocode please)?
__________________
Community Of Robotic Engineers 2062





Blender totally pwns 3DS Max...

My life is here and here.

Cuznersoft Hardware and Software Development

Last edited by Los Frijoles : 21-04-2008 at 22:55. Reason: Citing my sources...
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rounding numbers teh_pwnerer795 Programming 13 17-12-2006 12:16
Negative numbers? Calvin Programming 6 09-02-2005 10:46
Part Numbers DDRAngelKurumi Kit & Additional Hardware 1 29-01-2005 18:38
pwm numbers CharlieWilken Programming 2 15-03-2004 01:15
Team Numbers archiver 2000 2 24-06-2002 00:24


All times are GMT -5. The time now is 00:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi