Specify bit position in array of vectors

Discussion in 'VHDL' started by Shannon, Feb 9, 2007.

  1. Shannon

    Shannon Guest

    Gosh, it didn't take long for me to need help again! I promise this
    is my last question for awhile.

    I have four books on VHDL and Google didn't help.

    How do I specify a bit position in an array of std_logic_vectors?

    TYPE arraytype IS ARRAY (0 TO 8) OF STD_LOGIC_VECTOR(7 DOWNTO 0);
    SIGNAL foo : std_logic;
    SIGNAL big_array : arraytype;

    ....


    foo <= big_array(5,2); -- yes I know this is wrong. What is the
    syntax to pick bit #2 of big_array(5)?

    Thanks again!

    Shannon
     
    Shannon, Feb 9, 2007
    #1
    1. Advertising

  2. Shannon

    weber Guest

    On 9 fev, 15:31, "Shannon" <> wrote:
    > Gosh, it didn't take long for me to need help again! I promise this
    > is my last question for awhile.
    >
    > I have four books on VHDL and Google didn't help.
    >
    > How do I specify a bit position in an array of std_logic_vectors?
    >
    > TYPE arraytype IS ARRAY (0 TO 8) OF STD_LOGIC_VECTOR(7 DOWNTO 0);
    > SIGNAL foo : std_logic;
    > SIGNAL big_array : arraytype;
    >
    > ...
    >
    > foo <= big_array(5,2); -- yes I know this is wrong. What is the
    > syntax to pick bit #2 of big_array(5)?
    >
    > Thanks again!
    >
    > Shannon


    Isn't it big_array(5)(2) ?
    Can't imagine another way!
    Cheers
    weber
     
    weber, Feb 9, 2007
    #2
    1. Advertising

  3. Shannon

    Shannon Guest

    On Feb 9, 12:05 pm, "weber" <> wrote:
    > On 9 fev, 15:31, "Shannon" <> wrote:
    >
    >
    >
    >
    >
    > > Gosh, it didn't take long for me to need help again! I promise this
    > > is my last question for awhile.

    >
    > > I have four books on VHDL and Google didn't help.

    >
    > > How do I specify a bit position in an array of std_logic_vectors?

    >
    > > TYPE arraytype IS ARRAY (0 TO 8) OF STD_LOGIC_VECTOR(7 DOWNTO 0);
    > > SIGNAL foo : std_logic;
    > > SIGNAL big_array : arraytype;

    >
    > > ...

    >
    > > foo <= big_array(5,2); -- yes I know this is wrong. What is the
    > > syntax to pick bit #2 of big_array(5)?

    >
    > > Thanks again!

    >
    > > Shannon

    >
    > Isn't it big_array(5)(2) ?
    > Can't imagine another way!
    > Cheers
    > weber- Hide quoted text -
    >
    > - Show quoted text -


    Yep. That did it. (I imagined all kinds of ways! None of them
    correct...hehehe)

    Thanks,
    Shannon
     
    Shannon, Feb 9, 2007
    #3
    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. Replies:
    3
    Views:
    1,863
    Timothy Bendfelt
    Jan 19, 2007
  2. Replies:
    9
    Views:
    1,061
    Juha Nieminen
    Aug 22, 2007
  3. Replies:
    3
    Views:
    729
    Shadowman
    Mar 26, 2008
  4. Wanderer
    Replies:
    1
    Views:
    622
    Wanderer
    Mar 24, 2011
  5. Guest
    Replies:
    0
    Views:
    485
    Guest
    Sep 14, 2005
Loading...

Share This Page