目标信号<=表达式1 when 条件 else
表达式2 when 条件 else
-------
表达式n-1 when 条件 else
表达式n;
when/else语句是并发语句,按照书写的顺序自上而下逐条测试的,要实现优先编码器可以在表达式中使用x来实现
如
y<="111" when inp="1xxxxxxx" else
"110"when inp="01xxxxxx" else
"101"when inp="001xxxxx" else
"100"when inp="0001xxxx" else
"011"when inp="00001xxx" else
"010"when inp="000001xx" else
"001"when inp="0000001x" else
"000";