求教!我的解调程序为什么没有输出啊?
时间:10-02
整理:3721RD
点击:
先献上代码fsk解调逻辑上没有错啊
求教仿真时dout为什么没有啊
module fsk_m(clk,din,start,dout
);
input clk,start;
input din;
output dout;
reg dout;
reg[3:0] cnt;
reg[2:0] count;
reg eoc;
always@(posedge clk)
begin
if(!start)begin
cnt<=0;
eoc<=0;
end
else
begin
if(cnt==4'b1011)
begin
cnt<=0;
eoc<=1;
end
else
begin
cnt<=cnt+1;
eoc<=0;
end
end
end
always@(posedge din or posedge eoc)
begin
if(eoc)
count<=0;
else
count<=count+1;
end
always@(posedge count or posedge cnt)
begin
if(cnt==4'b1010)
begin
if(count>=3'b011)
dout<=1;
else
dout<=0;
end
end
endmodule
求教仿真时dout为什么没有啊
module fsk_m(clk,din,start,dout
);
input clk,start;
input din;
output dout;
reg dout;
reg[3:0] cnt;
reg[2:0] count;
reg eoc;
always@(posedge clk)
begin
if(!start)begin
cnt<=0;
eoc<=0;
end
else
begin
if(cnt==4'b1011)
begin
cnt<=0;
eoc<=1;
end
else
begin
cnt<=cnt+1;
eoc<=0;
end
end
end
always@(posedge din or posedge eoc)
begin
if(eoc)
count<=0;
else
count<=count+1;
end
always@(posedge count or posedge cnt)
begin
if(cnt==4'b1010)
begin
if(count>=3'b011)
dout<=1;
else
dout<=0;
end
end
endmodule
呵呵,代码有这样写的吗?对计数器采沿
那应该怎样写啊
