8
第5章 基于HDL的时序逻辑电路实验
图5-2 边沿D触发器的仿真结果
9
第5章 基于HDL的时序逻辑电路实验 (2) 边沿D触发器的VHDL源代码如下:
--Behavioral D Flip-Flop with Clock Enable and Asynchronous Reset
entity Dflipflop is Port (D,clk,rst,ce : in STD_LOGIC; Q : out STD_LOGIC);
architecture Behavioral of DFF is begin
process(clk, rst,D) begin
if (CLK'event and CLK='1') then if rst ='1' then Q <= '0'; else Q<=D; end if;
end if; end process; end Behavioral;
end if; end process; end Behavioral;
13
第5章 基于HDL的时序逻辑电路实验
(3) 带有置位和清零端的边沿D触发器的约束文件规定
如下:
#Basys2约束文件: NET "clk" LOC ="B8"; //时钟
#Basys2约束文件: NET "clk" LOC ="B8"; //时钟
end Dflipflop;
architecture Behavioral of Dflipflop is begin
process(clk, rst,D,ce)