module data_rx (
input clk,
input data_en,
input data_in,
output reg [7:0] data
);
always @ (posedge clk) begin
if (data_en)
data <= {data[6:0], data_in}; // 使用位拼接符将新的串行数据添加到 data 中,左移一位
else
data <= data;
end
endmodule
module data_rx (
input clk,
input data_en,
input data_in,
output reg [7:0] data
);
always @ (posedge clk) begin
if (data_en)
data <= {data[6:0], data_in}; // 使用位拼接符将新的串行数据添加到 data 中,左移一位
else
data <= data;
end
endmodule