Aim:- Write C/C++ program to implement CDMA.
Code-division multiple access (CDMA) is a channel access method used by various radio communication technologies. CDMA is an example of multiple access, where several transmitters can send information simultaneously over a single communication channel. This allows several users to share a band of frequencies (see bandwidth). To permit this without undue interference between the users, CDMA employs spread spectrum technology and a special coding scheme (where each transmitter is assigned a code).
CDMA is a spread-spectrum multiple-access technique. A spread-spectrum technique spreads the bandwidth of the data uniformly for the same transmitted power.
Here is the program that shows how CDMA ca be implemented using C Programming.
C Program Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int A, B, codeA[8], codeB[8], As[8], Bs[8], Cs[8], i, a = 0, b = 0;
clrscr();
printf("Enter Data A : ");
scanf("%d", &A);
if(A == 0)
{
A = -1;
}
printf("Enter Data B : ");
scanf("%d", &B);
if(B == 0)
{
B = -1;
}
printf("\nEnter codeA : ");
for(i = 0; i < 8; i++)
{
scanf("%d", &codeA[i]);
if(codeA[i] == 0)
{
codeA[i] = -1;
}
}
printf("Enter codeB : ");
for(i = 0; i < 8; i++)
{
scanf("%d", &codeB[i]);
if(codeB[i] == 0)
{
codeB[i] = -1;
}
}
printf("\ncodeA : ");
for(i = 0; i < 8; i++)
{
printf("%d ", codeA[i]);
}
printf("\ncodeB : ");
for(i = 0; i < 8; i++)
{
printf("%d ", codeB[i]);
}
for(i = 0; i < 8; i++)
{
As[i] = A * codeA[i];
Bs[i] = B * codeB[i];
Cs[i] = As[i] + Bs[i];
}
printf("\nAs : ");
for(i = 0; i < 8; i++)
{
printf(" %d", As[i]);
}
printf("\nBs : ");
for(i = 0; i < 8; i++)
{
printf(" %d", Bs[i]);
}
printf("\n\nCs : ");
for(i = 0; i < 8; i++)
{
printf(" %d", Cs[i]);
}
for(i = 0; i < 8; i++)
{
a = a + codeA[i] * Cs[i];
b = b + codeB[i] * Cs[i];
}
if(a > 0) {
printf("\nA : 1");
} else {
printf("\nA : 0");
}
if(b > 0) {
printf("\nB : 1");
} else {
printf("\nB : 0");
}
getch();
}
5 Comments
turbo c++
ReplyDeleteturbo c++ download
download turbo c++
turbo c++ for windows 10
turbo c++ download for windows 10
turbo c++ for windows 7
turbo c++ free download
turbo c++ 4.5 for windows 10
turbo c++ download for pc
turbo c++ online
Thanks For Sharing Your Information , Plaese Keep Updating US, Time Went On Reading The Article.lovely lines.
ReplyDeleteC and C++ Training Institute in chennai | C and C++ Training Institute in anna nagar | C and C++ Training Institute in omr | C and C++ Training Institute in porur | C and C++ Training Institute in tambaram | C and C++ Training Institute in velachery
Thanks for providing wonderful information , keep posting. visit: Java Training In Pune
ReplyDeletebetmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
Ä°R1
thanks for the post. It was very helpful.
ReplyDeletealso, check Full-stack classes in Pune