2
我想實現一個D觸發器在VHDL中,使用我寫的D鎖存器。 但時鐘似乎有錯誤,我無法弄清楚是什麼。D觸發器在VHDL
這是我的D鎖存器的代碼。
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.
謝謝
明白了,謝謝! – ratsimihah 2012-02-15 03:30:34