我active-hdl 10
用于编译和模拟 DFlipFlop 结构。我的代码编译成功,没有任何错误或警告,但是当我模拟它时,我的输出有未知值。(见图)
我编译并模拟了这段代码xilinx
,active-hdl 8
没有任何问题。
D_FlipFlop 代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity D_FlipFlop is
Port ( D : in STD_LOGIC;
Clk : in STD_LOGIC;
Q : inout STD_LOGIC);
end D_FlipFlop;
architecture Behavioral of D_FlipFlop is
component DLach Port ( D : in STD_LOGIC;
C : in STD_LOGIC;
Q : inout STD_LOGIC;
Qprim : inout STD_LOGIC);
end component;
Signal Y : STd_logic;
Signal Clk_Not : Std_Logic;
Signal out1 : Std_Logic;
Signal out2 : Std_Logic;
begin
Clk_Not<=not(clk);
h1 : DLach port map(D=>D,C=>clk,Q=>Y,Qprim=>out1);
h2 : DLach port map(Y,Clk_Not,Q,out2);
end Behavioral;
拉赫代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity DLach is
Port ( D : in STD_LOGIC;
C : in STD_LOGIC;
Q : inout STD_LOGIC:= '0';
Qprim : inout STD_LOGIC:= '1');
end DLach;
architecture Behavioral of DLach is
Signal first : Std_logic ;
Signal second : Std_logic ;
Signal D_not : Std_logic ;
begin
D_Not <= not(D);
first <= D Nand C;
second <= D_not nand C;
Q <= first nand Qprim;
Qprim <= second nand Q ;
end Behavioral;
我研究了很多,但我找不到答案。所以我认为这对他们使用 active -hdl 试用版的人有用。