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

Reserved word "bit" as signal name

Altera_Forum
Honored Contributor II
1,363 Views

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
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
659 Views

"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.
0 Kudos
Altera_Forum
Honored Contributor II
659 Views

Thanks for your opinion

0 Kudos
Reply