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

📄 music.vhd

📁 一个使用VHDL编写的音乐芯片的程序有很好的使用价值
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
entity music is
    port(clk20mhz :in std_logic;
         clk1000hz:in std_logic;
         sw       :in std_logic;
         spkout   :out std_logic); 
end;

architecture behav of music is
  component sepratef
    port(clk,sw:     in std_logic;
         clk125f: out std_logic);
  end component;

  component rhythmer
    port(clk:     in std_logic;
         tonecode:out integer range 0 to 21);
  end component;

  component tonetaba
    port(tonecodein:  in integer range 0 to 21;
         musicfreqout:out integer range 0 to 2047);
  end component;

  component speakera
    port(clk:        in std_logic;
         musicfreqin:in integer range 0 to 2047;
         spks:       out std_logic);
  end component;
  signal clk125f:std_logic;
  signal musicfreqin,musicfreqout: integer range 0 to 2047;
  signal tonecode:  integer range 0 to 21;
begin
u0:sepratef port map(clk=>clk1000hz,sw=>sw,clk125f=>clk125f);
u1:rhythmer port map(clk=>clk125f,tonecode=>tonecode);
u2:tonetaba port map(tonecodein=>tonecode,musicfreqout=>musicfreqout);
u3:speakera port map(clk=>clk20mhz,musicfreqin=>musicfreqout,spks=>spkout);
end;

⌨️ 快捷键说明

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