FPGA设计曼彻斯特编解码Verilog源代码
module md (rst,clk16x,mdi,rdn,dout,data_ready) ;
input rst ;
input clk16x ;
input mdi ;
input rdn ;
output [7:0] dout ;
output data_ready ;
reg clk1x_enable ;
reg mdi1 ;
reg mdi2 ;
reg [7:0] dout ;
reg [3:0] no_bits_rcvd ;
reg [3:0] clkdiv ;
reg data_ready ;
wire clk1x ;
reg nrz ;
wire sample ;
reg [7:0] rsr ;
// Generate 2 FF register to accept serial Manchester data in
always @(posedge clk16x or posedge rst)
begin
if (rst)
begin
mdi1 <= 1'b0 ;
mdi2 <= 1'b0 ;
end
el