您的位置:首页 > 其它

【原创】基于FPGA的等精度测频方法(学习实验)

2009-08-20 13:53 513 查看

【原创】基于FPGA的等精度测频方法(学习实验)

1、多周期等精度测频的时序
module mesureFreq (
input fx,
input fbase,
input fgate,
output reg[31:0] fxCnt,
output reg[31:0] fbaseCnt
);

reg startCnt;
reg[31:0] fxCntTemp,fbaseCntTemp;

always @ (posedge fbase) begin
if(startCnt)
fbaseCntTemp <= fbaseCntTemp + 1;
else
fbaseCntTemp <= 32'h00000000;
end

always @ (posedge fx) begin
if(startCnt)
fxCntTemp <= fxCntTemp + 1;
else
fxCntTemp <= 32'h00000000;
end

//synchronous fgate
always @ (posedge fx) begin
if(fgate)
startCnt <= 1'b1;
else
startCnt <= 1'b0;
end

//output
always @ (negedge startCnt) begin
fxCnt <= fxCntTemp;
fbaseCnt <= fbaseCntTemp;
end

endmodule
4、综合后逻辑电路


工程文件:/Files/lwpo2008/mesureFreq.rar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐