CN110457008B - m sequence generation method, device and storage medium - Google Patents

m sequence generation method, device and storage medium Download PDF

Info

Publication number
CN110457008B
CN110457008B CN201810434254.2A CN201810434254A CN110457008B CN 110457008 B CN110457008 B CN 110457008B CN 201810434254 A CN201810434254 A CN 201810434254A CN 110457008 B CN110457008 B CN 110457008B
Authority
CN
China
Prior art keywords
variable
register
sequence
shifting
exclusive
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810434254.2A
Other languages
Chinese (zh)
Other versions
CN110457008A (en
Inventor
程觉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Pinecone Electronic Co Ltd
Original Assignee
Beijing Xiaomi Pinecone Electronic Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Pinecone Electronic Co Ltd filed Critical Beijing Xiaomi Pinecone Electronic Co Ltd
Priority to CN201810434254.2A priority Critical patent/CN110457008B/en
Publication of CN110457008A publication Critical patent/CN110457008A/en
Application granted granted Critical
Publication of CN110457008B publication Critical patent/CN110457008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/76Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
    • G06F7/78Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data for changing the order of data flow, e.g. matrix transposition or LIFO buffers; Overflow or underflow handling therefor

Abstract

The disclosure relates to a method and a device for generating an m sequence, which can improve the efficiency of generating the m sequence. The method comprises the following steps: determining the positions of N nonzero feedback coefficients included in the feedback coefficients of the multistage shift register; respectively shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient; carrying out XOR operation on the N variable values subjected to the N times of shifting; generating an m-sequence according to the result of the XOR operation; and updating the state variable of the register according to the generated m sequence.

Description

m sequence generation method, device and storage medium
Technical Field
The present disclosure relates to the field of computer and communication technologies, and in particular, to a method and an apparatus for generating an m-sequence, and a storage medium.
Background
The sequence includes a plurality of kinds, and the sequence which can be predetermined and can be repeatedly realized is called a determined sequence; sequences that can neither be predetermined nor repeatedly implemented are called random sequences; sequences that cannot be predetermined but can be repeatedly generated are called pseudo-random sequences. The m sequence is a short for the longest linear shift register sequence, and is a Pseudo random sequence, Pseudo Noise code (PN) or Pseudo random code. The m sequence is a pseudo random sequence which is widely applied at present, and has wide application in the communication field, such as spread spectrum communication, code division multiple access of satellite communication, encryption, scrambling, synchronization, error rate measurement and the like in digital data.
At present, there are many methods for generating m-sequences, for example, the m-sequence is generated by using the following formula:
Figure BDA0001654225200000011
n is 0,1,2,3, … …, r is the register series, x (i) is the m sequence with the binary number 0 or 1, ciIs a feedback coefficient.
The m sequence of only one bit can be generated by one operation through the formula, the efficiency is low, and the method is not suitable for the scalar processor which is widely used at present to operate.
Or for example, a matrix method may be used to generate m-sequences, however, each time n bits are generated, n times of state transition matrix multiplication are required, especially when the shift register is long, the operation amount is large, and at the same time, the state transition matrix also needs to be stored, and each time the transition matrix is called, the memory needs to be read, which increases the processing time.
Disclosure of Invention
The purpose of the present disclosure is to provide an m-sequence generation method, apparatus, and storage medium, which can improve the efficiency of generating an m-sequence.
According to a first aspect of the embodiments of the present disclosure, there is provided an m-sequence generation method, including:
determining the positions of N nonzero feedback coefficients included in the feedback coefficients of the multistage shift register;
respectively shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient;
carrying out XOR operation on the N variable values subjected to the N times of shifting;
generating an m-sequence according to the result of the XOR operation;
and updating the state variable of the register according to the generated m sequence.
Optionally, let the number of stages of the multi-stage shift register be r, and the corresponding values of the positions of the N non-zero feedback coefficients from low to high are a0, a1, … …, am, where m<R, a0 is 0, and N variable values obtained by shifting the register state variables N times are Ra0,Ra1,……,Ram
Generating an m-sequence based on the result of the exclusive-or operation, comprising:
value of order variable Ry=Ra0^Ra1^…^RamWherein ^ is an exclusive or operation;
value of variable RyAnd taking the value of r-am bit from low to high as the value of the generated m sequence.
Optionally, the making the register state variable be a variable R, and updating the register state variable according to the generated m sequence includes:
determining the number r-am as the bit number of the m sequence which can be output at one time;
right-shifting the variable R by R-am bits;
supplementing the generated R-am bit to the high order of the variable R to update the register state variable;
after updating the state variable of the register, executing the steps of shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient, carrying out XOR operation on the N variable values after the N times of shifting, and generating an m sequence according to the result of the XOR operation.
Optionally, performing an exclusive or operation on the N variable values subjected to the N times of shifting includes:
aiming at the numerical value corresponding to the position of each non-zero feedback coefficient, after the state variable of the register is moved to the right by the digit corresponding to the numerical value, the moved high order is supplemented into the numerical value 0 of the corresponding digit;
and carrying out XOR operation on the N variable values after the high-order is supplemented with the value 0.
Optionally, performing an exclusive or operation on the N variable values subjected to the N times of shifting includes:
performing an exclusive-OR operation on the N variable values by a scalar processor of a computer.
According to a second aspect of the embodiments of the present disclosure, there is provided an m-sequence generating apparatus including:
the determining module is used for determining the positions of N nonzero feedback coefficients included in the feedback coefficients of the multistage shift register;
the shift module is used for shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient;
the exclusive-OR operation module is used for carrying out exclusive-OR operation on the N variable values subjected to the N times of shifting;
the m sequence generating module is used for generating an m sequence according to the result of the exclusive or operation;
and the register variable updating module is used for updating the register state variable according to the generated m sequence.
Optionally, let the number of stages of the multi-stage shift register be r, and the corresponding values of the positions of the N non-zero feedback coefficients from low to high are a0, a1, … …, am, where m<R, a0 is 0, and N variable values obtained by shifting the register state variables N times are Ra0,Ra1,……,Ram
Value of order variable Ry=Ra0^Ra1^…^RamWherein ^ is an exclusive or operation;
the m-sequence generation module is configured to:
value of variable RyAnd taking the value of r-am bit from low to high as the value of the generated m sequence.
Optionally, the register state variable is made to be a variable R, and the register variable updating module is configured to:
determining the number r-am as the bit number of the m sequence which can be output at one time;
right-shifting the variable R by R-am bits;
supplementing the generated R-am bit to the high order of the variable R to update the register state variable;
after the register state variable is updated, the shifting module executes the step of shifting the register state variable for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient, the exclusive-or operation module executes the step of performing exclusive-or operation on the N shifted variable values for N times, and the m sequence generation module executes the step of generating an m sequence according to the result of the exclusive-or operation.
Optionally, the xor operation module is configured to:
aiming at the numerical value corresponding to the position of each non-zero feedback coefficient, after the state variable of the register is moved to the right by the digit corresponding to the numerical value, the moved high order is supplemented into the numerical value 0 of the corresponding digit;
and carrying out XOR operation on the N variable values after the high-order is supplemented with the value 0.
Optionally, the xor operation module is configured to:
performing an exclusive-OR operation on the N variable values by a scalar processor of a computer.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspects.
Through the technical scheme, the positions of N nonzero feedback coefficients included in the feedback coefficients of the multistage shift register can be determined firstly, then the state variable of the register is shifted for N times according to the numerical value corresponding to the position of each nonzero feedback coefficient, and then the N variable values subjected to N times of shifting are subjected to XOR operation, so that an m sequence can be generated according to the result of the XOR operation. According to the technical scheme, on one hand, the m sequence can be generated without storing a state transition matrix, so that the memory is saved, the processing time for reading data from the memory is also saved, on the other hand, a shift exclusive-OR method is adopted to replace multiplication among calculation matrixes, so that a large number of operations are reduced, on the other hand, for a scalar processor, the m sequence can be generated by directly carrying out exclusive-OR operation, and compared with a mode that a scalar processor singly takes out specific bits and then carries out operation to generate the m sequence, the method is simpler and quicker.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a schematic diagram of a shift register shown in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of m-sequence generation in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram of a shift register shown in accordance with an exemplary embodiment;
fig. 4 is a block diagram illustrating an m-sequence generating apparatus according to an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
First, referring to fig. 1, an m-sequence generation manner in the prior art is illustrated, where m-sequence generation is composed of two parts, namely, a register state and a feedback coefficient, where x (n) to x (n + r-1) are shift register states, and c0 to c (r-1) are feedback coefficients. The feedback coefficients are not changed when set initially during the whole sequence generation process, the register state is circularly shifted to the right by x (n) and x (n +1), x (n +1) and x (n +2), … …, x (n + r-1) is filled according to the feedback result of each coefficient,
Figure BDA0001654225200000051
n is 0,1,2,3, … …, r is the number of register stages, where x (i) is the generated m-sequence, 0<=i<=2r-1. If the register length is r, the m-sequence period length is 2r-1。
For example, the register stage number r is 8, the initial state x (0) is 0, x (1) is 1, x (2) is 1, x (3) is 0, x (4) is 1, x (5) is 1, x (6) is 0, x (7) is 1, the feedback coefficient c0 is 1, c1 is 0, c2 is 1, c3 is 0, c4 is 1, c5 is 0, c6 is 0, c7 is 0, and x (8) can be obtained as follows.
When n is 0, substituting the formula to obtain: (hereinafter, the addition is modulo two addition)
x(8)=x(0)*c0+x(1)*c1+x(2)*c2+....+x(7)*c7
=x(0)*c0+x(2)*c2+x(4)*c4
=0*1+1*1+1*1
=0+1+1
=0;
And by analogy, when n takes 1,2 and 3 …, the formula is substituted to calculate x (9) and x (10) … ….
It can be seen that, by the above manner, an m-sequence capable of generating one bit is calculated at a time, the calculation amount is large, and the efficiency is low, and the manner of reducing the calculation amount and improving the m-sequence generation efficiency proposed by the present disclosure will be described below.
Fig. 2 is a flowchart illustrating an m-sequence generation method according to an exemplary embodiment, which may be applied to an electronic device (including but not limited to a computer, a mobile phone, a tablet computer, etc.) as shown in fig. 2, and includes the following steps.
Step S11: the positions of N non-zero feedback coefficients included in the feedback coefficients of the multi-stage shift register are determined.
Step S12: and respectively shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient.
Step S13: and carrying out XOR operation on the N variable values subjected to the N times of shifting.
Step S14: based on the result of the exclusive-or operation, an m-sequence is generated.
Step S15: and updating the state variable of the register according to the generated m sequence.
Also taking the multi-stage register shown in fig. 1 as an example, let the stage R of the linear feedback shift register store its state in a variable R (i.e., register state variable), and let the lowest bit of the variable be x (n) in fig. 1, and sequentially left be x (n +1), … …, x (n + R-1).
In step S11, the positions of the non-zero feedback coefficients in the feedback coefficients c corresponding to the registers of each stage are a0, a1, … …, am from right to left (for example, if there are N non-zero feedback coefficients, N is m +1), where m < r, and a0 is 0. For example, if the number r of register stages is 4, c0, c2, c1, c3 and 0, there are 2 non-zero feedback coefficients, c0 and c2, respectively, and their positions are 0 and 2 from right to left, so a0 is 0, a1 is 2, and m is 1.
In step S12, i.e., shifting R to the right by a0, a1, … …, am, respectively, the results after shifting are shown in table 1 below:
TABLE 1 variable R Shift results
bit(r-1) bit4 bit3 bit2 bit1 bit0
x(n+r-1) x(n+4) x(n+3) x(n+2) x(n+1) x(n)
x(n+a1+r-1) x(n+a1+4) x(n+a1+3) x(n+a1+2) x(n+a1+1) x(n+a1)
x(n+a2+r-1) x(n+a2+4) x(n+a2+3) x(n+a2+2) x(n+a2+1) x(n+a2)
x(n+am+r-1) x(n+am+4) x(n+am+3) x(n+am+2) x(n+am+1) x(n+am)
The values after the shift of the register are respectively recorded as:
Ra0=R>>a0;(“>>"means right shift, here means right shift a0 bit)
Ra1=R>>a1;
Ra2=R>>a2;
……
Ram=R>>am;
Then R isa0Is shown in the first row of Table 1, where the lowest bits are x (n), Ra1Is shown in the second row of table 1, where the lowest bit is x (n + a1), the remaining shifted variable values and so on.
In step S13, the N variable values R obtained by shifting are useda0,Ra1,……,RamPerforming XOR operation, then, let Ry=Ra0^Ra1^…^RamWherein ^ is an exclusive OR operation.
Optionally, for the value corresponding to the position of each non-zero feedback coefficient, after the register state variable is shifted to the right by the number of bits corresponding to the value, the shifted high order is complemented with the value 0 of the corresponding number of bits, and then the xor operation is performed on the N variable values after the high order is complemented with the value 0. That is, Ra0,Ra1,……,RamAfter shifting to the right, the xor operation may be performed directly, or the upper bits may be complemented with 0, and the xor operation may be performed with the variable value after being complemented with 0.
Optionally, in step S14, an m-sequence is generated according to the result of the xor operation, which may be to change the value RyAnd taking the value of r-am bit from low to high as the value of the generated m sequence.
Let offset be R-am-1, RyMay be represented as shown in table 2.
TABLE 2 XOR result of values of variables after shifting
bit(r-1) bit(offset+1) bit(offset) bit1 bit0
y(n+r-1) y(n+offset+1) y(n+offset) y(n+1) y(n)
With the method of the present disclosure, it is possible to output offset +1 (i.e., r-am) bits at a time, and the outputs are x (n + r) ═ y (n), (n + r +1) ═ y (n +1), … …, and x (n + r + offset) ═ y (n + offset), respectively. It can be seen that the length of the sequence that can be generated at a time by the present disclosure depends on the offset, i.e., the number of stages r of the linear feedback register and the maximum non-zero feedback coefficient am, and as am is smaller, offset is larger, the efficiency of the sequence generation is higher.
Optionally, in step S15, the register state variable may be updated by first determining the value R-am as the number of bits of the m-sequence that can be output at one time, then shifting the variable R to the right by R-am bits, and then supplementing the generated R-am bits to the high bits of the variable R. After updating the state variable of the register, the steps of shifting the state variable of the register N times according to the value corresponding to the position of each non-zero feedback coefficient, performing xor operation on the N shifted variable values, and generating an m-sequence according to the result of the xor operation are performed again.
That is, after the sequence is output, the register state is updated, and the updated register state is shown in table 3.
TABLE 3 register State after bit output
bit(r-1) bit(r-offset-1) bit1 bit0
y(n+offset) y(n) X(n+offset+2) X(n+offset+1)
The updated register state is actually the register state R before output is shifted to the right by offset +1, i.e. R-am bits, and then the R-am bits of y (n), y (n +1), … …, y (n + offset) output this time are supplemented to the tail of the register state.
Then, step S12-step S14 are performed again to generate the remaining bits, and the maximum non-periodic m-sequence length that can be generated is 2r-1。
Optionally, the xor operation may be performed on the N variable values after the N times of shifting, or may be performed on the N variable values by a scalar processor of the computer.
That is, for a scalar processor, it is not convenient to operate on each bit, but an exclusive or operation may be performed on a variable, so the technical solution of the present disclosure may be applied to any scalar processor.
Of course, in practical applications, the selected m sequence is not taken from x (0) directly, but has an offset, which is D, that is, the m sequence is taken from x (D), and a certain sequence length is selected from the beginning, for example, D value is 1600, if according to the disclosed scheme, 1600 bits need to be generated first, and then 1601 bits are used to start with the actually required target bit. For this case, a matrix method may be used in combination with the technical solution of the present disclosure.
For example, when D is 1600 and the number of register stages is r, a matrix method, X, may be used first1600=X0×A1600(X0Is the initial register state vector, a is the state transition matrix, is known), so a can be first calculated using tools such as matlab, etc1600Calculated X1600I.e., register state R when D1600, and X1600The values of (a) are x (1600), x (1601), … …, and x (1600+ r-1) in sequence from low to high, and then the remaining m-sequence can be calculated by using the technical scheme of the present disclosure.
In order to better illustrate the technical solutions of the present disclosure, the following detailed description will be given through the full examples.
The first embodiment is as follows:
assuming that the register stage number r is 8, the initial state x (0) is 0, x (1) is 1, x (2) is 1, x (3) is 0, x (4) is 1, x (5) is 1, x (6) is 0, x (7) is 1, the feedback coefficient c0 is 1, c1 is 0, c2 is 1, c3 is 0, c4 is 1, c5 is 0, c6 is 0, and c7 is 0.
The initial variable value R of the register is 0xb6 ('0 xb 6' is 16-ary representation, for a total of 8 bits, corresponding to 10110110), if R is shifted one bit to the right, it becomes 01011011, the bit shifted up is replaced by 0, corresponding to 0x5b and so on, and R is shifted two bits to the right, it becomes 00101101, the bit shifted up is further shifted in by one 0, corresponding to 0x2d and so on.
As can be seen from the feedback coefficients, the non-zero coefficients are c0, c2 and c4, respectively, so that a0 equals 0, a1 equals 2, and a2 equals 4, then:
Ra0=R>>a0=R=0xb6;
Ra1=R>>a1=R>>2=0x2d;
Ra2=R>>a2=R>>4=0x0b;
in scalar processors, variables can be xored, for example:
to Ra0^Ra1XOR' ing bit bits corresponding to modulo twoThe result of addition and exclusive or is 10011011. Then: ra0^Ra1=0x9b;Ry=Ra0^Ra1^Ra2=0x9b^0x0b=0x90;
offset=r-am-1=8-a2-1=8-4-1=3;
Then offset +1 can be calculated at one time as 4 bits x (8), x (9), x (10) and x (11), corresponding to RyThe lower 4 bits of (a):
x(8)=0,x(9)=0,x(10)=0,x(11)=0。
example two:
as shown in fig. 3, it is assumed that the register stage number R is 4, the register initial state R is 3 (binary 0011, i.e. when n is 0, x (0) is 1, x (1) is 1, x (2) is 0, and x (3) is 0), the feedback coefficient c0 is 1, c1 is 1, c2 is 0, c3 is 0, a0 is 0, a1 is 1, m is 1, and offset R-am-1 is 4-1-2, so that offset +1 can be generated at a time by the method of the present disclosure, which is 3 bits.
Shifting R to obtain Ra0And Ra1:Ra0=R>>a0=R=3;Ra1=R>>a1=R>>1=1。
To Ra0And Ra1Performing exclusive-or operation: ry=Ra0^R a13^1 ^2, 2 is represented by binary 0010, and the lower 3 bits are the generated m-sequence, so x (4) ═ 0, x (5) ═ 1, and x (6) ═ 0.
And forming a new register state, wherein x (6) is 0, x (5) is 1, x (4) is 0, and x (3) is 0 in sequence from high to low. That is, the update register state R is 4 (0100 in binary);
based on the updated register state, the shift and XOR operations are performed again to produce new data outputs x (6), x (7), and x (8):
Ry=Ra0^Ra14^2 ^ 6 (binary 0110), x (7) is 0, x (8) is 1, and x (9) is 1. The following x (n), n>9, the method can be analogized, 4 stages of registers can generate m sequences with the period of 24-1=15。
Referring to fig. 4, based on the same inventive concept, an embodiment of the present disclosure provides an m-sequence generating apparatus 400, where the apparatus 400 may include:
a determining module 401, configured to determine positions of N nonzero feedback coefficients included in feedback coefficients of a multi-stage shift register;
a shift module 402, configured to shift the state variable of the register N times according to a value corresponding to a position of each non-zero feedback coefficient;
an exclusive-or operation module 403, configured to perform exclusive-or operation on the N variable values subjected to the N times of shifting;
an m-sequence generating module 404, configured to generate an m-sequence according to the result of the xor operation;
and a register variable update module 405, configured to update the register state variable according to the generated m-sequence.
Optionally, let the number of stages of the multi-stage shift register be r, and the corresponding values of the positions of the N non-zero feedback coefficients from low to high are a0, a1, … …, am, where m<R, a0 is 0, and N variable values obtained by shifting the register state variables N times are Ra0,Ra1,……,Ram
Value of order variable Ry=Ra0^Ra1^…^RamWherein ^ is an exclusive or operation;
the m-sequence generation module 404 is configured to:
value of variable RyAnd taking the value of r-am bit from low to high as the value of the generated m sequence.
Optionally, the register state variable is made to be a variable R, and the register variable updating module 405 is configured to:
determining the number r-am as the bit number of the m sequence which can be output at one time;
right-shifting the variable R by R-am bits;
supplementing the generated R-am bit to the high order of the variable R to update the register state variable;
after the register state variables are updated, the shift module 402 again executes the step of shifting the register state variables N times according to the values corresponding to the positions of the respective non-zero feedback coefficients, the exclusive-or operation module 403 again executes the step of exclusive-oring the N shifted variable values N times, and the m-sequence generation module 404 again executes the step of generating the m-sequence according to the result of the exclusive-or operation.
Optionally, the exclusive or operation module 403 is configured to:
aiming at the numerical value corresponding to the position of each non-zero feedback coefficient, after the state variable of the register is moved to the right by the digit corresponding to the numerical value, the moved high order is supplemented into the numerical value 0 of the corresponding digit;
and carrying out XOR operation on the N variable values after the high-order is supplemented with the value 0.
Optionally, the exclusive or operation module 403 is configured to:
performing an exclusive-OR operation on the N variable values by a scalar processor of a computer.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed.
The functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a non-transitory computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a ROM (Read-Only Memory), a RAM (Random access Memory), a magnetic disk, or an optical disk.
The above embodiments are only used to describe the technical solutions of the present disclosure in detail, but the above embodiments are only used to help understanding the method and the core idea of the present disclosure, and should not be construed as limiting the present disclosure. Those skilled in the art should also appreciate that various modifications and substitutions can be made without departing from the scope of the present disclosure.

Claims (9)

1. An m-sequence generation method, comprising:
determining the positions of N nonzero feedback coefficients included in the feedback coefficients of the multistage shift register;
respectively shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient;
carrying out XOR operation on the N variable values subjected to the N times of shifting;
let the number of stages of the multi-stage shift register be r, and the corresponding numerical values of the positions of the N non-zero feedback coefficients from low to high are a0, a1, … … and am, wherein m<R, a0 is 0, and N variable values obtained by shifting the register state variables N times are Ra0,Ra1,……,RamValue of order variable Ry=Ra0^Ra1^…^RamWherein ^ is exclusive-OR operation, and the value R is changedyTaking the value of r-am bit from low to high as the value of the generated m sequence;
and updating the state variable of the register according to the generated m sequence.
2. The method according to claim 1, wherein the updating the register state variable according to the generated m-sequence by making the register state variable a variable R comprises:
determining the number r-am as the bit number of the m sequence which can be output at one time;
right-shifting the variable R by R-am bits;
supplementing the generated R-am bit to the high order of the variable R to update the register state variable;
after updating the state variable of the register, executing the steps of shifting the state variable of the register for N times according to the numerical value corresponding to the position of each nonzero feedback coefficient, carrying out XOR operation on the N variable values subjected to the N times of shifting, and generating an m sequence according to the result of the XOR operation.
3. The method of any of claims 1-2, wherein xoring the N shifted N variable values, comprising:
aiming at the numerical value corresponding to the position of each non-zero feedback coefficient, after the state variable of the register is moved to the right by the digit corresponding to the numerical value, the moved high order is supplemented into the numerical value 0 of the corresponding digit;
and carrying out XOR operation on the N variable values after the high-order is supplemented with the value 0.
4. The method of any of claims 1-2, wherein xoring the N shifted N variable values, comprising:
performing an exclusive-OR operation on the N variable values by a scalar processor of a computer.
5. An m-sequence generating apparatus, comprising:
the determining module is used for determining the positions of N nonzero feedback coefficients included in the feedback coefficients of the multistage shift register;
the shift module is used for shifting the state variable of the register for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient;
the exclusive-OR operation module is used for carrying out exclusive-OR operation on the N variable values subjected to the N times of shifting;
an m-sequence generation module, configured to make the number of stages of the multi-stage shift register r, where the positions of the N non-zero feedback coefficients from low to high correspond to values a0, a1, … …, am, where m is<R, a0 is 0, and N variable values obtained by shifting the register state variables N times are Ra0,Ra1,……,RamValue of order variable Ry=Ra0^Ra1^…^RamWherein ^ is exclusive-OR operation, and the value R is changedyTaking the value of r-am bit from low to high as the value of the generated m sequence;
and the register variable updating module is used for updating the register state variable according to the generated m sequence.
6. The apparatus of claim 5, wherein the register state variable is made to be a variable R, and wherein the register variable update module is configured to:
determining the number r-am as the bit number of the m sequence which can be output at one time;
right-shifting the variable R by R-am bits;
supplementing the generated R-am bit to the high order of the variable R to update the register state variable;
after the register state variable is updated, the shifting module executes the step of shifting the register state variable for N times according to the numerical value corresponding to the position of each non-zero feedback coefficient, the exclusive-or operation module executes the step of performing exclusive-or operation on the N shifted variable values for N times, and the m sequence generation module executes the step of generating an m sequence according to the result of the exclusive-or operation.
7. The apparatus of any one of claims 5-6, wherein the XOR operation module is configured to:
aiming at the numerical value corresponding to the position of each non-zero feedback coefficient, after the state variable of the register is moved to the right by the digit corresponding to the numerical value, the moved high order is supplemented into the numerical value 0 of the corresponding digit;
and carrying out XOR operation on the N variable values after the high-order is supplemented with the value 0.
8. The apparatus of any one of claims 5-6, wherein the XOR operation module is configured to:
performing an exclusive-OR operation on the N variable values by a scalar processor of a computer.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201810434254.2A 2018-05-08 2018-05-08 m sequence generation method, device and storage medium Active CN110457008B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810434254.2A CN110457008B (en) 2018-05-08 2018-05-08 m sequence generation method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810434254.2A CN110457008B (en) 2018-05-08 2018-05-08 m sequence generation method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110457008A CN110457008A (en) 2019-11-15
CN110457008B true CN110457008B (en) 2021-08-03

Family

ID=68480287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810434254.2A Active CN110457008B (en) 2018-05-08 2018-05-08 m sequence generation method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110457008B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221577B (en) * 2020-01-17 2020-12-29 中国人民解放军32802部队 Function reconstruction method for non-cooperative linear feedback shift register

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728626A (en) * 2004-07-27 2006-02-01 中兴通讯股份有限公司 Method and device for detecting error code in wireless digital communication system
CN102073053A (en) * 2010-12-20 2011-05-25 东莞市泰斗微电子科技有限公司 Pseudo random noise code generation unit of multi-mode GNSS (global navigation satellite system) receiver
CN103487817A (en) * 2013-09-18 2014-01-01 中国科学院嘉兴微电子与系统工程中心 Multimode multi-frequency GNSS pseudo code generation device
CN103677743A (en) * 2013-11-22 2014-03-26 航天恒星科技有限公司 Method and device for parallel generation of PN sequences based on FPGA
CN103870238A (en) * 2012-12-10 2014-06-18 北京普源精电科技有限公司 Pseudo-random sequence generator based on FPGA (Field Programmable Gate Array) and generation method thereof
US8935309B1 (en) * 2011-04-22 2015-01-13 Sk Hynix Memory Solutions Inc. Generation of constrained pseudo-random binary sequences (PRBS)
US8949299B2 (en) * 2011-08-01 2015-02-03 Syntest Technologies, Inc. Method and apparatus for hybrid ring generator design
CN105227259A (en) * 2015-07-02 2016-01-06 中国科学院计算技术研究所 A kind of M sequence walks abreast production method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100552694B1 (en) * 2003-10-16 2006-02-20 삼성전자주식회사 Method and apparatus for multiplication operation in finite field

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728626A (en) * 2004-07-27 2006-02-01 中兴通讯股份有限公司 Method and device for detecting error code in wireless digital communication system
CN102073053A (en) * 2010-12-20 2011-05-25 东莞市泰斗微电子科技有限公司 Pseudo random noise code generation unit of multi-mode GNSS (global navigation satellite system) receiver
US8935309B1 (en) * 2011-04-22 2015-01-13 Sk Hynix Memory Solutions Inc. Generation of constrained pseudo-random binary sequences (PRBS)
US8949299B2 (en) * 2011-08-01 2015-02-03 Syntest Technologies, Inc. Method and apparatus for hybrid ring generator design
CN103870238A (en) * 2012-12-10 2014-06-18 北京普源精电科技有限公司 Pseudo-random sequence generator based on FPGA (Field Programmable Gate Array) and generation method thereof
CN103487817A (en) * 2013-09-18 2014-01-01 中国科学院嘉兴微电子与系统工程中心 Multimode multi-frequency GNSS pseudo code generation device
CN103677743A (en) * 2013-11-22 2014-03-26 航天恒星科技有限公司 Method and device for parallel generation of PN sequences based on FPGA
CN105227259A (en) * 2015-07-02 2016-01-06 中国科学院计算技术研究所 A kind of M sequence walks abreast production method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
短波通信控制硬件平台与系统加密方案设计;郑泉海;《中国优秀硕士学位论文全文数据库(电子期刊) 信息科技辑》;20160315;第2016年卷(第3期);第I136-967页 *

Also Published As

Publication number Publication date
CN110457008A (en) 2019-11-15

Similar Documents

Publication Publication Date Title
JP4559505B2 (en) Extending the repetition period of random sequences
US4493046A (en) Apparatus for generation of binary pseudo-random numbers
US20120030548A1 (en) Method and device for implementing cyclic redundancy check codes
US20050204261A1 (en) Encoding method and encoding apparatus
CN103199873B (en) The quickly configuration method of two-stage piecemeal CRC computing
CN109375897B (en) Method for generating pseudo-random sequence
CN110457008B (en) m sequence generation method, device and storage medium
CN110097613B (en) B spline curve generation method and system based on probability calculation
EP2827516B1 (en) Scrambling code generation method, apparatus and scrambling code processing apparatus
CN111694546B (en) Method and device for generating pseudo-random binary sequence code
US8909510B2 (en) LFSR emulation
CN110858137A (en) Floating point division by integer constant
CN107733441A (en) Coding method and device, interpretation method and device
US10067821B2 (en) Apparatus and method for cyclic redundancy check
CN111431541B (en) Method and device for obtaining CRC (cyclic redundancy check) code
CN109039533B (en) Method and device for generating pseudorandom time-varying interleaving parameters
US20050086278A1 (en) Method and apparatus for performing multiplication in finite field GF(2n)
CN106603085B (en) Generating method and generating device for generating polynomial, encoder, controller and electronic equipment
US8316070B2 (en) Method and system for advancing a linear feedback shift register
CN113922913B (en) GOLD scrambling code sequence generation method, system and equipment of LTE system
CN116149600B (en) Method, device, equipment and medium for setting logic circuit of multi-constant multiplier
US8381080B2 (en) Reducing a degree of a polynomial in a polynomial division calculation
CN111934713B (en) Frequency hopping point prediction method based on real-time capture and dynamic judgment of shift register
US11374553B2 (en) Signal processing device and signal processing method
JP2017058501A (en) Hash function calculation device and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100085 unit C, building C, lin66, Zhufang Road, Qinghe, Haidian District, Beijing

Applicant after: Beijing Xiaomi pinecone Electronic Co., Ltd

Address before: 100085 Beijing city Haidian District Qinghe Shun Yip things Park Building 3 unit A

Applicant before: BEIJING PINECONE ELECTRONICS Co.,Ltd.

GR01 Patent grant
GR01 Patent grant