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

A question of your own? This thread is over 10 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.