Contents
Up
Previous
Next
Conditional signal assignment
The conditional signal assignment statement alters the projected waveform
conditionally based on a boolean expression. The grammar rule is:
condition : expression(boolean)
conditional-waveforms : { waveform WHEN condition ELSE } waveform
conditional-signal-assignment :
target "<=" [options] conditional-waveforms ";"
This assignment consists of a list of waveforms that should be applied if
the condition immediately following evaluates to true and a final waveform
that is applied if no conditions are true. The conditions are checked
sequentially from first to last and the first waveform of the first
condition is applied to the projected waveform. If more than one condition
is true, only the waveform corresponding to the first true condition is used.
For example,
data<=data1 when sel=B"00" else
data2 when sel=B"01" else
data3 when sel=B"10" else
data4;
operates as a multiplexer of four inputs.