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.

Random Numbers Generator

Status
Not open for further replies.

StevieChalmers

Newbie level 1
Joined
Dec 14, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
I need a random number generator
written in VHDL to generate natural numbers
from 0 to 15. Does anyone have anything
similar to it (like any natural numbers
generator) ?

Any help would be much appreciated.
Thanks in advance.
 

**broken link removed**
This library has functions for generating good quality random numbers in a VHDL testbench environment. The functions will NOT synthesize.
 

hi, if the functions are not synthesizable mean we cant download it onto the fpga and realize it? I want to confirm because my frenz's final year project may require random number generator as part of his project and the project must at the end able to be download into the FPGA and reliaze it... thanks
 

LIBRARY IEEE;
USE IEEE.std_logic_1164.all;

ENTITY psp IS
PORT( clk : in std_logic;
reset : in std_logic;
init_value : in std_logic_vector(8 downto 0);
dout : out std_logic);
END psp;

ARCHITECTURE rus OF psp IS

SIGNAL reg: std_logic_vector(8 downto 0);

BEGIN

process(clk, reset, init_value)
begin
if reset = '1' then
reg <= init_value;
elsif rising_edge(clk) then
reg <= (reg(4) xor reg(0)) & reg(8 downto 1);
end if;
end process;

dout <= reg(0);

END rus;
 

Hi use a 4-Stage de-bruijn sequence generator and take all the four bits as output.
To about de-bruijn genenerator type "de bruijn sequence" in google search.
 

you can simply use any number of D-FF (depending on the word length you need to generate in your random number as number of Flip flops equal to number of bits per word) cascade these FFs with output of last stage connected to the input of first stage after XNOR or XOR gates.. this will generate random numbers of n-bits.. you can then simply use VHDL to get the required code of it..

I hope that helpls..
Ahmad,
 

This is a frequently asked question:
See section 4.10 of **broken link removed**

For something synthesizable: look here
**broken link removed**
 

The HDL code posted above will work, but I would recommend using a longer shift register. Longer registers repeat less frequenty.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top