- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 SP2Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change "0000_0000_0000_00" to B"0000_0000_0000_00".
Good luck, Ton- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes that works fine!
I'm just wondering why this binary sign is needed while without underscore it is not. Whatever, Thank you.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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....- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page