Negator (negator_l)

Multiplies input values by \(-1\).

Design

Multiplies input values by \(-1\), to change the sign of the values.

The mathematical representation of the implementation is given in (111).

(111)\[y[n] = -x[n]\]

In (111):

  • \(x[n]\) is the input values.

  • \(y[n]\) is the output values.

A block diagram representation of the implementation is given in Figure 150:.

Block diagram outlining negator implementation.

Figure 150: Negator implementation.

Interface

<?xml version="1.0"?>
<componentspec>
  <port name="input" producer="false" protocol="long_timed_sample-prot"/>
  <port name="output" producer="true" protocol="long_timed_sample-prot"/>
</componentspec>

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: long_timed_sample-prot

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: long_timed_sample-prot

    • Optional: False

Opcode Handling

Only values in a sample opcode message are multiplied by \(-1\). All other opcodes messages received are passed through this component without any effect.

Properties

None.

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="negator_l">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.math.negator_l" connect="file_write"/>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

  • None

There is also a dependency on:

  • ieee.std_logic_1164

  • ieee.numeric_std

Limitations

Limitations of negator_l are:

  • The negation does not handle overflows caused by a full scale negative values being negated

Testing

Tested platforms: None

Component testing not completed.