本帖最后由 krian 于 2014-11-4 15:50 编辑
6分频器
源文件:
en
tity xt6_4 is
port(clk: in std_logic;
out2:out std_logic);
end xt6_4;
architecture Behavioral of xt6_4 is
begin
process(clk)
variable count2:integer range 0 to 7;
variable outp:std_logic;
begin
if(clk'event and clk = '1')then
count2 := count2+1;
if(count2 = 3)then
outp := NOT outp;
count2 := 0;
end if;
end if;
out2 <= outp;
end process;
end Behavioral;
仿真文件:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY test_xt6_4 IS
END test_xt6_4;
ARCHITECTURE behavior OF test_xt6_4 IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT xt6_4
PORT(
clk : IN std_logic;
out2 : OUT std_logic
);
END COMPONENT;
--Inputs
signal clk : std_logic := '0';
--Outputs
signal out2 : std_logic;
-- Clock period definitions
constant clk_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: xt6_4 PORT MAP (
clk => clk,
out2 => out2
);
-- Clock process definitions
clk_process :process
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process;
END;
没有输出。。。
感觉没有什么错误呀!下面附图,错误结果。。。
-
输出不显示呀
-
我也是新手,。。。
一周热门 更多>