Forum Discussion
Altera_Forum
Honored Contributor
16 years agoGenerating normally distributed random numbers
Hi, Does anyone have any tips regarding how to generate normally distributed pseudo-random numbers in Verilog or VHDL? Any help would be most appreciated. Regards
Altera_Forum
Honored Contributor
16 years agoI normally code as below
signal shift : std_logic_vector(15 downto 1);
process(reset,clk)
if reset = '1' then
shift <= "010"&x"123"; -- seed
elsif rising_edge(clk) then
if en = '1' then
shift(1) <= shift(14) xor shift(15); -- taps
shift(2 to 15) <= shift(1 to 14); -- shift
end if;
end if;
end process;