module hour_counter(
					clk,
					EN,
					SW1,SW2,
					hour_data1,hour_data0,
					EO
					);

output [3:0] hour_data1,hour_data0;
output EO;
input  clk,EN;
input  SW1,SW2;

reg [3:0] hour_data1,hour_data0;
reg EO;

always @(posedge clk)
begin
  if(EN == 1'b1)
    begin
	  if((hour_data0 < 4'b1001)&&(hour_data1 < 4'b0010))
		hour_data0 <= hour_data0 + 4'b1;
	  else if((hour_data0 < 4'b0100)&&(hour_data1 == 4'b0010))
		hour_data0 <= hour_data0 + 4'b1;
	  else
	  begin
		hour_data0 <= 4'b0;
		EO <= 1'b0;
		if(hour_data1 < 4'b0010)
		  hour_data1 <= hour_data1 + 4'b1;
		else
		begin
		  hour_data1 <= 4'b0;
		  EO <= 1'b1;
		end
	  end
	end
end
endmodule