Forum Discussion

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

Is underscore unallowed??? ("0000_0100")

Hi all,

I allways get a compiler error if I try to separate long binary values with underscore!

example:

signal shifreg :: std_logic_vector(15 downto 0);

shiftreg <= "0000_0000_0000_00" & data(1 downto 0);

results in:

"Error (10327): VHDL error at ccd_adc_control.vhd(69): can't determine definition of operator ""&"" -- found 0 possible definitions"

But it isn't the ampersand that is the problem, its the underscore. If you delete it, the compiler is happy.

or another error that says the constant is too long "contains 20 elements instead of 16" (the difference is the count of underscores)

When you look in several VHDL-Books / Documents the underscore allways is described as standard.

Thanks, Thomas

PS: Using Quartus II, 9.1 SP2

4 Replies

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

    Yes that works fine!

    I'm just wondering why this binary sign is needed while without underscore it is not.

    Whatever, Thank you.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    PS:

    with "b" it's just possible to define binary signals. Unfortunately with other signals such as

    "ZZZZ_ZZZZ_ZZZZ_ZZZZ"

    it's still impossible, thereby it would be more easy for a compilers syntax checker to just ignore such underscores independantly of the defined base....
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I'm just wondering why this binary sign is needed while without underscore it is not.

    --- Quote End ---

    Well, I'm not an VHDL guru, but I guess with the underscore, without the base specifier the bit-string will be considered as a character-string.

    Cheers, Ton