constant in entity or in architecture

Discussion in 'VHDL' started by MariuszK, Jul 13, 2006.

  1. MariuszK

    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, Jul 13, 2006
    #1
    1. Advertising

  2. 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
     
    =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Jul 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric Peers
    Replies:
    2
    Views:
    1,439
    Jonathan Bromley
    Nov 18, 2004
  2. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,742
    Jukka K. Korpela
    Feb 24, 2007
  3. markla
    Replies:
    1
    Views:
    580
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,883
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,245
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page