OpenCores
URL https://opencores.org/ocsvn/tcp_ip_core_w_dhcp/tcp_ip_core_w_dhcp/trunk

Subversion Repositories tcp_ip_core_w_dhcp

[/] [tcp_ip_core_w_dhcp/] [trunk/] [lfsr32_mod.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 craighaywo
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    17:06:23 01/06/2015 
6
-- Design Name: 
7
-- Module Name:    lfsr16_mod - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
 
23
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--use IEEE.NUMERIC_STD.ALL;
26
 
27
-- Uncomment the following library declaration if instantiating
28
-- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32
entity lfsr32_mod is
33
    Port ( CLK_IN               : in  STD_LOGIC;
34
           SEED_IN              : in  STD_LOGIC_VECTOR(31 downto 0);
35
           SEED_EN_IN   : in  STD_LOGIC;
36
           VAL_OUT              : out STD_LOGIC_VECTOR(31 downto 0));
37
end lfsr32_mod;
38
 
39
architecture Behavioral of lfsr32_mod is
40
 
41
signal lfsr_reg : std_logic_vector(31 downto 0) := X"00000000";
42
 
43
begin
44
 
45
        VAL_OUT <= lfsr_reg;
46
 
47
        process(CLK_IN)
48
        begin
49
                if rising_edge(CLK_IN) then
50
                        if SEED_EN_IN = '1' then
51
                                lfsr_reg <= SEED_IN;
52
                        else
53
                                lfsr_reg(31 downto 1) <= lfsr_reg(30 downto 0);
54
                                lfsr_reg(0) <= not(lfsr_reg(31) XOR lfsr_reg(21) XOR lfsr_reg(1) XOR lfsr_reg(0));
55
                        end if;
56
                end if;
57
        end process;
58
 
59
end Behavioral;
60
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.