将std_logic_vector与多个常量进行比较

时间:2016-10-28 16:41:32

标签: vhdl

我有一个if子句,我希望将6位std_logic_vector与多个常量任意(即未运行的数字)6位值进行比较。我知道我可以用“|”在结构的情况下,但有没有办法在保持if语句的同时缩短以下内容?我不是100%肯定,但我认为设计的其余部分是使用VHDL93。

if not (de_inst(31 downto 30) = FMT3 and (
  de_inst(24 downto 19) = LDSB or
  de_inst(24 downto 19) = LDSH or
  de_inst(24 downto 19) = LDUB or
  de_inst(24 downto 19) = LDUH or
  de_inst(24 downto 19) = LD or
  de_inst(24 downto 19) = LDD or
  de_inst(24 downto 19) = STB or
  de_inst(24 downto 19) = STH or
  de_inst(24 downto 19) = ST or
  de_inst(24 downto 19) = ISTD or
  de_inst(24 downto 19) = IAND or
  de_inst(24 downto 19) = ANDN or
  de_inst(24 downto 19) = IOR or
  de_inst(24 downto 19) = ORN or
  de_inst(24 downto 19) = IXOR or
  de_inst(24 downto 19) = IXNOR or
  de_inst(24 downto 19) = ISLL or
  de_inst(24 downto 19) = ISRL or
  de_inst(24 downto 19) = ISRA or
  de_inst(24 downto 19) = IADD or
  de_inst(24 downto 19) = ISUB or
  de_inst(24 downto 19) = UMUL or
  de_inst(24 downto 19) = SMUL or
  de_inst(24 downto 19) = UDIV or
  de_inst(24 downto 19) = SDIV )) then

1 个答案:

答案 0 :(得分:0)

VHDL允许您在更高级别编写它,您可以在其中创建"设置"在所有指令中,然后检查信号是否具有这些指令之一的值,例如:

    $(this_table + ' > tbody > tr').append('<td>info,</td>'); //Append to table