我正在尝试使用我编写的 D Latch 在 VHDL 中实现 D 触发器。但是时钟似乎有错误,我无法弄清楚那是什么。
这是我的 D Latch 的代码。
Library ieee;
Use ieee.std_logic_1164.all;
entity d_latch is
port (c,d : in std_logic;
q,nq : out std_logic);
end d_latch;
architecture arch of d_latch is
Signal qt, nqt: std_logic;
begin
qt <= (d nand c) nand nqt;
nqt <= ((not d) nand c) nand qt;
q <= qt;
nq <= nqt;
end arch;
我对其进行了测试,它可以工作,这是我的 d 触发器的代码:
Library ieee;
Use ieee.std_logic_1164.all;
entity d_flipflop is
port (d,clock : in std_logic;
q,nq : out std_logic);
end d_flipflop;
architecture arch of d_flipflop is
Component d_latch
Port
(
d, clk: in std_logic;
q, nq : out std_logic
);
End Component ;
Signal qt, nqt: std_logic;
begin
dl1: d_latch port map (
d => d,
clk => not clock,
q => qt
);
dl2: d_latch port map (
d => qt,
clk => clock,
q => q,
nq => nq
);
end arch;
这是错误:
** Error: /home/devplayer/CSC343/Lab_2_Content/d_flipflop.vhd(25): (vcom-1436) Use of non globally static actual (prefix expression) of formal "clk" requires VHDL 2008.
谢谢