URL
https://opencores.org/ocsvn/lfsr_randgen/lfsr_randgen/trunk
Subversion Repositories lfsr_randgen
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 2 to Rev 3
- ↔ Reverse comparison
Rev 2 → Rev 3
/lfsr_randgen/trunk/manual.pdf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/lfsr_randgen/trunk/lfsr.vhd
51,10 → 51,9
use work.lfsr_pkg.ALL; |
|
entity lfsr is |
generic (width : integer := 32); |
generic (width : integer := 4); |
port (clk : in std_logic; |
set_seed : in std_logic; |
out_enable : in std_logic; |
set_seed : in std_logic; |
seed : in std_logic_vector(width-1 downto 0); |
rand_out : out std_logic_vector(width-1 downto 0) |
); |
64,25 → 63,25
|
begin |
|
process(clk,set_seed,out_enable,seed) |
process(clk) |
|
variable rand_temp : std_logic_vector (width-1 downto 0):=(0 => '1',others => '0'); |
variable temp : std_logic := '0'; |
|
begin |
|
if(rising_edge(clk)) then |
|
if(set_seed = '1') then |
rand_temp := seed; |
elsif(rising_edge(clk)) then |
rand_temp := seed; |
end if; |
|
temp := xor_gates(rand_temp); |
rand_temp(width-1 downto 1) := rand_temp(width-2 downto 0); |
rand_temp(0) := temp; |
rand_temp(0) := temp; |
|
end if; |
|
if(out_enable ='1') then |
rand_out <= rand_temp; |
else |
rand_out <= (others => '0'); |
end if; |
rand_out <= rand_temp; |
|
end process; |
|