用Verilog HDL设计曼切斯特编码器
曼切斯特码:为一种时钟同步的编码技术,被物理层用来同步一个位流的时钟和数据,编码的规则为用01两位码表示0码,用10两位码表示1,用一个周期的正负对称方波来表0,反相波形为1;
E.G.Thomas规定1为高跳变到底,0为底跳变到高。
IEEE802.4规定1为低跳变到高,0为高跳变到低。`
参考https://blog.csdn.net/qq_41844618/article/details/107569177
// 10代表0,01代表1
// clk是 曼切斯特的两倍频率
module manqie(
input clk,
input rst_n,
input data,
output dataout);
reg start;
reg r0
always@(posedge clk or negedge rst_n)
if(!rst_n)
r0<=0;
else r0<=data;
always@(posedge clk or negedge rst_n)
if(!rst_n)
start<=0;
else if(r0^data)
start<=1;
reg flag;
always@(posedge clk or negedge rst_n)
if(!rst_n)
flag<=1;
if(start)
flag<=~flag;
assign dataout= start ? flag^data : 0 ;
endmodule
本文介绍了一种使用Verilog HDL设计曼切斯特编码器的方法。曼切斯特编码是一种时钟同步编码技术,用于同步位流的时钟和数据。编码规则将0表示为01,1表示为10,利用正负对称方波表示0,反相波形表示1。文章详细阐述了Verilog代码实现,并提供了完整的模块设计。
3538

被折叠的 条评论
为什么被折叠?



