⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orgen.vhd

📁 本源码设计了自动电子琴
💻 VHD
字号:
library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_ARITH.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 
entity orgen is 
Port ( clk1   : in std_logic;                                         
	tone1 : in integer range 0 to 16383;                 
	spks   : out std_logic);
                                                   
end orgen;
architecture Behavioral of orgen is 
	signal  fullspks:std_logic; 
	signal c: std_logic; 
begin 
genspks:process(clk1,tone1)  
variable count11:integer range 0 to 16383 ; 
Begin 
     if clk1'event and clk1='1' then 
      if count11=16383 then       
        count11:=tone1;
        fullspks<='1';
     else count11:=count11+1;
          fullspks<='0'; 
      end if; 
   end if;
   
end process; 
delaysps:process(fullspks)
     
begin 
       if fullspks'event and fullspks='1' then 
        c<=not c;   
       end if;
 end process;
spks<=c; 
end Behavioral;

⌨️ 快捷键说明

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