From times to times I see different code examples that have " ... else Null" strings in if-statements and it's something I don't get. I've learned and I stick to the idea that the best way to model nothing is write no code. But is there any difference in these aproaches? if not then why do people write this "else null"?
1 Answer
As @BrianDrummond stated... From IEEE 1076:
10.14 Null statement
A null statement performs no action.
null_statement ::= [ label : ] null ;
The execution of the null statement has no effect other than to pass on to the next statement.
NOTE—The null statement can be used to specify explicitly that no action is to be performed when certain conditions are true, although it is never mandatory for this (or any other) purpose. This is particularly useful in conjunction with the case statement, in which all possible values of the case expression shall be covered by choices; for certain choices, it may be that no action is required
else null;
meansI didn't just forget this bit, there really is nothing to do here;
. As VHDL tends to be used in high integrity applications and some customers insist on critically reviewing every line of code, it really is the simplest and cheapest way to do the job. \$\endgroup\$