precedence of a downto clause

Discussion in 'VHDL' started by ejubenville, Mar 28, 2013.

  1. ejubenville

    ejubenville Guest

    If I use a downto clause on a function call at the end of a concatenation, will the downto clause apply only to the return value of the function call, or to the whole concatenation?

    In other words, does this:
    myvalue & myfunc()(7 downto 0)
    mean:
    (myvalue & myfunc())(7 downto 0)
    or:
    myvalue & (myfunc()(7 downto 0))

    Here is an example. Suppose GetZeros returns a std_logic_vector of 8 bits, all zeros, and I write this statement:

    result <= b"1111" & GetZeros()(3 downto 0);

    Will the result be b"11110000", throwing the middle four bits away from b"111100000000"? Or would the result be b"0000", throwing away all but the lower 4 bits of the entire concatenation?
     
    ejubenville, Mar 28, 2013
    #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. Brad Smallridge

    std_logic_vector(0 downto 0)

    Brad Smallridge, Nov 12, 2004, in forum: VHDL
    Replies:
    3
    Views:
    8,251
    Michael Riepe
    Nov 12, 2004
  2. Fabian

    downto vs. to

    Fabian, Aug 29, 2007, in forum: VHDL
    Replies:
    4
    Views:
    10,268
    Brad Smallridge
    Aug 31, 2007
  3. kyrpa83
    Replies:
    1
    Views:
    626
    kyrpa83
    Oct 17, 2007
  4. Replies:
    1
    Views:
    1,717
    jeppe
    Nov 18, 2008
  5. hassenman
    Replies:
    3
    Views:
    823
    jeppe
    Mar 14, 2009
Loading...

Share This Page