📄 divhz.vhd
字号:
------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date: 15:45:01 04/22/2009 -- Design Name: -- Module Name: DIVHZ - RTL -- 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 DIVHZ isport(CLK:IN STD_LOGIC; RESET:IN STD_LOGIC; CLKOUT:OUT STD_LOGIC); end DIVHZ;architecture RTL of DIVHZ issignal s1 : std_logic;signal s2 : std_logic;signal cnt : integer range 0 to 5;beginprocess(RESET,CLK)beginif reset='0' then cnt<=0;elsif clk'event and clk='1' then if cnt=5 then cnt<=0; else cnt <= cnt+1; end if;end if;end process;process(RESET,CLK)beginif reset='0' then s1<='0';elsif clk'event and clk='1' then if cnt=0 then s1<= not s1; else s1<= s1; end if;end if;end process;process(RESET,CLK)beginif reset='0' then s2<='1';elsif clk'event and clk='0' then if cnt=3 then s2<= not s2; else s2 <=s2; end if;end if;end process;CLKOUT <= s1 xor s2; end RTL;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -