📄 freqdiv_100hz.vhd
字号:
------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date: 00:27:38 06/14/2007 -- Design Name: -- Module Name: freqdiv_100hz - 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 freqdiv_100hz IS
PORT(a : IN STD_LOGIC;
b : OUT STD_LOGIC);END freqdiv_100hz;ARCHITECTURE Behavioral OF freqdiv_100hz IS
SIGNAL count1 : STD_LOGIC_VECTOR(7 DOWNTO 0);
SIGNAL count2 : STD_LOGIC_VECTOR(7 DOWNTO 0);BEGIN
PROCESS(a)
BEGIN
IF(a'event AND a = '1') THEN
IF(count1 = "11111111") AND (count2 = "11111111") THEN
b <= '1';
count1 <= (OTHERS => '0');
count2 <= (OTHERS => '0');
ELSIF(count1 = "11111111") THEN
b <= '0';
count1 <= (OTHERS => '0');
count2 <= count2 + 1;
ELSE
b <= '0';
count1 <= count1 + 1;
END IF;
END IF;
END PROCESS;END Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -