Professional Documents
Culture Documents
In the figure, the output xk is binary (0 or 1), and so are the constants hj, j=0, 1, … n, and ⊕
denotes the XOR operation. This means that xk is given by:
xk = h1xk-1⊕……⊕ hnxk-n
Since xk⊕xk=0, it follows from the above that:
xk ⊕ h1xk-1⊕……⊕hnxk-n =0
or
h(D)x(D) = 0
where h(D) = 1 ⊕ h1D⊕……⊕ hnDn and D denotes a unit delay (xkDj=xk-j for any j). Note that
the “1” in the polynomial does not correspond to a tap.
Procedure:
1) Let say that we have the initial state(xk-n …. xk-1) and h values(hn …. h0) of the PN sequence
generator.
2) First move the data of initial state and h values into two accumulators, say AC0 and AC1
respectively.
3) The last bit in (hn …. h0) i.e., h0 does not correspond to a tap. So, we have to eliminate it first
before generating any output. So, first we have to shift the data in the accumulator in which we have
stored the 0025 i.e., AC1 to the right by 1 bit so that the last bit is discarded. This can be done by
using SFTL operation.
4) Move zero into another accumulator, say AC3. In this register, we are going to store the output
that we are generating from this state of the PN sequence generator.
5) We know that,
xk = h1xk-1⊕……⊕ hnxk-n.
So, we have to multiply the bits of AC0 with the corresponding bits of AC1 and we have to take a
XOR to generate xk. This can be done by using the BCNT operation.
6) Now, we have to update the state of PN sequence generator. This can be done by rotating the
data in AC0 once i.e., ROL operation. We have to make sure that the InBit we give is the output bit
that is just generated. We also have to update the accumulator AC3.
7) Repeat the steps 5 and 6 depending on the depending on the number of bits we need to
generate.
The length of the PN sequence generator I chose is 15 i.e., it has 15 tap points. The initial state(xk-n ….
xk-1) of the PN sequence generator I chose is 0008(in Hexa Decimal) and the h values(hn …. h0) I chose
is 0025(in Hexa Decimal).
We can see the output we have generated in the register AC3 i.e., 0001(In Hexa decimal). In AC0, we
can see the updated state of the PN sequence generator i.e., 001A(In Hexa decimal). The number of
cycles it took to generate 1 bit of output is 24 cycles.
We can see the output we have generated in the register AC3 i.e., E14D(In Hexa decimal). In AC0, we
can see the updated state of the PN sequence generator i.e., 6E14D(In Hexa decimal). The number of
cycles it took to generate 16 bits of output is 174 cycles.
Discussion:
The PN sequence generator took 24 clock cycles to generate 1 bit of output and 174 clock cycles to
generate 16 bits of output. We can see the updated state in AC0 and the output bits generated in
AC3. After generating 1 bit of output, the previous MSB of ‘x’ no longer decides the output any
further as only the current state decides the output and previous MSB of ‘x’ will be thrown out after
generating 1 bit of output. We can generate any number of output bits with the use of the above
code just by changing the number of times the loop runs. We can do this by changing the data we
move into BRC0 in the code.