Is it correct to build a LFSR?

Discussion in 'VHDL' started by timewing, Aug 30, 2008.

  1. timewing

    timewing

    Joined:
    Aug 30, 2008
    Messages:
    2
    I'm intend to build a LFSR, and assign the first 576 states to an array. The taps I choose is [16, 14, 13, 11]

    There's the warning:
    Register <rom<1>> equivalent to <rom<0>> has been removed
    Register <rom<2>> equivalent to <rom<0>> has been removed
    ...
    Register <rom<576>> equivalent to <rom<0>> has been removed

    I guess there's something wrong with my code?




    type rom_type is array(0 to 576) of bit_vector(15 downto 0);

    constant allzero : bit_vector(15 downto 0) := (others => '0');
    signal q : bit_vector(15 downto 0) := (others => '1');
    signal reset : std_logic;

    signal rom : rom_type;

    begin

    reset <= '1' when q = allzero else '0';

    process (reset) is

    variable tmp : rom_type;

    begin
    if (reset='1') then
    q <= (others => '1'); ----seed of the LFSR
    else
    for i in rom_type'range loop
    q(0) <= q(15) xor q(13) xor q(12) xor q(10);
    q(15 downto 1) <= q(14 downto 0);
    tmp(i) := q;
    end loop;
    rom <= tmp;
    end if;
    end process;
    timewing, Aug 30, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Spartan815

    LFSR

    Spartan815, Jan 28, 2004, in forum: VHDL
    Replies:
    10
    Views:
    8,025
    VhdlCohen
    Jan 29, 2004
  2. h.ali.maher@gmail.com

    Looking for LFSR code

    h.ali.maher@gmail.com, Feb 28, 2007, in forum: VHDL
    Replies:
    5
    Views:
    4,389
    OutputLogic
    May 22, 2009
  3. 0310889@rgu.ac.uk

    LFSR code

    0310889@rgu.ac.uk, Mar 28, 2007, in forum: VHDL
    Replies:
    4
    Views:
    3,159
    Mike Treseler
    Mar 28, 2007
  4. mn19

    LFSR

    mn19, Jun 12, 2007, in forum: VHDL
    Replies:
    1
    Views:
    831
    Mike Treseler
    Jun 12, 2007
  5. Martin
    Replies:
    6
    Views:
    1,013
    roden@rochester.rr.com
    Mar 2, 2009
Loading...

Share This Page