And another entity for the AND gate can be written as,
Now we want to put them together inside a top entity. The top entity would contain this two entities as components.
Component Declaration:
Components are always declared after the architecture declaration and before the "begin" of the body of the architecture. The syntax is pretty same as the original entities. Only the term "entity" is replaced by the component here in the beginning.
Component port map:
Now the biggest task is still left. We decided to use this smaller entities as components, but we have to connect the input and output ports of the smaller entities to some signal or ports of the top entity. You can actually visualize it in this way.
it's just like plugging ICs into a breadboard. For example, we can plug a 7400 IC (NAND) and 7408 IC (AND) gate in a breadboard in this similar way as shown in the figure above.
We could also instantiate the components in this way, however the order of the instantiation is very important in that case. Otherwise the one part will be binded to another undesired part.
Â