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

Subversion Repositories mips_fault_tolerant

[/] [mips_fault_tolerant/] [trunk/] [source/] [lfsr.vhd] - Blame information for rev 51

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 jimi39
library IEEE;
2
use IEEE.std_logic_1164.all;
3
 
4
entity lfsr is
5
port (
6
  clock    : in std_logic;
7
  reset    : in std_logic;
8
  sel_top   : in std_logic;
9
  --                               input
10
  data_out : out std_logic_vector(63 downto 0)
11
);
12
end lfsr;
13
 
14
architecture modular of lfsr is
15
 
16
 
17
 
18
begin
19
 
20
  process (clock,sel_top)
21
    variable lfsr_tap : std_logic;
22
         variable seed : std_logic_vector(63 downto 0);
23
         variable lfsr_reg : std_logic_vector(63 downto 0);
24
  begin
25
    if sel_top = '1' then seed := x"0F0F0F0F0F0F0F0F"; else seed := x"0000000000000000"; end if;
26
    if clock'EVENT and clock='0' then  --1
27
      if reset = '1' then  --1
28
        lfsr_reg := seed;
29
      else
30
        lfsr_tap := lfsr_reg(0) xor lfsr_reg(1) xor lfsr_reg(3) xor lfsr_reg(4);
31
        lfsr_reg := lfsr_reg(62 downto 0) & lfsr_tap;
32
      end if;
33
    end if;
34
         data_out <= lfsr_reg;
35
  end process;
36
 
37
  --data_out <= lfsr_reg;
38
 
39
end modular;
40
 
41
 

powered by: WebSVN 2.1.0

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