tone.txt

来自「梁祝乐曲演奏电路设计」· 文本 代码 · 共 33 行

TXT
33
字号
library ieee;
use ieee.std_logic_1164.all;
entity tonetaba1 is
    port(index:in integer range 0 to 15;
       code:out integer range 0 to 15;
       high:out std_logic;
       tone:out integer range 0 to 16#7FF#);
end ;
architecture one of tonetaba1 is
begin   
   search :process(index)
   begin
      case index is
          when 0 =>tone<=2047;code<=0;high<='0';
          when 1 =>tone<=773; code<=1;high<='0';
          when 2 =>tone<=912; code<=2;high<='0';
          when 3 =>tone<=1036;code<=3;high<='0';
          when 5 =>tone<=1197;code<=5;high<='0';
          when 6 =>tone<=1290;code<=6;high<='0';
          when 7 =>tone<=1372;code<=7;high<='0';
          when 8 =>tone<=1410;code<=1;high<='1';
          when 9 =>tone<=1480;code<=2;high<='1';
          when 10 =>tone<=1542;code<=3;high<='1';
          when 12 =>tone<=1622;code<=5;high<='1';
          when 13 =>tone<=1668;code<=6;high<='1';
          when 15 =>tone<=1728;code<=1;high<='1';
          when others=>null;
      end case;
  end process;
end one;


⌨️ 快捷键说明

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