// Save it as clk_divider.v // At this time you do not need to know how this divider works! // You will become familiar with it in the lab #7 module clock_divider ( cin, cout ); input cin; output cout; parameter timeconst = 60;//constant integer count0; integer count1; integer count2; integer count3; reg d; reg cout; always @ (posedge cin ) // begin begin begin count0 <= (count0 + 1); if ((count0 == timeconst)) begin count0 <= 0; count1 <= (count1 + 1); end else if ((count1 == timeconst)) begin count1 <= 0; count2 <= (count2 + 1); end else if ((count2 == timeconst)) begin count2 <= 0; count3 <= (count3 + 1); end else if ((count3 == timeconst)) begin count3 <= 0; d <= ~ (d); end end cout <= d; end // end always endmodule