Shift Left (shift_left_xs)
Left shift all input sample values.
Design
Separately left shifts the bit values of the real and imaginary values of a complex value. Lower bit positions are padded with zeros. Equivalent to a multiplication by a power of 2.
The mathematical representation of the implementation is given in (97).
In (97):
\(x[n]\) is the input values.
\(y[n]\) is the output values.
\(N\) is the number of bits the input is left shifted by.
A block diagram representation of the implementation is given in Figure 144:.
Figure 144: Shift left implementation.
The real and imaginary inputs are treated as separate value streams (i.e. (97) / Fig. 144 will be implemented twice within the component, once for the real values and a second time for the imaginary values).
Interface
<?xml version="1.0"?>
<componentspec>
<property name="shift" type="uchar" parameter="true" default="1" writable="false" description="Number of bit positions input values will be left shifted by."/>
<port name="input" producer="false" protocol="complex_short_timed_sample-prot"/>
<port name="output" producer="true" protocol="complex_short_timed_sample-prot"/>
</componentspec>
Ports
Inputs:
input: Primary input samples port.Protocol:
complex_short_timed_sample-protOptional:
False
Outputs:
output: Primary output samples port.Protocol:
complex_short_timed_sample-protOptional:
False
Opcode Handling
Only values in a sample opcode message are left shifted. All other opcodes messages received are passed through this component without any effect.
Properties
shift: Number of bit positions input values will be left shifted by.Type:
ucharAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
False
Default value:
1
Implementations
Example Application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="shift_left_xs">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.math.shift_left_xs" connect="file_write">
<property name="shift" value="3"/>
</instance>
<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 shift_left_xs are:
None.
Testing
Tested platforms: None
Component testing not completed.