Forum Discussion
Altera_Forum
Honored Contributor
20 years agorandom number generator?
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>1 Reply
- Altera_Forum
Honored Contributor
--- Quote Start --- 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}> (index.php?act=findpost&pid=17627)
--- quote end ---
--- Quote End --- Did you initialized it using srand()? Paolo