constant in entity or in architecture

M

MariuszK

Guest
Hello,
What is a difference between constant declared in entity and in
architecture?

In this sample is the same? When it is change something (synthezis
etc.....):
----------------------------------------------------
entity EWeightValue is

port(
out1 : out TNumberType(1 downto 0)
);
constant cc: TNumberType:= "00";
end EWeightValue;

--}} End of automatically maintained section

architecture AWeightValue of EWeightValue is
constant cc: TNumberType:="00";
end EWbegin
out1 <= cc;
end AWeightValue;
----------------------------------------------------
Thank you for answers.
Mariusz
 
MariuszK schrieb:
Hello,
What is a difference between constant declared in entity and in
architecture?

In this sample is the same? When it is change something (synthezis
etc.....):
----------------------------------------------------
entity EWeightValue is

port(
out1 : out TNumberType(1 downto 0)
);
constant cc: TNumberType:= "00";
end EWeightValue;

--}} End of automatically maintained section

architecture AWeightValue of EWeightValue is
constant cc: TNumberType:="00";
end EWbegin
out1 <= cc;
end AWeightValue;
an entity may have more than one architecture
if all architectures are using the same constant than
this constant may as well be placed into entity declaration
(you save some typing work)

the generics of an entity may be different for each instantiation
one can think of constant in the entity as generic that has
the same value for all instantiations

hth, Daniel
 

Welcome to EDABoard.com

Sponsor

Back
Top