vhdl - VHDL 中的 if 语句

标签 vhdl

我对 VHDL 中的 if 语句有疑问,请参见下面的示例;-)

   signal SEQ : bit_vector(5 downto 0); 
signal output: bit; 
    -------

     if(SEQ = "000001") and (CNT_RESULT = "111111") then 
       output<= '1';
      CNT_RESET <= '0';
      else output<='0';
    end if;

我得到:if 语句是非法的,并且“输出”有多个来源。任何想法

最佳答案

我假设 if 语句不在进程内?您只能在进程内使用 if 语句。对于进程外的类似功能,您可以使用 when:

output <= '1' when (SEQ = "000001") and (CNT_RESULT = "111111") else
          '0';

CNT_RESET <= '0' when (SEQ = "000001") and (CNT_RESULT = "111111") else
             '1';

关于vhdl - VHDL 中的 if 语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10062518/

相关文章:

initialization - 十六进制的 VHDL 初始化向量(长度不是 4 的倍数)

vhdl - 如何通过超时停止模拟?

VHDL 标识符的正则表达式

compiler-errors - 在VHDL中生成关键字

vhdl - VHDL 中的 FSM 机器,每个状态都执行某些操作

VHDL 案例选择不是局部静态的

matrix - VHDL矩阵乘法

compiler-errors - VHDL错误:Pack:2811 - Directed packing was unable to obey the user design

vhdl - VHDL中奇怪的XNOR行为

调试VHDL : How to?