vhdl - 与0或1比较,检测高阻抗

标签 vhdl

我知道在可综合的 VHDL 代码中不允许与 XZ 进行比较。但是是否允许编写代码,将信号与 01 进行比较以检测 Z 并暂停操作?代码如下:

process(clk)
begin
  if rising_edge(clk ) then
    if(rst = '0') then
      reg_0 <= (others => 'Z');
    elsif(btf_start = '1') then
      reg_0 <= "ZZ" & frame_in;
    elsif(t_btf_finish = '1') then
      reg_0 <= (others => 'Z');
    end if;
  end if;  
end process;

process(clk)
begin
  if rising_edge(clk) then
    if(reg_0(0) = '0' or reg_0(0) = '1') then
        -- DO SOME OPERATIONS
    else
        -- DO NOTHING
    end if;
  end if;
end process; 

最佳答案

不,这行不通。物理数字信号可以有两种状态,“0”和“1”。状态由信号上的电压定义:小于某个电压为“0”,大于该电压为“1”。即使是 float (高阻)信号也会有一些电压,这些电压将被解释为“1”或“0”。

“Z”基本上表示某个源不驱动信号,允许不同的源驱动“0”或“1”。对于没有源驱动信号的情况,信号通常会有一个上拉或下拉电阻,以默认将其保持在定义的“1”或“0”状态。

关于vhdl - 与0或1比较,检测高阻抗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17781265/

相关文章:

vhdl - 用 VHDL 设计组合移位运算符

loading - 为什么这个移位寄存器没有在 VHDL 中正确加载?

vhdl - Xilinx ISE block ram 推理的稳健性

random - VHDL 的随机数有多好?

vhdl - 在 VHDL 中实现简单的双端口 block ram 未按预期执行

arrays - VHDL - std_logic_vectors 数组转换为 std_logic_vector

vhdl - 这段代码会产生多少个触发器?

VHDL - 如何检测 std_logic_vector 的变化?

file-io - 如何在VHDL中读取一行中的元素?

report - VHDL 和使用 'report' 语句