本帖最后由 a5612433 于 2011-5-12 18:30 编辑
ise 编写的音乐曲演奏
module song(clk_6MHz,clk_4Hz,speaker,high,med,low);
input clk_6MHz,clk_4Hz;
output speaker;
output[3:0]high,med,low;
reg[3:0]high,med,low;
reg[13:0]divider,origin;
reg[9:0]counter;
reg speaker;
wire carry;
assign carry=(divider==16383);
[email=always@(posedge]always@(posedge[/email] clk_6MHz);
begin if(carry)divider<=origin;
else divider<=divider+1;
end
[email=always@(posedge]always@(posedge[/email] carry)
begin speaker<=~speaker;end
[email=always@(posedge]always@(posedge[/email] clk_4Hz)
begin
case({high,med,low})
'b000000000011: origin<=7281;
'b000000000101: origin<=8730;
'b000000000110: origin<=9565;
'b000000000111: origin<=10310;
'b000000010000: origin<=10647;
'b000000100000: origin<=11272;
'b000000110000: origin<=11831;
'b000001010000: origin<=12556;
'b000001100000: origin<=12974;
'b000100000000: origin<=13516;
'b000000000000: origin<=16383;
endcase
end
[email=always@(posedge]always@(posedge[/email] clk_4Hz)
begin
if(counter==64) counter<=0;
else counter<=counter+1;
case(counter)
{high,med,low}<='b000000010000;//wo
{high,med,low}<='b000000010000;//you
{high,med,low}<='b000000010000;//yi
{high,med,low}<='b000000110000;//zhi
{high,med,low}<='b000001010000;//xiao
{high,med,low}<='b000001010000;//mao
{high,med,low}<='b000001010000;//lv
{high,med,low}<='b000001010000;//wo
{high,med,low}<='b000001100000;//cong
{high,med,low}<='b000001100000;//lai
{high,med,low}<='b000001100000;//ye
{high,med,low}<='b000100000000;//bu
{high,med,low}<='b000001010000;//qi
{high,med,low}<='b000001010000;
{high,med,low}<='b000001010000;
{high,med,low}<='b000001010000;
{high,med,low}<='b000001000000;//you
{high,med,low}<='b000001000000;//yi
{high,med,low}<='b000001100000;//tian
{high,med,low}<='b000001100000;//wo
{high,med,low}<='b000000110000;//xin
{high,med,low}<='b000000110000;//xue
{high,med,low}<='b000000110000;//lai
{high,med,low}<='b000000110000;//chao
{high,med,low}<='b000000100000;//qi
{high,med,low}<='b000000100000;//zhe
{high,med,low}<='b000000100000;//qu
{high,med,low}<='b000000100000;//gan
{high,med,low}<='b000001010000;//ji
{high,med,low}<='b000001010000;
{high,med,low}<='b000001010000;
{high,med,low}<='b000001010000;//wo
{high,med,low}<='b000000010000//shou
{high,med,low}<='b000000010000//li
{high,med,low}<='b000000010000//na
{high,med,low}<='b000000110000//zhe
{high,med,low}<='b000001010000//xiao
{high,med,low}<='b000001010000//pi
{high,med,low}<='b000001010000//bian
{high,med,low}<='b000001010000//wo
{high,med,low}<='b000001100000//xin
{high,med,low}<='b000001100000//li
{high,med,low}<='b000001100000//zheng
{high,med,low}<='b000100000000//de
{high,med,low}<='b000001010000//yi
{high,med,low}<='b000001010000
{high,med,low}<='b000001010000
{high,med,low}<='b000001010000
{high,med,low}<='b000001000000//bu
{high,med,low}<='b000001000000//zhi
{high,med,low}<='b000001000000//zen
{high,med,low}<='b000001100000//di
{high,med,low}<='b000000110000//la
{high,med,low}<='b000000110000//la
{high,med,low}<='b000000110000//la
{high,med,low}<='b000000110000//wo
{high,med,low}<='b000000100000//shuai
{high,med,low}<='b000000100000//le
{high,med,low}<='b000000100000//yi
{high,med,low}<='b000000100000//shen
{high,med,low}<='b000000010000//ni
{high,med,low}<='b000000010000
{high,med,low}<='b000000010000
{high,med,low}<='b000000010000
endcase
end
endmodule
有错误跑不通
另求
运用专用集成电路设计方法(ASIC),完成基于SMIC .18工艺的能够
播放单音音乐的数模混合芯片设计。本芯片外部输入为VDD、VSS,分别
连接电源正负极;输出为SPK,连接扬声器。
具体内容为:a.乐曲演奏芯片数字部分设计;b.上电复位电路的设计;
c.时钟产生电路的设计;d.混合集成电路仿真验证;e.混合版图设计与验证。
这个是要求 上电复位电路 和 时钟产生电路 谁能帮设计下 |