bluetooth sync word calculate in access code

Status
Not open for further replies.

ys82

Newbie level 6
Joined
Feb 25, 2008
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
i meet a issue of bluetooth sync word calculate, can anybody help me ? thank you very much !!

the bloouth spec about sync word calculate as bellow:
1. Generate information sequence;
2. XOR this with the “information covering” part of the PN overlay
sequence;
3. Generate the codeword;
4. XOR the codeword with all 64 bits of the PN overlay sequence

I write a verilog behavioral mode to help understand, as bellow
=================================================
assign p_rand=64'h83848d96bbcc54fc; // PN sequence in spec
assign gd=35'o260534236651; //g(d) in spec

//Generate information sequence
assign xd= lap[23] ? {6'b010011,lap} : {6'b101100,lap};

//XOR this with the “information covering” part of the PN overlay sequence
assign xd_ = xd^p_rand[63:34];

//generate codeword as spec description" D34X(D) mod g(D)"
assign xd_shift = {xd_, 34'b0};
assign cd_ = xd_shift%gd;
assign codeword = {xd_,cd_[33:0]};

//XOR the codeword with all 64 bits of the PN overlay sequence
assign syncword = codeword^p_rand
=================================================

I use bellow sample data in spec to verification my behavioral mode,


Bit transmit order on air
--------------------------------->
LAP: | Preamble:| Sync word: | Trailer: |
--------------------------------------------------
000000 | 5 | 7e7041e3 4000000d | 5 |


But my code generate wrong sync word: 1629ddd38000000d(reverse syncword)

so where is wrong of my verliog code ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…