array problems

Discussion in 'VHDL' started by kandelabr, Feb 7, 2009.

  1. kandelabr

    kandelabr

    Joined:
    Feb 7, 2009
    Messages:
    2
    Does anyone know why this isn't working:
    Code:
    init_mem:process(init)
            begin
                if(init='1') then mem_array(0)<=init_data;
                end if;
            end process;
    , but this does:
    Code:
    init_mem:process(init)
            begin
                if(init='1') then pom<=init_data;
                end if;
            end process;
    Btw mem_array is type array (integer range <>) OF std_logic_vector(15 downto 0), and init_data and pom are both std_logic_vector(15 downto 0).
    Init is std_logic.
    Thanks
     
    kandelabr, Feb 7, 2009
    #1
    1. Advertising

  2. kandelabr

    gfandango

    Joined:
    Feb 3, 2009
    Messages:
    3
    It will be better if you put init_data in your sensitivity list.
     
    gfandango, Feb 7, 2009
    #2
    1. Advertising

  3. kandelabr

    kandelabr

    Joined:
    Feb 7, 2009
    Messages:
    2
    Tried that, but still not working.
    I just can't understand how come it won't write in an array but it will write in another variable. :dontknow:
    But thanks anyway.
     
    kandelabr, Feb 9, 2009
    #3
  4. kandelabr

    eliascm

    Joined:
    Jan 30, 2009
    Messages:
    42
    Problem with Array

    Your array has 2 indices, but you are using only 1 to access it.
     
    eliascm, Feb 11, 2009
    #4
    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. Susan Baker
    Replies:
    2
    Views:
    816
    kelvSYC
    Jun 26, 2005
  2. Shelly

    Problems, problems for newbie

    Shelly, Sep 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,188
    Shelly
    Sep 3, 2007
  3. Mara Guida

    const and array of array (of array ...)

    Mara Guida, Sep 2, 2009, in forum: C Programming
    Replies:
    3
    Views:
    496
    David RF
    Sep 3, 2009
  4. Tom
    Replies:
    3
    Views:
    213
    salsablr
    Dec 20, 2004
  5. Tuan  Bui
    Replies:
    14
    Views:
    477
    it_says_BALLS_on_your forehead
    Jul 29, 2005
Loading...

Share This Page