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 tracks the number of consecutive ones on the input. After consecutive_ones ones are received, a 0 symbol is inserted into the sample stream.
Interface
<?xml version="1.0"?>
<componentspec>
<property name="consecutive_ones" type="uchar" parameter="true" default="5"
description="Number of consecutive ones after which a zero will be inserted."/>
<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 discontinuity or flush opcode is received this acts to reset the component, and clears the internal count of received consecutive ones. Once this is completed the opcode is forwarded on.
All other non-sample 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
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"/>
</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
Limitations
Limitations of bit_stuffer_b are:
consecutive_onescannot be set to zero.
Testing
Tested platforms: None
Component testing not completed.