Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Reserved word "bit" as signal name

i don understand the coding as below:

signal bit : unsigned (3 downto 0);

U_Bit_counter1: Bit_counter1

port map (inc=>inc_bit, clr=>clr_bit, count=>bit, reset=>reset, CLK=>CLK);

Is that possible to use reserve word to declare the name of signal? Is there any problem to use it? If there is no problem, what is the function to use it? Thanks

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    "bit" is a predefined type in the package standard. I'd be very surprised if that code compiled; if it does I would expect that you'd encounter weird problems down the road. Keywords are exactly that - if you start using them as signal / variable names then the compiler cannot understand what you're trying to tell it.

    Even if that code does compile it's asking for trouble - I would advise that you change it. Besides, "bit" isn't very descriptive and doesn't help another programmer understand what your code is doing.

    Hope this helps.