这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » FPGA » basys2 设计电子琴 必须用到ad吗?怎么外接ad?

共3条 1/1 1 跳转至

basys2 设计电子琴 必须用到ad吗?怎么外接ad?

菜鸟
2014-04-11 22:40:23     打赏
basys2 设计电子琴 必须用到ad吗?

 

求这段音频发生器代码解析

entity tone is
port(
index1:in std_logic_vector(5 downto 0);
index2:in std_logic_vector(5 downto 0);
div1:out integer range 0 to 131072;
div2:out integer range 0 to 131072);
end tone;


architecture Behavioral of tone is
begin
process(index1)
begin
case index1 is
when"000000"=>div1<=1;
when"000001"=>div1<=1493;
when"000010"=>div1<=1330;
when"000011"=>div1<=1185;
when"000100"=>div1<=1119;
when"000101"=>div1<=997;
when"000110"=>div1<=888;
when"000111"=>div1<=791;
when"010001"=>div1<=746;
when"010010"=>div1<=665;
when"010011"=>div1<=593;
when"010100"=>div1<=559;
when"010101"=>div1<=498;
when"010110"=>div1<=444;
when"010111"=>div1<=395;
when"100001"=>div1<=373;
when"100010"=>div1<=333;
when"100011"=>div1<=296;
when"100100"=>div1<=280;
when"100101"=>div1<=249;
when"100110"=>div1<=222;
when"100111"=>div1<=198;
when others=>null;
end case;
end process;


process(index2)
begin
case index2 is
when"000000"=>div2<=1;
when"000001"=>div2<=1493;
when"000010"=>div2<=1330;
when"000011"=>div2<=1185;
when"000100"=>div2<=1119;
when"000101"=>div2<=997;
when"000110"=>div2<=888;
when"000111"=>div2<=791;
when"010001"=>div2<=746;
when"010010"=>div2<=665;
when"010011"=>div2<=593;
when"010100"=>div2<=559;
when"010101"=>div2<=498;
when"010110"=>div2<=444;
when"010111"=>div2<=395;
when"100001"=>div2<=373;
when"100010"=>div2<=333;
when"100011"=>div2<=296;
when"100100"=>div2<=280;
when"100101"=>div2<=249;
when"100110"=>div2<=222;
when"100111"=>div2<=198;
when others=>null;
end case;
end process;
end Behavioral;

想知道  1493 到198这些具体数是怎么算出来的  



工程师
2014-04-12 14:52:33     打赏
2楼
稍等,有人来回答

工程师
2014-04-12 14:53:01     打赏
3楼

稍等,正在联系版主回答问题


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]