Results 1 to 2 of 2

Thread: random number generator?

  1. #1
    Join Date
    Aug 2006
    Posts
    2
    Rep Power
    1

    Default

    Hi I am new to nios ii and was wondering if there was a random number generator. I have been try to use rand(), but it seems to only return 0s. I was wondering if I was doing something wrong. Could someone explain what libraries I should include? These are the libraries I am using thus far:
    #include "alt_types.h"
    #include "altera_avalon_pio_regs.h"
    #include "alt_ucosii_simple_error_check.h"

    #include <stdlib.h>
    #include <stdio.h>
    #include <system.h>
    #include <sys/time.h>
    #include <sys/alt_timestamp.h>

  2. #2
    Join Date
    Aug 2004
    Location
    Pontedera, Pisa, Italy
    Posts
    167
    Rep Power
    1

    Default

    Originally posted by Neeljoe@Aug 15 2006, 03:54 PM
    Hi I am new to nios ii and was wondering if there was a random number generator. I have been try to use rand(), but it seems to only return 0s.
    <div align='right'><{POST_SNAPBACK}>
    [/quote]

    Did you initialized it using srand()?

    Paolo

Similar Threads

  1. random number generator
    By dspguru in forum IP Discussion
    Replies: 4
    Last Post: March 20th, 2018, 02:49 AM
  2. DDR2 HP Controller Random Writes
    By agdepus in forum IP Discussion
    Replies: 2
    Last Post: November 14th, 2008, 02:33 AM
  3. True Random Number Generator (TRNG)
    By olba in forum IP Discussion
    Replies: 4
    Last Post: August 15th, 2008, 02:34 PM
  4. random write on first cycle after reset_n goes hi?
    By Nails in forum General Discussion Forum
    Replies: 0
    Last Post: April 5th, 2007, 10:21 AM
  5. Random reboot while tcp-ip file transmission
    By imported_Cedric in forum Linux Forum
    Replies: 6
    Last Post: March 4th, 2007, 10:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •