Scrambler: Difference between revisions
Jesternofool (talk | contribs) (Added clarification for length.) |
Jesternofool (talk | contribs) (Added to description with connection to Descrambler block.) |
||
Line 8: | Line 8: | ||
''This is a block diagram of a 7-stage multiplicative scrambler with a LFSR with feedback taps (7,4).'' | ''This is a block diagram of a 7-stage multiplicative scrambler with a LFSR with feedback taps (7,4).'' | ||
This block works on the LSB only of the input data stream, i.e., on an "unpacked binary" stream, and produces the same format on its output. | This block works at the bit level. This means it works on the LSB only of the input data stream, i.e., on an "unpacked binary" stream, and produces the same format on its output. | ||
This block is typically used for the transmit portion of a digital communication system, and works in conjunction with the [[Descrambler]] block. The [[Descrambler]] block, which is typically used in the receive system, will derandomize the output of the '''Scrambler''' block so long as they are each using the same ''Mask'' and ''Length''. Further, because of the fundamental nature of multiplicative scramblers, the [[Descrambler]] block will self-synchronize with the randomized bitstream coming from the '''Scrambler''' block. | |||
== Parameters == | == Parameters == |
Revision as of 19:11, 25 July 2025
The Scrambler block is an implementation of a multiplicative scrambler. It takes an input bit stream and randomizes it using a linear feedback shift register (LFSR) where the feedback is fed into the LFSR itself.
This is a block diagram of a 7-stage multiplicative scrambler with a LFSR with feedback taps (7,4).
This block works at the bit level. This means it works on the LSB only of the input data stream, i.e., on an "unpacked binary" stream, and produces the same format on its output.
This block is typically used for the transmit portion of a digital communication system, and works in conjunction with the Descrambler block. The Descrambler block, which is typically used in the receive system, will derandomize the output of the Scrambler block so long as they are each using the same Mask and Length. Further, because of the fundamental nature of multiplicative scramblers, the Descrambler block will self-synchronize with the randomized bitstream coming from the Scrambler block.
Parameters
- Mask
- Polynomial mask for LFSR. To calculate the required mask, reverse the order of the desired polynomial. For example, a maximal-length 7-stage LFSR could use taps (7,4). A mask for this implementation would be the binary value 0b001001, or in hex 0x9. A 5-stage LFSR with taps (5,3) would be 0b00101, or in hex 0x5.
- Seed
- Initial shift register contents. This is the fill condition of the LFSR.
- Length
- Shift register length. Must be <=63, meaning that the maximum polynomial is 64. The value of the Length is one less than the polynomial size. For example, a 7-stage LFSR also means a polynomial size of 7. The Length for this block would be 6.
Example Flowgraph
Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI. Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately. The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.
Here is a simple python-function to create the mask and length from the exponents of a polynomial:
def make_mask(*exp): from functools import reduce return reduce(int.__xor__,map(lambda x:2**x,exp)),max(exp)-1 mask,k = make_mask(5,3,0) # mask and length for p(x) = x^5 + x^3 + 1, a primitive polynomial in GF(2)
Source Files
- C++ files
- TODO
- Header files
- TODO
- Public header files
- TODO
- Block definition
- TODO