8位并行输入串行输出的移位寄存器的Verilog描述
1 Verilog描述
module shift_p2s(
input clk,
input [7:0] din,
input load,
output reg q
);
reg [7:0] tmp;
[email protected](posedge clk)begin
if(load == 1'b1)
tmp <= din;
else begin
q <= tmp[7];
tmp <= {tmp[6:0],1'b0};
end
end
endmodule
2 RTL视图
3 功能仿真