Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I have to do a instantation of several components

enter image description here

I suppose the code for this instantation would be something like this:

componentA: componentB port map(
output_ca => input_cb
); 
componentA: componentC port map(
output_ca => input_cc
); 

But I know that part of the code before is wrong, because 'ouput_ca' has 6 bits and input_cb, and input_cc has only 3 bits every one of them. How would be written this code in a good way? Thank you so much for your help.

share|improve this question

1 Answer

You must use some signals, you can't map straight from one pin to another (I'm also using direct instantiation to avoid creating component declarations - see also my answer here):

signal aout : std_logic_vector(5 downto 0);

A: entity work.componentA port map(
    output_pin => aout
); 
B: entity work.componentB port map(
    input_pin => aout(5 downto 3)
); 
C: entity work.componentC port map(
    input_pin => aout(2 downto 0)
); 

Aside

You seem to be confused in your instantiation syntax. You wrote:

componentA:componentB port map (...

implying that componentA connects to component B.

What is actually being said is

individual_name_of_component: name_of_entity

So you pick an entity which you are instantiating on the right of the : and give it a name on the left.

share|improve this answer
Cool, I didn't know about direct instantiation. I always hated keeping component declarations in sync. – ajs410 Jul 12 '11 at 18:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.