Golay Encoder (golay_encoder_us_ul)

Takes 12 bit input data and encodes it into a Golay codeword.

Tested platforms include xsim, e31x.

Design

A Golay code is an error correcting code used for forward error correction in digital communications.

Given a unsigned short, the Golay encoder component looks at the 12 LSB bits and encodes it into a Golay codeword, placed in the LSB bits, using a Golay encoding algorithm (24 bit wide codeword if the extended Golay code is implemented or 23 bit wide codeword if the perfect Golay code is implemented).

A block diagram representation of Golay [24,12,8] is given in Figure 260:.

Block diagram outlining Golay [24,12,8].

Figure 260: Block diagram outlining Golay [24,12,8].

Interface

<?xml version="1.0"?>
<!-- This file is protected by Copyright. Please refer to the COPYRIGHT file
     distributed with this source distribution.

     This file is part of OpenCPI <http://www.opencpi.org>

     OpenCPI is free software: you can redistribute it and/or modify it under
     the terms of the GNU Lesser General Public License as published by the Free
     Software Foundation, either version 3 of the License, or (at your option)
     any later version.

     OpenCPI is distributed in the hope that it will be useful, but WITHOUT ANY
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
     more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this program. If not, see <http://www.gnu.org/licenses/>. -->
<componentspec>
  <port name="input" producer="false" protocol="ushort_timed_sample-prot"/>
  <port name="output" producer="true" protocol="ulong_timed_sample-prot"/>
</componentspec>

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: ushort_timed_sample-prot

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: ulong_timed_sample-prot

    • Optional: False

Opcode Handling

The Golay encoder encodes data with sample opcodes only.

All other opcodes pass through this component without any effect.

Properties

None.

Implementations

  • golay_encoder_us_ul (HDL)

    Implementation of a [24,12,8] Golay encoder.

Example Application

<?xml version="1.0"?>
<!-- This file is protected by Copyright. Please refer to the COPYRIGHT file
     distributed with this source distribution.

     This file is part of OpenCPI <http://www.opencpi.org>

     OpenCPI is free software: you can redistribute it and/or modify it under
     the terms of the GNU Lesser General Public License as published by the Free
     Software Foundation, either version 3 of the License, or (at your option)
     any later version.

     OpenCPI is distributed in the hope that it will be useful, but WITHOUT ANY
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
     more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this program. If not, see <http://www.gnu.org/licenses/>. -->
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="golay_encoder_us_ul">
    <property name="filename" value="input.bin"/>
    <property name="messagesize" value="16384"/>
    <property name="messagesinfile" value="true"/>
  </instance>
  <instance component="ocpi.comp.sdr.coding.golay_encoder_us_ul" connect="file_write">
    <property name="checkbits_mask" value="15"/>
  </instance>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependency (generated via gen_golay_codewords_rom.py) for this worker is:

  • golay_codewords_rom.vhd

There is also a dependency on:

  • ieee.std_logic_1164

  • ieee.numeric_std

  • ocpi.types.all

Limitations

Limitations of golay_encoder_us_ul are:

  • None.

Testing

This component test suite uses the OpenCPI unit test framework. The unit test sends all possible 12 bit sample data and checks that output data is the expected Golay codeword.

Tested platforms: None

Component testing not completed.