Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16597 Discussions

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

Altera_Forum
Honored Contributor II
2,123 Views

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
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,103 Views

Change "0000_0000_0000_00" to B"0000_0000_0000_00". 

 

Good luck, Ton
0 Kudos
Altera_Forum
Honored Contributor II
1,103 Views

Yes that works fine!  

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

Whatever, Thank you.
0 Kudos
Altera_Forum
Honored Contributor II
1,103 Views

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....
0 Kudos
Altera_Forum
Honored Contributor II
1,103 Views

 

--- 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
0 Kudos
Reply