`timescale 1ns/1ns
module huawei7(
input wire clk ,
input wire rst ,
output reg clk_out
);
//*************code***********//
reg [2:0]state;
reg [2:0]nx_state;
always @ (posedge clk or negedge rst) begin
if (!rst)
state<=0;
else state<=nx_state;
end
always @ (*) begin
case(state)
0:nx_state<=1;
1:nx_state<=2;
2:nx_state<=3;
3:nx_state<=4;
4:nx_state<=1;
endcase
end
always @ (*) begin
clk_out=state==1;
end
//*************code***********//
endmodule
module huawei7(
input wire clk ,
input wire rst ,
output reg clk_out
);
//*************code***********//
reg [2:0]state;
reg [2:0]nx_state;
always @ (posedge clk or negedge rst) begin
if (!rst)
state<=0;
else state<=nx_state;
end
always @ (*) begin
case(state)
0:nx_state<=1;
1:nx_state<=2;
2:nx_state<=3;
3:nx_state<=4;
4:nx_state<=1;
endcase
end
always @ (*) begin
clk_out=state==1;
end
//*************code***********//
endmodule