precedence of a downto clause

E

ejubenville

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top