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

📄 system.vhd

📁 多功能电子琴 可以实现人性化界面 同时可以根据按键选择播放模式
💻 VHD
字号:
--*****System
--*****
--*****
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

package ram_pack is
    subtype ram_word is integer range 0 to 31;
    subtype ram_range is integer range 0 to 127;
    type RAM_TYPE is array(ram_range)of ram_word;
end ram_pack;

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use work.ram_pack.all;

entity System is
	port(
	    choose : in std_logic;
		Clk_20M:in std_logic;	--20M时钟,用于分频
		Clk_10:in std_logic;	--记录按键时间时钟,取10HZ
		Ctrl:in std_logic_vector(2 downto 0);	--模式选择控制,用S1拨盘实现
		High:in std_logic;	--高音输入控制信号,用SW12实现
		Low:in std_logic;	--低音输入控制信号,用SW7实现
		Fast:in std_logic;--快速播放音乐
		Slow:in std_logic;--慢速播放音乐
		Col:inout std_logic_vector(3 downto 0);	--键盘扫描列信号,同管脚中的kin信号,为input信号
		Row:out std_logic_vector(3 downto 0);	--键盘扫描行信号,同管脚中的scan信号,作为输出信号
		Key_Leds:out std_logic_vector(7 downto 0);	--输出音阶的LED显示
		Audio:out std_logic;	--音频输出信号
	    Dout:out std_logic_vector(6 downto 0);	--数码管数据信号
		Leds:out std_logic_vector(5 downto 0)	--数码管选通信号
		);
end System;

architecture code of System is

component Hand_Play is
	port(
        choose : in std_logic;
		clk_10:in std_logic;--10HZ时钟
		clk_20 : in std_logic;--20M时钟
		high:in std_logic;--高音输入控制信号
		low:in std_logic;--低音输入控制信号
		fast: in std_logic;--快速播放音乐
		slow: in std_logic;--慢速播放音乐
		Ctrl:in std_logic_vector(2 downto 0);		
		row:out std_logic_vector(3 downto 0);--键盘扫描行信号,同管脚中的scan信号,作为输出信号
		col:inout std_logic_vector(3 downto 0);--键盘扫描列信号,同管脚中的kin信号,为input信号
		audio:out std_logic;--音频输出信号
		Dout:out std_logic_vector(6 downto 0);	--数码管数据信号
		Leds:out std_logic_vector(5 downto 0);	--数码管选通信号
		Key_Leds:out std_logic_vector(7 downto 0)	--输出音阶的LED显示
		);
end component;

begin
	U1:Hand_Play port map(choose,Clk_10,Clk_20M,High,Low,Fast,Slow,Ctrl,Row,Col,Audio,Dout,Leds,Key_Leds); --手动播放模块
end code;

⌨️ 快捷键说明

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