|
波形如图 testbanch如下
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY DFF1_vhd_tst IS
END DFF1_vhd_tst;
ARCHITECTURE DFF1_arch OF DFF1_vhd_tst IS
-- constants
-- signals
SIGNAL clk : STD_LOGIC;
SIGNAL clr : STD_LOGIC;
SIGNAL d : STD_LOGIC;
SIGNAL q : STD_LOGIC;
COMPONENT DFF1
PORT (
clk : IN STD_LOGIC;
clr : IN STD_LOGIC;
d : IN STD_LOGIC;
q : OUT STD_LOGIC
);
END COMPONENT;
BEGIN
i1 : DFF1
PORT MAP (
-- list connections between master ports and signals
clk => clk,
clr => clr,
d => d,
q => q
);
init : PROCESS
-- variable declarations
BEGIN
clr <= '0';
wait for 10ns;
clr <= '1';
wait for 40ns;
clr <= '0';
wait for 40ns;
-- code that executes only once
WAIT;
END PROCESS init;
always : PROCESS
-- optional sensitivity list
-- ( )
-- variable declarations
BEGIN
clk<='0';
wait for 10ns;
clk<='1';
wait for 10ns;
-- code executes for every event on sensitivity list
--WAIT;
END PROCESS always;
d_always : PROCESS
-- optional sensitivity list
-- ( )
-- variable declarations
BEGIN
d<='0';
wait for 50ns;
d<='1';
wait for 50ns;
-- code executes for every event on sensitivity list
--WAIT;
END PROCESS d_always;
END DFF1_arch; |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|