always@(posedge clk) begin if(reset) begin state <= idle; signal <= 1'bZ; end else case(state) idle: begin state <= state1; signal <= 1; end state1: begin signal <= 0; hold_10_clk(state2); end state2: begin signal <= 1; state <= state3; end state3: begin hold_10_clk(state4); //state <= state4;综合报告中采用两种方法资源使用几乎一样 signal <= 0; end state4: begin state <= state1; signal <= 1; end default: state <= idle; endcase end //----------------------------------------------------------------------------- //延时10个周期控制 task hold_10_clk; input [3:0]s; if(counter < 10) counter <= counter + 1; else begin counter <= 0; state <= s; end endtask //----------------------------------------------------------------------------- endmodule
用户153210 2014-12-28 00:01
用户1002534 2014-3-13 22:30
用户413491 2012-2-28 13:30