【发布时间】:2014-02-25 21:19:34
【问题描述】:
我希望从我的 FPGA 生成一个小信号。我想通过我板上的立体声输出它。后者将充当简单的 DAC。下面是一个简单的 Verilog 程序,它应该会发出哔声,但不会。
module music(clk, speaker);
input clk;
output speaker;
// Binary counter, 16-bits wide
reg [15:0] counter;
initial
begin
counter = 0;
end
always @(posedge clk) counter <= counter+1;
// Use the most significant bit (MSB) of the counter to drive the speaker
assign speaker = counter[15];
endmodule
最终我想通过立体声输出输出一个非常低频的正弦波。 有没有关于如何做到这一点的示例代码......有什么想法吗?我正在使用 DE2i-150 板。谢谢!
【问题讨论】:
-
这不是“reg[15:0] counter;”吗?做?请提供代码。
-
时钟频率是多少?输出波形是否在可听频谱中?
-
时钟频率为25MHz,输出应为380Hz左右的方波信号。