fenpin.vhd
来自「用NEC编码方式写的红外发送程序,包括三个部分,分频,编码,编码输出」· VHDL 代码 · 共 25 行
VHD
25 行
library ieee; --1.5MHz分频为38KHz
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity fenpin is
port(clk:in std_logic;
div40:out std_logic);
end;
architecture one of fenpin is
signal cnt:std_logic_vector(4 downto 0);
signal clk_temp:std_logic;
constant m:integer:=19;
begin
process(clk)
begin
if clk'event and clk='1' then
if cnt=m then
clk_temp<=not clk_temp;
cnt<="00000";
else
cnt<=cnt+1;
end if;
end if;
end process;
div40<=clk_temp;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?