Integer-Input RS Encoder HDL Optimized

Encode data using a Reed-Solomon encoder

Library

Block sublibrary of Error Correction and Detection

Description

Reed-Solomon encoding follows the same standards as any other cyclic redundancy code. The Integer-Input RS Encoder HDL Optimized block can be used to model many communication system Forward Error Correcting (FEC) codes.

For more about the Reed-Solomon encoder, see the Integer-Input RS Encoder block reference. For more information on representing data for Reed-Solomon codes, see Integer Format (Reed-Solomon Only).

Signal Attributes

The Integer-Input RS Encoder HDL Optimized block has four input ports and four output ports.

PortDirectionDescriptionData Type
datainInputMessage data, one symbol at a time.Integer or fixdt() with any binary point scaling. Doubles are allowed for simulation but not for HDL code generation.
startInputIndicates the start of a frame of data. Boolean or fixdt(0,1)
endInputIndicates the end of a frame of data. Boolean or fixdt(0,1)
validInputIndicates that input data is valid. Boolean or fixdt(0,1)
dataoutOutputMessage data with the checksum appended. The data type is the same as datain. Same as datain
startoutOutputIndicates the start of a frame of data. Boolean or fixdt(0,1)
endoutOutputIndicates the end of a frame of data, including checksum. Boolean or fixdt(0,1)
validoutOutputIndicates that output data is valid. Boolean or fixdt(0,1)

Limitations

  • The length of the code word N must be less than 2^16-1. The number of parity symbols N-K must be a positive even integer. A shortened code is inferred anytime the number of input data samples is less than 2^M-1 for M between 3 and 16.

  • The generator polynomial is not specified explicitly. However, it is defined by the code word length, the message length, and the B value for the starting exponent of the roots. To get the value of B from a generator polynomial, use the genpoly2b function.

  • For HDL code generation, the block does not handle double-precision floating point data type numbers. You can simulate using double-precision values, but if you attempt HDL code generation, you receive a error message.

Block Dialog

Integer-Input RS Encoder HDL Optimized Block Mask, Default View

Integer-Input RS Encoder HDL Optimized Block Mask, Expanded View

Codeword length

The codeword length.

Message length

The message length.

Source of primitive polynomial

Select Property to enable the Primitive polynomial parameter.

Primitive polynomial

Binary row vector representing the primitive polynomial in descending order of powers. When you provide a primitive polynomial, the number of input bits must be an integer multiple of K times the order of the primitive polynomial instead.

This parameter applies when only when Property is selected for Primitive polynomial.

Source of puncture pattern

Select Property to enable the Puncture pattern vector parameter.

Puncture pattern vector

A column vector of length N-K. In a puncture vector, 1 represents that the data symbol passes unaltered. The value 0 represents that the data symbol is punctured, or removed from the data stream.

The default value is [ones(2,1); zeros(2,1)].

This field is available only when Property is selected for Source of puncture pattern.

Source of B, the starting power for roots of the primitive polynomial

Select Property to enable the B value parameter.

B value

The starting exponent of the roots.

This field is available only when you select Property for Source of B, the starting power for roots of the primitive polynomial.

Simulate using

Type of simulation to run. This parameter does not affect generated HDL code.

  • Code generation (default)

    Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster simulation speed than Interpreted execution.

  • Interpreted execution

    Simulate model using the MATLAB® interpreter. This option shortens startup time but has slower simulation speed than Code generation.

Algorithm

Timing Diagram

HDL Code Generation

This block supports HDL code generation using HDL Coder™. HDL Coder provides additional configuration options that affect HDL implementation and synthesized logic. For more information on implementations, properties, and restrictions for HDL code generation, see Integer-Input RS Encoder HDL Optimized in the HDL Coder documentation.

Was this topic helpful?