- 7
- 0
- 约6.67千字
- 约 6页
- 2017-08-20 发布于重庆
- 举报
vhdl语言 电子琴程序设计-仿真
电子琴程序设计------仿真
顶层程序与仿真,音阶发生器程序与仿真,数控分频模块程序与仿真,自动演奏模块程序与仿真设计例见随书所附光盘中文件:8.17电子琴VHDL程序与仿真。
1.顶层程序与仿真
(1)顶层VHDL程序
--文件名:top.vhd
--功能:顶层文件
--最后修改日期:2004.3.20
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity top is
Port ( clk32MHz :in std_logic; --32MHz系统时钟
handTOauto : in std_logic; --键盘输入/自动演奏
code1 :out std_logic_vector(6 downto 0); --音符显示信号
index1 :in std_logic_vector(7 downto 0); --键盘输入信号
high1 :out std_logic; --高低音节信号
spkout :out std_logic); --音频信号
end top;
architecture Behavioral of top is
component automusic
Port ( clk :in std_logic;
Auto: in std_logic;
index2:in std_logic_vector(7 downto 0);
index0 : out std_logic_vector(7 downto 0));
end component;
component tone
Port ( index : in std_logic_vector(7 downto 0);
code : out std_logic_vector(6 downto 0);
high : out std_logic;
tone0 : out integer range 0 to 2047);
end component;
component speaker
Port ( clk1 : in std_logic;
tone1 : in integer range 0 to 2047;
spks : out std_logic);
end component;
signal tone2: integer range 0 to 2047;
signal indx:std_logic_vector(7 downto 0);
begin
u0:automusic port map(clk=clk32MHZ,index2=index1,index0=indx,Auto=handtoAuto);
u1: tone port map(index=indx,tone0=tone2,code=code1,high=high1);
u2: speaker port map(clk1=clk32MHZ,tone1=tone2,spks=spkout);
end Behavioral;
(2)仿真
顶层文件仿真图如图8.17.2所示。
图8.17.2 顶层文件仿真图
2. 音阶发生器程序与仿真
音阶发生器VHDL程序
--文件名:tone.vhd。
--功能:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity tone is
Port ( index : in std_logic_vector(7 downto 0); --音符输入信号
code : out std_logic_vector(6 downto 0); --音符显示信号
high : out std_logic; --高低音显示信号
tone0 : out integer range 0 to 2047); --
您可能关注的文档
- 《数据库系统原理与应用(sql_server_2000)》考试题.doc
- 《现代分析测试技术》复习知识点.doc
- 《械设计基础》理论教学内容及教学基本要求.doc
- 《金相分析技术》课程标准.doc
- 《无机材料合成与制备》 论文翻译.doc
- 【先学后教新思路】2014高考物理教与学经典组合【学案】+【教案】学案28 电势能与电势差.doc
- 【选修三教案】3-1晶体常识(新人教版精品).doc
- 01_2009年10月(工程力学与机械设计).doc
- 1~35kv低烟无卤阻燃a级耐火低压电缆通用技术规范书.doc
- 2科研选题的案例分析.docx
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
最近下载
- 罗伯特·S.平狄克-微观经济学(第九版)PindyckPPT_Ch.6.pptx VIP
- 罗伯特·S.平狄克-微观经济学(第九版)PindyckPPT_Ch.5.pptx VIP
- DB14T 1098-2024奶牛规模养殖技术规程.pdf VIP
- 《卫生微生物学检验》课件——04-化妆品中铜绿假单胞菌的检测.pptx VIP
- 2025年春顶尖课课练八年级物理下册沪科版答案.pdf VIP
- 罗伯特·S.平狄克-微观经济学(第九版)PindyckPPT_Ch.4.pptx VIP
- 青岛酒店管理职业技术学院单招《数学》模拟试题附答案详解【预热题】.docx VIP
- 古诗江上渔者.pptx VIP
- 罗伯特·S.平狄克-微观经济学(第九版)PindyckPPT_Ch.3.pptx VIP
- (2026春新版)人教版三年级数学下册全册教案.pdf
原创力文档

文档评论(0)