📄 clk_2div.vhdl
字号:
------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date: 11:41:47 03/11/2008 -- Design Name: -- Module Name: clk_2div - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: ---- Dependencies: ---- Revision: -- Revision 0.01 - File Created-- Additional Comments: ------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;---- Uncomment the following library declaration if instantiating---- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity clk_2div is Port ( clk : in STD_LOGIC; rst : in STD_LOGIC; clk_2d : out STD_LOGIC);end clk_2div;architecture Behavioral of clk_2div issignal count:STD_LOGIC_VECTOR(3 DOWNTO 0);begin process(clk)
begin
if(rst='1')then
count<="0000";
elsif(clk'event and clk='1')then
if(count="1111")then
count<=(others=>'0');
else
count<=count+'1';
end if;
end if;
end process;
clk_2d<=count(0);end Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -