EmbDev.net

Forum: FPGA, VHDL & Verilog generic register lfsr


von siwar (Guest)


Attached files:

Rate this post
useful
not useful
good morning
I want to program a vhdl code wich work with input , output and selector 
pointing a generic component. this component is a registre lfsr each 
time it take new parameter generator polynomial

it joined my idea of implementation

And this my first think of code :
1
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
use IEEE.STD_LOGIC_ARITH.ALL;
4
use IEEE.NUMERIC_STD.ALL;
5
use STD.TEXTIO.ALL;
6
library WORK;
7
use WORK.pkgg.ALL;
8
entity scrambler is
9
    Port ( e : in  STD_LOGIC_VECTOR (29 downto 0);
10
           Sel : in  STD_LOGIC_VECTOR (3 downto 0);
11
           s : out  STD_LOGIC_VECTOR (29 downto 0));
12
end scrambler;
13
architecture Behavioral of scrambler is
14
15
   SIGNAL rst_n :   std_logic;
16
   SIGNAL clk   :   std_logic;
17
   SIGNAL dout  :  std_logic_vector(29 downto 0);
18
19
    CONSTANT width  : integer     := 30;
20
    CONSTANT length : integer     := 31;         -- length of the register
21
    CONSTANT taps   : T_LFSR_TAPS16 := (31, 27, 26, 25, 22, 21, 19, 18, 17, 16, 10, 7, 6, 5, 3, 2);
22
23
           component genlfsr 
24
           generic (
25
    width  : integer     := 30;
26
    length : integer     := 31;         
27
    taps   : T_LFSR_TAPS16 := (31, 27, 26, 25, 22, 21, 19, 18, 17, 16, 10, 7, 6, 5, 3, 2)
28
    );
29
30
    port ( 
31
    rst_n : in  std_logic;
32
    clk   : in  std_logic;
33
    dout  : out std_logic_vector(29 downto 0) 
34
          );
35
  end component;
36
37
bgin
38
39
U1: entity work.genlfsr(behavioral) 
40
    generic map (width => width ,length => length ,taps => taps)
41
    port map(rst_n => rst_n ,clk => clk ,dout =>dout);
42
43
process (dout ) is
44
   
45
   begin
46
 
47
 s(29 downto 29-dout'high) <= dout;
48
49
 end process;
50
end Behavioral;

So I don't understand how to make a generic registre lfsr with different 
value

von siwar (Guest)


Rate this post
useful
not useful
please help me

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
siwar wrote:
> So I don't understand how to make a generic registre lfsr with different
> value
What do you mean with a "different value"?
Different taps?

siwar wrote:
> 12:33
siwar wrote:
> 13:02
> please help me
Please wait some minutes. At least half an hour. This is not a hotline.

And then post your own suggestion of a solution for the desired 
component "genlfsr". Then we can discuss the design. But no one is 
intended to do all of your job, bcause its your homework...


And additionally: one post is enough! I have deleted the other one.

von siwar (Guest)


Rate this post
useful
not useful
I apologize for the inconvenience
I'm sorry

von anynomous (Guest)


Rate this post
useful
not useful
you should describe what you want,

i simply cannot imagine what is intended

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.