Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] generating random bits on verilog

Status
Not open for further replies.

burdurlu

Newbie level 3
Joined
Aug 14, 2013
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
18
hello people on edaboard:) ,

i need to generate random bits with a length of (say) 10,000 bits on Verilog. i looked it up and found that $random command generates 32 bit random numbers but how can i use it to get 10000 random bits? help please
 

Do a for loop to generate N times 32-bit random numbers, and concatenate it to get your 10000 random bits. And obviously $random only works in simulation, not in real hardware.
 
thanks for fast response:)

im working on simulation so its okay i guess
 

Hello,

Is it for simulation only purpose ?
Because I don't think that such syntax is synthesizable. You can use instead pseudo random pattern generators (PRPG) with easy implementation like LFSR (Linear feed back shift register) but as its name indicate it is pseudo random and not random.
It generates the same sequence after a period according to reset state of flip-flops. One sequence can be considered as random, but since it is repeated many times it can not be considered as fully random.

Regards
 

Hello,

Is it for simulation only purpose ?
Because I don't think that such syntax is synthesizable. You can use instead pseudo random pattern generators (PRPG) with easy implementation like LFSR (Linear feed back shift register) but as its name indicate it is pseudo random and not random.
It generates the same sequence after a period according to reset state of flip-flops. One sequence can be considered as random, but since it is repeated many times it can not be considered as fully random.

Regards

yes, simulation only. i dont need to synthesize, but thanks for information, im new to verilog and fpga's.
 

Yup, for simulation you can use $random. And for real hardware using a LFSR as DFT_designer suggested is a good first choice, since those are easy to implement and are random enough for quite a lot of things.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top