/* C Porgram To Find convolutional Codes or Code Vectors */
#include< stdio.h>
#include< conio.h>
void main()
{
int i,j,k,n,gb,mb,g[10][10],x[10][10],c[10],m[10],t[10];
clrscr();
for(i=0;i< 10;i++)
{
for(j=0;j< 10;j++)
g[i][j]=0;x[i][j]=0;c[i]=0;m[i]=0;t[i]=0;
}
printf("\t\t\t¦ Convolutional Code ¦");
printf("\n\nEnter The No. Of Generator Sequences\t: ");
scanf("%d",&n);
printf("Enter The No. Of Bits In Each Generator Sequence\t: ");
scanf("%d",&gb);
for(i=0;i< n;i++)
{
printf("\n\nEnter The Values Of G%d\t:\n",i);
for(j=0;j< gb;j++)
scanf("%dt",&g[i][j]);
}
printf("\nEnter The No. Of Message Bits\t: ");
scanf("%d",&mb);
printf("Enter The Message Bits\t:\n");
for(i=0;i< mb;i++)
scanf("%d",&c[i]);
for(i=0;i< mb;i++)
{
for(j=0;j< gb;j++)
{
t[j]=m[j];
if(j==0)
m[j]=c[i];
else
m[j]=t[j-1];
}
for(k=0;k< gb;k++)
{
for(j=0;j< gb;j++)
{
if(g[k][j]==1)
x[k][i]=x[k][i]^m[j];
}
}
}
printf("\n\n¦ The Code Vectors Are: ¦\n");
for(i=0;i< mb;i++)
{
printf("¦ \n¦ ");
for(j=0;j< gb;j++)
printf("%d\t",x[j][i]);
}
getch();
}
/*************** OUTPUT ******************
¦ Convolutional Code ¦
Enter The No. Of Generator Sequences : 2
Enter The No. Of Bits In Each Generator Sequence : 3
Enter The Values Of G0 :
1
1
1
Enter The Values Of G1 :
1
0
1
Enter The No. Of Message Bits : 8
Enter The Message Bits :
1
1
0
1
1
0
1
1
¦ The Code Vectors Are: ¦
¦
¦ 1 1 0 ¦
¦ 0 1 0 ¦
¦ 0 1 0 ¦
¦ 0 0 0 ¦
¦ 0 1 0 ¦
¦ 0 1 0 ¦
¦ 0 0 0 ¦
¦ 0 1 0
*/
Wednesday, January 23, 2008
Subscribe to:
Post Comments (Atom)
24 comments:
Kindly rectify the program
Above code has errors ........
i hope you will correct them ..
rectifuedxxxxxxxxxxxxxxxxxxxxxx
thanks...working well
working well... thanks
thank u..that's great..
but, can u help me to build convolutional code by C++ and using random binary input?
thank u
hey thanks a lot yaar.xellent program..works very well. thank you so much.God bless.
jene
I always motivated by you, your views and way of thinking, again, appreciate for this nice post.
- Norman
Hi,I'm Stephen,come from Taiwan.
Can I ask a question.......
I'm advancing convolutional code...
now I must to write down c++ program of convolutional decoding ,part of Hard decision decode(HDD)..........
but I can't....
so...can you help me??
if you to be willing,I will to appreciate...Thank you!! ^ ^
Hi,I'm Stephen.come from Taiwan.
Can I ask a questions.......
I'm advancing convolutional code...
now I must to write down c++ program of convolutional decoding ,part of Hard decision decode(HDD)..........
but I can't....
so...can you help me??
if you to be willing,I will to appreciate...Thank you!!
its giving rong answer..
rong code...problem with logic..
can anyone send code for convolutional decoding
help me to write the out pot to a file......
Help to write convolution code out put to a file ..
Help me to write the convolution out put to a file...
Help me to write the convolution out put to a file...
there is an error in ur convolutional codes.kindly rectified it..
help me plz.
plz rectify ur convolutional code
Can you put the rectified program.
thks ;)
hi, this code has some errors, i fixed them but the output is not like the output that you have on the website. can you fix it please and post that you have fixed it.
bad programming
plis decoding!))
my output is -858993460 and -858993459. WHy?
Post a Comment