sepratef.vhd

来自「一个使用VHDL编写的音乐芯片的程序有很好的使用价值」· VHDL 代码 · 共 24 行

VHD
24
字号
library ieee;
use ieee.std_logic_1164.all;
entity sepratef is
    port(clk,sw:    in std_logic;  --1000hz
         clk125f:out std_logic);--8 or 4hz putout
end;

architecture behav of sepratef is 
    signal clk8hz:std_logic;
   
begin
  divideclk:process(clk,sw)
     variable ff, count125: integer range 0 to 255;
    begin

     clk8hz<='0'; clk125f<='0';
        if sw='0' then ff:=125;else ff:=250;
        end if;
     if count125>ff then clk8hz<='1'; clk125f<='1'; count125:=0;
     elsif clk'event and clk='1' then count125:=count125+1;
     end if;
  end process;
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?