tonetaba.vhd
来自「可以轻松实现秒表计数流水灯计数功能控制器」· VHDL 代码 · 共 33 行
VHD
33 行
library ieee;
use ieee.std_logic_1164.all;
entity tonetaba is
port(
index : in integer range 0 to 15;
code : out integer range 0 to 15;
tone : out integer range 0 to 16#7ff#); --"2047";
end tonetaba;
architecture behav of tonetaba is
begin
search:process(index)
begin
case index is
when 0=>tone<=2047; code<=0;
when 1=>tone<=773; code<=1;
when 2=>tone<=912; code<=2;
when 3=>tone<=1036; code<=3;
when 5=>tone<=1197; code<=5;
when 6=>tone<=1290; code<=6;
when 7=>tone<=1372; code<=7;
when 8=>tone<=1410; code<=1;
when 9=>tone<=1480; code<=2;
when 10=>tone<=1542; code<=3;
when 12=>tone<=1622; code<=5;
when 13=>tone<=1668; code<=6;
when 15=>tone<=1728; code<=1;
when others=>null;
end case;
end process;
end behav;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?