module Sync_dff_rising(clk_in,out_q);
input clk_in;
output out_q;
wire clck_5hz;
wire out_q;
clck_5hz(clk_in,clck_5hz);
dff_rising_edge utClk5hz(clck_5hz,out_q);
endmodule
module dff_rising_edge(clk_in,q);
input clk_in;
input sel;
output q;
reg sel;
reg q;
always @(posedge clk_in) begin
q <= sel;
end
endmodule
module clck_5hz(clk_in,clk_out);
input clk_in;
output clk_out;
reg clk_out;
reg [15:0] cnt;
initial begin
clk_out = 1'b0;
cnt = 16'd0;
end
always @ (posedge clk_out) begin
if(cnt == 16'd49) begin
clk_out = ~clk_out;
cnt <= 16'd0;
end
else
cnt <= cnt + 1'd1;
end
endmodule