乐曲硬件演奏电路设计(18)
发布时间:2021-06-11
发布时间:2021-06-11
乐曲演奏广泛用于自动答录装置、手机铃声、集团电话、及智能仪器仪表设备。实现方法有许多种,随着FPGA集成度的提高,价格下降,EDA设计工具更新换代,功能日益普及与流行,使这种方案的应用越来越多。如今的数字逻辑设计者面临日益缩短的上市时间的压力,不得不进行上万门的设计,同时设计者不允许以牺牲硅的效率达到保持结构的独特性。使用现今的EDA软件工具来应付这些问题,并不是一件简单的事情。FPGA预装了很多已构造好的参数
END ENTITY Songer;
ARCHITECTURE one OF Songer IS
COMPONENT NoteTabs
PORT (clk: IN STD_LOGIC;
ToneIndex: OUT STD_LOGIC_VECTOR (3 DOWNTO 0));
END COMPONENT;
COMPONENT ToneTaba
PORT (Index: IN STD_LOGIC_VECTOR (3 DOWNTO 0);
CODE: OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
HIGH: OUT STD_LOGIC;
Tone: OUT STD_LOGIC_VECTOR (10 DOWNTO 0));
END COMPONENT;
COMPONENT Speakera
PORT (clk: IN STD_LOGIC;
Tone: OUT STD_LOGIC_VECTOR (10 DOWNTO 0);
SpkS: out STD_LOGIC);
END COMPONENT;
SIGNAL Tone: STD_LOGIC_VECTOR (10 DOWNTO 0);
SIGNAL ToneIndex: STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
u1: NoteTabs PORT MAP(clk=>CLK8HZ,ToneIndex=>ToneIndex);
u2:ToneTabaPORTMAP(Index=>ToneIndex,Tone=>Tone,CODE=>CODE1,HIGH=>HIGH
1);
u3:SpeakeraPORTMAP(clk=>CLK12MHZ,Tone=>TONE,SpkS=>SPKOUT);