This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Design Recipes for FPGAs Using Verilog and VHDL > Serial Communications > Manchester Encoding and Decoding

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Manchester Encoding and Decoding

FONT SIZE : AAA

Manchester encoding is a simple coding scheme that translates a basic bit stream into a series of transitions. It is extremely useful for ensuring that a specific bandwidth can be used for data transmission, as no matter what the sequence of the data bits, the frequency of the transmitted stream will be exactly twice the frequency of the original data. It also makes signal recovery trivial, because there is no need to attempt to extract a clock as the data can be recovered simply by looking for the edges in the data and extracting asynchronously. The basic approach to Manchester encoding is shown in Figure 15.1.

Another advantage of the scheme is that the method is highly tolerant of errors in the data; if an error occurs, then the subsequent data is not affected at all by an error in the transmitter, the medium or the receiver, and after the immediate glitch, the data can continue to be transmitted effectively without any need for error recovery. Of course, the original data can use some form of data coding to add in error correction (such as parity checks or cyclic redundancy check, CRC). If we wish to create a VHDL model for this type of coding scheme, it is actually relatively simple. The first step is to identify that we have a single data input (D) and a clock (CLK). Why synchronous? Using a synchronous clock we can define a sample on the rising edge of the clock for the data input and use BOTH edges of the clock to define the transitions on the output. The way we do this is simply to look for any event on the clk (clk’event) and then check whether the clk is high or low to determine whether the clk edge is rising or falling.

Manchester encoding scheme with XORpng

Figure 15.2 

Manchester encoding scheme with XOR.

This VHDL is simple but there is an even simpler way to encode the data and that is to simply XOR the clock with the data. If we look at the same data sequence as shown in Figure 15.1, we can see that if we add a clock, and observe the original data and the Manchester encoded output, this is simply the data XORd with the clock, as in Figure 15.2.

So, using this simple mechanism, we can create a much simpler Manchester encoder that XORs the clock and the data to obtain the resulting Manchester encoded data stream.

  • XC5VLX110T-2FF1136I

    Manufacturer:Xilinx

  • FPGA Virtex-5 LXT Family 110592 Cells 65nm Technology 1V 1136-Pin FCBGA
  • Product Categories: FPGAs

    Lifecycle:Active Active

    RoHS: No RoHS

  • XCV300-4FG456I

    Manufacturer:Xilinx

  • FPGA Virtex Family 322.97K Gates 6912 Cells 250MHz 0.22um Technology 2.5V 456-Pin FBGA
  • Product Categories: Portes logiques

    Lifecycle:Obsolete -

    RoHS:

  • XCV300-5BG432I

    Manufacturer:Xilinx

  • FPGA Virtex Family 322.97K Gates 6912 Cells 294MHz 0.22um Technology 2.5V 432-Pin BGA
  • Product Categories: Semiconducteurs & Actifs

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC2V2000-6FGG676C

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 2M Gates 24192 Cells 820MHz 0.15um Technology 1.5V 676-Pin FBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

  • XCS30XL-4TQ144Q

    Manufacturer:Xilinx

  • Xilinx TQFP144
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS: -

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.