热心网友
回答时间:2023-07-11 02:17
mole shift_reg8(clk, ldn, d, k, q)
input clk;
input ldn, k;
input [7:0]d;
output [7:0]q;
always@(posedge clk or ldn)
begin
if(ldn == 1'b0)
q <= d;
else
if(k == 1'b0)
q <= {q[6:0], 1'b0};
else
q <= {1'b0, q[7:1]};
end
endmodle
收起
热心网友
回答时间:2023-07-11 02:17
mole (clk,ldn,d,k,q);
input clk;
input ldn;
input k;
input [7:0] d;
output [7:0] q;
reg [7:0] q;
always @ (posedge clk or negedge ldn)
begin
if (!ldn)
q <= d[7:0];
else
begin
if (k)
q <= {1'b0, q[7:1]};
else
q <= {q[6:0], 1'b0};
end
end
endmole
收起
热心网友
回答时间:2023-07-11 02:18
mole (clk, ldn, d, k, q);
input clk;
input ldn;
input [7:0] d;
input k;
output [7:0] q;
reg [7:0] q;
always @ (posedge clk or negedge ldn) begin
if (~ldn)
q <= d[7:0];
else
if (k)
q <= {1'b0, q[7:1]};
else
q <= {q[6:0], 1'b0};
end
endmole
本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。
收起