Forum Discussion
Altera_Forum
Honored Contributor
14 years agowhen use 'else' and when use ; ?
Hi.. I am starter in VHDl. I have some questions... What is difference between else and ;? first code use else but when i use ';' instead of 'else' it doesn't work. Do you know why? and s...
Altera_Forum
Honored Contributor
14 years agoYour assignment to a is done outside a process, so imagine that it happens (nearly) instantly. (instead of conditionally).
The assignment to a is using more of a priority list to determine your output. If i(7) = '1', it doesn't matter what 6-0 are, your output will be "111". If i(7)=0, then i(6) is examined next. If you re-wrote your statement as: a<="000" when i(0) = '1' else "001" when i(1) = '1' else .. "111" when i(7) = '1' else "000"; then i(0) = '1' would take priority over all others.