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

📄 music_code.vhd

📁 本源码设计了自动电子琴
💻 VHD
字号:
library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_ARITH.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 
entity music_code 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 music_code; 
architecture one of music_code is 
begin 
process(index)      

begin 
case index is  
when "11111110" => tone0<=11467;code<="1001111";high<='0';
when "11111101" => tone0<=10216;code<="0010010";high<='0';
when "11111011" => tone0<=9101;code<="0000110";high<='0';
when "11110111" => tone0<=8590;code<="1001100";high<='0';

when "11101111" => tone0<=7653;code<="0100100"; high<='0';
when "11011111" => tone0<=6818;code<="0100000";high<='0';
when "10111111" => tone0<=6074;code<="0001111";high<='0';
when "01111111" => tone0<=5733;code<="0000000"; high<='1';
 
when   others   => tone0<=0;code<="0000001";high<='0';
end case; 
end process; 
end one;



⌨️ 快捷键说明

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