用一个数据存储序列,不断移位,然后一直发送某一位,感觉代码更简单一点。 `timescale 1ns/1ns module sequence_generator( input clk, input rst_n, output reg data ); reg [5:0] q; always@(posedge clk or negedge rst_n) if (!rst_n) q <= 6'b001011; else q <= {q[4:0],q[5]}; always@(posedge clk or negedge rst_n) if (!rst_n) data <= 1'd...