Bit Stuffer (bit_stuffer_b)
Zero insertion bit stuffer.
Design
Bit stuffing is the insertion of non-information bits into binary data. It has various purposes, such as to alter the bit rate of a bit stream, or to fill up a frame or to aid receiver synchronisation. Typically it is used to limit the number of consecutive bits of the same value in the data to be transmitted. This allows for certain sequences of ones and zeros to be reserved for frame delimiting by ensuring the data itself can never be the same as the beginning or end flags.
The component stores the values of the last consecutive_ones - 1 samples. If the current sample and the last consecutive_ones - 1 samples are all 1, then a single 0 symbol is inserted into the sample stream.
Interface
<?xml version="1.0"?>
<componentspec>
<property name="consecutive_ones" type="uchar" writable="false" parameter="true" default="5" description="Number of consecutive ones after which a zero will be inserted."/>
<property name="flush_length" type="uchar" writable="true" default="4" description="Number of zeros that should be inserted into the bit stuffer on receipt of a flush opcode."/>
<port name="input" producer="false" protocol="bool_timed_sample-prot"/>
<port name="output" producer="true" protocol="bool_timed_sample-prot"/>
</componentspec>
Ports
Inputs:
input: Primary input samples port.Protocol:
bool_timed_sample-protOptional:
False
Outputs:
output: Primary output samples port.Protocol:
bool_timed_sample-protOptional:
False
Opcode Handling
When a message with a discontinuity opcode is received this acts to reset the component, and clears the internal input buffer of previously received data to all zeros. Once this is completed the discontinuity opcode message is forwarded on.
When a message with a flush opcode is received flush_length zeros are injected into the bit_stuffer’s input whilst applying backpressure. Once this is completed the flush opcode message is forwarded on.
All other opcode messages are passed through the component without any effect.
Properties
consecutive_ones: Number of consecutive ones after which a zero will be inserted.Type:
ucharAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
False
Default value:
5
flush_length: Number of zeros that should be inserted into the bit stuffer on receipt of a flush opcode.Type:
ucharAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
4
Implementations
Example Application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="bit_stuffer_b">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.communication.bit_stuffer_b" connect="file_write">
<property name="consecutive_ones" value="5"/>
<property name="flush_length" value="4"/>
</instance>
<instance component="ocpi.core.file_write">
<property name="filename" value="output.bin"/>
</instance>
</application>
Dependencies
The dependencies to other elements in OpenCPI are:
There is also a dependency on:
ieee.std_logic_1164
ieee.numeric_std
Limitations
Limitations of bit_stuffer_b are:
consecutive_onescannot be set to zero.
Testing
Tested platforms: None
Component testing not completed.