Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > precedence of a downto clause

Thread Tools

precedence of a downto clause

Posts: n/a
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)
(myvalue & myfunc())(7 downto 0)
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?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DOWNTO versus TO keyword on Component instantiation VHDL 1 11-18-2008 12:12 PM
ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL freitass Hardware 0 11-01-2007 03:44 PM
signed(12 downto 0) to signed (8 downto 0) kyrpa83 VHDL 1 10-17-2007 06:58 PM
downto vs. to Fabian VHDL 4 08-31-2007 01:00 AM
std_logic_vector(0 downto 0) Brad Smallridge VHDL 3 11-12-2004 06:34 PM