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

📄 tone.vhd

📁 本源码设计了自动电子琴
💻 VHD
字号:
library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_ARITH.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 
entity tone is 
Port ( index : in std_logic_vector(7 downto 0);      
code  : out std_logic_vector(6 downto 0);           
high   : out std_logic;                                            
tone0 : out integer range 0 to 16383);                    
end tone; 
architecture Behavioral of tone is 
begin 
search :process(index)      

begin 
case index is  
when "11111110" => tone0<=4917;code<="1001111";high<='0';
when "11111101" => tone0<=6168;code<="0010010";high<='0';
when "11111011" => tone0<=7283;code<="0000110";high<='0';
when "11110111" => tone0<=7794;code<="1001100";high<='0';

when "11101111" => tone0<=8731;code<="0100100"; high<='0';
when "11011111" => tone0<=9566;code<="0100000";high<='0';
when "10111111" => tone0<=10310;code<="0001111";high<='0';
when "01111111" => tone0<=10651;code<="0000000"; high<='1';
 
when   others   => tone0<=16383;code<="0000001";high<='0';
end case; 
end process; 
end Behavioral;


⌨️ 快捷键说明

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