📄 tone_rom.vhd
字号:
--tone_rom
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity tone_rom_CtoG is
port (index: in std_logic_vector(3 downto 0);
code: out std_logic_vector(3 downto 0);
high: out std_logic_vector(3 downto 0);
tone: out std_logic_vector(10 downto 0));
end;
architecture one of tone_rom_CtoG is
signal index1:integer range 0 to 15;
signal tone1: integer range 0 to 16#7ff#;
signal code1: integer range 0 to 15;
begin
index1<=conv_integer(index);
tone<=conv_std_logic_vector(tone1,11);
code<=conv_std_logic_vector(code1,4);
search:process(index)
begin
case index1 is
when 0=>tone1<=2047; code1<=0; high<="0000";
when 1=>tone1<=773; code1<=1; high<="0000";
when 2=>tone1<=912; code1<=2; high<="0000";
when 3=>tone1<=1036; code1<=3; high<="0000";
when 4=>tone1<=1092; code1<=4; high<="0000";
when 5=>tone1<=1197; code1<=5; high<="0000";
when 6=>tone1<=1290; code1<=6; high<="0000";
when 7=>tone1<=1372; code1<=7; high<="0000";
when 8=>tone1<=1372; code1<=1; high<="0001";
when 9=>tone1<=1410; code1<=2; high<="0001";
when 10=>tone1<=1480; code1<=3; high<="0001";
when 11=>tone1<=1542; code1<=4; high<="0001";
when 12=>tone1<=1570; code1<=5; high<="0001";
when 13=>tone1<=1622; code1<=6; high<="0001";
when 14=>tone1<=1669; code1<=7; high<="0001";
when 15=>tone1<=1710; code1<=1; high<="0010";
when others => null;
end case;
end process;
end one;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -