always @(posedge clk ornegedge rst_n) begin if (!rst_n) begin clkCnt <= 4'd0; end elseif(clkCnt == (`clkOutPeriod - 1)) begin clkCnt <= 4'd0; end else begin clkCnt <= clkCnt + 4'd1; end end
always @(posedge clk ornegedge rst_n) begin if (!rst_n) begin clk_driver <= 1'd0; ADC_data <= 12'd0; end elseif(clkCnt == `clkOutPeriod/2-1) begin clk_driver <= 1'd1; ADC_data <= IO_data; end elseif(clkCnt == `clkOutPeriod-1) begin clk_driver <= 1'd0; ADC_data <= ADC_data; end else begin clk_driver <= clk_driver; ADC_data <= ADC_data; end end endmodule
always @(posedge clk ornegedge rst_n) begin if (!rst_n) begin clkCnt <= 4'd0; end elseif(clkCnt == (`clkOutPeriod - 1)) begin clkCnt <= 4'd0; end else begin clkCnt <= clkCnt + 4'd1; end end