Altera_Forum
Honored Contributor
16 years agoVerilog: is else statement mandatory
I'm reviewing a program written by another developer, and have noticed that they frequently leave out the final else in if/else statements, nor do they always assign values to all variables from one begin/end block to the next.
Is there anything strictly dangerous about doing so in Quartus Verilog? For instance, how does the compiler interpret the code:
if(value>=compare)
value<=0;
else
compare <= compare -1;
Is is free to treat unspecified variables as "DON'T CARE", or will it enforce that the value not change?