You are on page 1of 1

module shah_2(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 module shah(clk, speaker); input clk; output speaker; // Binary counter, 16-bits wide reg [15:0] counter; always @(posedge clk) counter <= counter+1; // Use the highest bit of the counter (MSB) to drive the speaker assign speaker = counter[15]; endmodule

# UCF for Digilint Inc. BASYS2 FPGA Board # # Created by UCF Generator on 10/28/2011 at 11:33 # BASYS2 Clock OSC NET clk LOC=B8; ### BASYS2 Discrete LEDs: NET speaker LOC=B6;

You might also like