always @(posedge i_clk ornegedge i_rstn) begin if(i_rstn == `rst)begin end elsebegin case(tag) 0:begin if(i_en)begin p <= {32'b0,B,1'b0}; finish<=0; cnt<=0; tag<=1; end end 1:begin cnt <= cnt + 1; p <= {ph[31],ph,p[32:1]}; if(cnt == 31)begin//这里是并行判断 tag <=2; finish<=1; end end 2:begin tag<=0; finish<=0; end endcase end end
assign o_finish = finish; assign Y = p[64:1]; endmodule