Vhdl 理解这个T触发器示例吗?

Vhdl 理解这个T触发器示例吗?,vhdl,Vhdl,我正在读一本VHDL的书,很难理解他们给出的一个例子 代码如下: ------------------------------------------------------------------- -- RET T Flip-flop model with active-low asynchronous set input. -- ------------------------------------------------------------------- -- library de

我正在读一本VHDL的书,很难理解他们给出的一个例子

代码如下:

-------------------------------------------------------------------
-- RET T Flip-flop model with active-low asynchronous set input. --
-------------------------------------------------------------------
-- library declaration
library IEEE;
use IEEE.std_logic_1164.all;
-- entity
entity t_ff_s is
  port ( T,S,CLK : in std_logic;
  Q : out std_logic);
end t_ff_s;
-- entity
architecture my_t_ff_s of t_ff_s is
  signal t_tmp : std_logic; -- intermediate signal declaration
begin
  tff: process (S,CLK)
  begin
    if (S = '0') then
      Q <= '1';
    elsif (rising_edge(CLK)) then
      t_tmp <= T XOR t_tmp; -- temp output assignment
    end if;
  end process tff;
  Q <= t_tmp; -- final output assignment
end my_t_ff_s;

有人能帮我更好地理解这个例子吗?

你质疑这个例子是对的。它坏了

Q <= '1';
应该是

t_tmp <= '1';

有人意识到他们无法读取输出,引入了t_tmp,只更改了一半的代码。

你对这个例子的质疑是对的。它坏了

Q <= '1';
应该是

t_tmp <= '1';

有人意识到他们看不懂输出,引入了t_tmp,只修改了一半代码。

这也是我的想法,但我不完全确定作者是否注意到了这一点,他说这也是正确的,当他上传他的书的新版本时,它也会被修复。这也是我的想法,但我并不完全确定,我已经把它告诉了作者,他说这也是正确的,当他上传他的书的新版本时,它也会被修复