PRS

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaTr_1730276
Level 4
Level 4
First like given 10 sign-ins First solution authored

Hello,

I'm developing a system using a PRS component set to 17 bit.

With 17 bit I can reach 2^17 = 131071 combination.

I have no problems regard the decoding (my system read a code of 17 bit and decode by means of PRS the combination).

I need a firmware routine that generate the 131071 combination because I have to print the entire combination on an external support (that my system have to read).

Could you provide a generic firmware routine that generate the 17 bit sequence as PRS component ("generic" because I have to provide the routine to my supplier that using a standard MCU and not a sOC)?

Thanks and regards

0 Likes
1 Solution
EmHo_296241
Level 5
Level 5
10 solutions authored 50 replies posted 25 replies posted

Hi,

Normally LFSR is used to generate psuedo random sequence generator.

If your requirement is to go through all the 2^17 combinations, a simple counter output might do the job.

If you want to generate a random sequence, same logic can be replicated in firmware.

For a 10 bit random sequence generator

for(i=0; i<11; i++) b = 1<<i;

Then pick a primitive polynomial (x^10 + x^3 + 1 is an example)

Start with a seed for x, say

x = 0x8;

rotate x to the left, and copy the exclusive or of bits 10, 3 and 0 into

bit 0:

y1 = (b[10] & x) ? 1 : 0;

y2 = (b[3] & x) ? 1 : 0;

y3 = (b[0] & x) ? 1 : 0;

x = x << 1 | (y1 ^ y2 ^ y3);

View solution in original post

0 Likes
2 Replies
EmHo_296241
Level 5
Level 5
10 solutions authored 50 replies posted 25 replies posted

Hi,

Normally LFSR is used to generate psuedo random sequence generator.

If your requirement is to go through all the 2^17 combinations, a simple counter output might do the job.

If you want to generate a random sequence, same logic can be replicated in firmware.

For a 10 bit random sequence generator

for(i=0; i<11; i++) b = 1<<i;

Then pick a primitive polynomial (x^10 + x^3 + 1 is an example)

Start with a seed for x, say

x = 0x8;

rotate x to the left, and copy the exclusive or of bits 10, 3 and 0 into

bit 0:

y1 = (b[10] & x) ? 1 : 0;

y2 = (b[3] & x) ? 1 : 0;

y3 = (b[0] & x) ? 1 : 0;

x = x << 1 | (y1 ^ y2 ^ y3);

0 Likes
lock attach
Attachments are accessible only for community members.

Thank you!

Manuel Trotta

Technical department

0 Likes