How to port map selected signals from a large vector to smaller one

Guest #4354197
Rate this post
useful
not useful
Hi,

I need a help.

I want to map a input port of D flip flop (named 'din') which is 
STD_LOGIC_VECTOR(7 downto 0) with the internal signal sumf : 
STD_LOGIC_VECTOR (24 downto 0) such that I want to map elements 
23,22,21,20,15,14,13,12,7...to 0 of sumf to port din.


I write the code :

din=>(sumf(23 downto 20, 15 downto 12, 7 downto 0)).

I get an error "Sliced name is allowed only on single dimensional 
array". What is the procedure to port map selected elements in vector to 
other vector as in this case?

Thanks and regards,
Rohan Narkhede
Guest #4354294
Rate this post
useful
not useful
Rohan Narkhede wrote:
> I write the code :
>
> din=>(sumf(23 downto 20, 15 downto 12, 7 downto 0)).

while din is std_logic_vector (7 downto 0) is only 8 Bit wide, you cant 
put in 16 Bits!

Either you define din as std_logic_vector (15 downto 0) and try this:

[code] din <= sumf(23 downto 20) & sumf(15 downto 12) & sumf(7 downto 
0);

Or you have to serialize the signal an feed in two cycles.

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now