Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help in convolutional encoding and decoding

Status
Not open for further replies.

text2babu

Member level 3
Joined
Aug 11, 2006
Messages
62
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,288
Location
bengaluru
Activity points
1,708
Hello friends, here is the code of convolutional encoding and decoding, convolutional encoding is simple enough, but the logic in decoding is not understandable. can u tell me what logic is he putting here.

convolutional encoder:
UINT16 SR = 0;
UINT16 uPoly1 = 11001;
UINT16 uPoly2 = 11011;
UINT8 ucDataMask = 0x01;
INT i;
for (i = 0 ; i < iBitCount ; i++)
{
SR <<= 1;
SR |= (*puc8PackedData & ucDataMask) ? 1 : 0;
pucUnpackedOutput[*piImTable++] = Xor8((UINT8)(SR & uPoly1));
pucUnpackedOutput[*piImTable++] = Xor8((UINT8)(SR & uPoly2));
ucDataMask<<=1;
if (!ucDataMask)
ucDataMask = 0x01, puc8PackedData++;
}


Convolutional decoder:

uPoly1 >>= 1;
uPoly2 >>= 1; //why these two polynomials have been shifted which is not shifted in encoder

for (i = 0 ; i < iOutputBitCount ; i++)
{

bit1 = pucUnpackedInput;
bit1 ^= Xor8((UINT8)(SR & uPoly1)) ? 1 : 0;

bit2 = pucUnpackedInput;
bit2 ^= Xor8((UINT8)(SR & uPoly2)) ? 1 : 0;

if (bit1 != bit2) iErrors++;

SR <<= 1;

if (bit1) // Write bit to packed output and SR
{
*puc8PackedOutput |= ucDataMask;
SR |= 0x01;
}

// move output byte/bit pointer
ucDataMask <<= 1;
if (!ucDataMask) ucDataMask = 0x01, puc8PackedOutput++;
}

what is the logic behind this decoder, can anybody draw the sequential diagram with xor gates and tell me.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top