Negator (negator_s)
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 (76).
In (76):
\(x[n]\) is the input values.
\(y[n]\) is the output values.
A block diagram representation of the implementation is given in Figure 65:.
Figure 65: Negator implementation.
Interface
<?xml version="1.0"?>
<componentspec>
<port name="input" producer="false" protocol="short_timed_sample-prot"/>
<port name="output" producer="true" protocol="short_timed_sample-prot"/>
</componentspec>
Ports
Inputs:
input: Primary input samples port.Protocol:
short_timed_sample-protOptional:
False
Outputs:
output: Primary output samples port.Protocol:
short_timed_sample-protOptional:
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.
Parameters
Example application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="negator_s">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.math.negator_s" 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_s are:
The negation does not handle overflows caused by a full scale negative values being negated
Testing
Component testing not completed.