I'm looking to generate a small signal from my FPGA. I'd like to output it through the stereo out on my board. The latter would act as a simple DAC. The following is a simple Verilog program that should play a beep but does not.
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
Ultimately I'd like to output a very low frequency sinusoidal wave through the stereo out. Is there any example code on how to do this...any ideas? I'm using a DE2i-150 board. Thanks!