正在加载图片...
when 8=>tone_index<=3; when 137=>tone_index<=5; when 138=>tone_index<=0; when 139=>tone_index<=0;-- when others=>tone_index<=0: end case; end if; end process: process(tone_index) begin case tone_index is when0=>tone<="11111111111”: --no output when1=>tone<="01100000101": --773 … when15=>tone<="11011000000”:-1728 when others=>tone<="11111111111";--others:no output end case; end process; process(clk)-control the frequence of the speaker begin if(clk'event and clk='1')then if(tone_count=16#7ff#)then tone count<=tone; if(tone<2047)then spk<=not spk; end if: else tone_count<=tone_count+1; end if; end if; end process; end behave; 七、实验报告 1、了解乐曲节拍产生的过程,注意每一音符的节拍长短的变化是由什么控制的? 2、改变时钟频率,看乐曲有什么改变? 3、熟悉音乐编程的过程,填入新的乐曲。 4、将两个或多个乐曲演奏电路合二为一,以一开关控制,可选择演奏不同的乐曲。when 8=>tone_index<=3; …… when 137=>tone_index<=5; when 138=>tone_index<=0; when 139=>tone_index<=0;-- when others=>tone_index<=0; end case; end if; end process; process(tone_index) begin case tone_index is when 0=>tone<="11111111111"; --no output when 1=>tone<="01100000101"; --773 …… when 15=>tone<="11011000000"; --1728 when others=>tone<="11111111111"; --others:no output end case; end process; process(clk) --control the frequence of the speaker begin if(clk'event and clk='1') then if(tone_count=16#7ff#) then tone_count<=tone; if(tone<2047) then spk<=not spk; end if; else tone_count<=tone_count+1; end if; end if; end process; end behave; 七、实验报告 1、 了解乐曲节拍产生的过程,注意每一音符的节拍长短的变化是由什么控制的? 2、 改变时钟频率,看乐曲有什么改变? 3、 熟悉音乐编程的过程,填入新的乐曲。 4、 将两个或多个乐曲演奏电路合二为一,以一开关控制,可选择演奏不同的乐曲
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有