// tone.v
// tone generator
// divide the processor clock by 2048 to get ~850Hz tone
//
// (c) 2017 David R. Hunter
//
// Revisions:
// 	1		08/20/17		DH	- initial version
//
module tone(clock,enable,tone_out);
	input		clock;
	input		enable;
	output	tone_out;
	
	reg 	[10:0]counter;
	
	always @(posedge clock)
	begin
		if (enable == 0)
			counter <= 11'd0;
		else
			counter <= counter + 11'd1;

	end
	
	assign tone_out = enable ? counter[10] : 1'b0;
	
endmodule
