不可以使用边缘检测来判定rise和down的状态,会出现以下问题。 `timescale 1ns/1ns module edge_detect( input clk, input rst_n, input a, output reg rise, output reg down ); reg rise_ray,down_ray; always@(posedge clk or negedge rst_n)begin if (~rst_n) begin rise <= 0; down <= 0; down_ray <= 0; rise_ray <= 0; end else b...