求一个简单的上升沿触发的二分频CPLD程序.用vhdl语言写,谢谢

2024-12-02 05:00:10
推荐回答(1个)
回答1:

library ieee;
use ieee.std_logic_1164.all;
entity div2 is
port (clk:in std_logic;
q:out std_logic);
end div2;
architecture behave of div2 is
signal q_n :std_logic;
begin
process(clk)
begin
if (clk'event AND clk='1') then
q <= q_n;
q_n <= NOT q_n;
end if;
end process;
end behave;