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

📄 music.vhd

📁 带获胜音乐的拔河游戏机
💻 VHD
字号:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

entity music is
	port(reset:in std_logic;							--重置
		 clk:in std_logic;								--1MHz
		 clk_5:in std_logic;							--5hz
		 music_begin:in std_logic;						--音乐开始
		 mus:out std_logic);							--蜂鸣输出
end music
;
architecture body_music of music is						

	component pulse 									--发声模块
		port(clk:in std_logic;							--1MHz
			 count:in integer range 0 to 1300;			--发生控制
			 mus:out std_logic);						--音乐输出
	end component;

	component table 									--乐谱模块
		port(reset:in std_logic;						--重置
		 	 clk_5:in std_logic;						--5hz
		 	 music_begin:in std_logic;					--音乐开始
			 count:out integer range 0 to 1300);		--发生控制
	end component;

	signal count :integer range 0 to 1300;
	begin
	u1:table port map(reset=>reset,clk_5=>clk_5,music_begin=>music_begin,count=>count);
	u2:pulse port map(clk=>clk,count=>count,mus=>mus);
	end body_music; 

⌨️ 快捷键说明

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