[英]Understanding this T Flip-Flop example?
我正在阅读一本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分配多个信号。在流程语句之外,它是Q <= t_tmp
但是在流程内部,如果S='0'
则Q <= '1'
。 这是如何工作的? 我对VHDL的了解有限,这对我来说似乎是错误的。 基本上,这对我来说就像写一样:
Q <= '0';
Q <= '1';
谁能帮助我更好地理解这个例子?
您是对示例的质疑。 坏了
Q <= '1';
应该
t_tmp <= '1';
有人意识到他们无法读取输出,介绍了t_tmp,只更改了一半代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.