小弟自己编写的并串转换程序,可是输出总是0,各位大神帮忙看看这个程序是哪里有问题
always@(posedge clk or negedge rst)
begin
if(!rst)
begin
load<=1;
done<=0;
data_buf<=0;
sdata<=0;
end
else
begin
if(load)
begin
data_buf<=data_in;
sdata<=data_buf[15];
if(done)
begin
load<=0;
end
else
begin
if(count==14)
begin
count<=0;
done<=1;
end
else
begin
count<=count+1;
data_buf<=data_buf<<1;
end
end
end
else
begin
data_buf<=0;
end
end
end
assign sout=sdata;
|