music_note_a_440hz.v

来自「基于FPGA的VHDL编程实现各种音频信号」· Verilog 代码 · 共 21 行

V
21
字号
// music_note_A_440HZ.v
/*8**********************************************************************
"A" note (440Hz)
Ok, better than a random frequency, why not try to get a 440Hz signal. That's 
the frequency of the "A" note.
Instead of dividing 25MHz by 65536, we need to divide by 56818. Here we go.

***************************************************************************/
module music_note_A_440HZ(
                          clk,
                          speaker
                         );
input clk;
output speaker;

reg [15:0] counter;
always @(posedge clk) if(counter==56817) counter <= 0; else counter <= counter+1;

assign speaker = counter[15];

endmodule 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?