Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - constant in entity or in architecture

 
Thread Tools Search this Thread
Old 07-13-2006, 10:40 PM   #1
Default constant in entity or in architecture


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
  Reply With Quote
Old 07-14-2006, 02:50 PM   #2
=?ISO-8859-1?Q?Sch=FCle_Daniel?=
 
Posts: n/a
Default Re: constant in entity or in architecture

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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump