0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
58 Ansichten1 Seite
Even parity error checking void even_parity(int data ) int count=0,i,j; printf("ntt you are going to check with even parity."); / Loop to count the no's of 1 in sending data and add the parity bit.
Even parity error checking void even_parity(int data ) int count=0,i,j; printf("ntt you are going to check with even parity."); / Loop to count the no's of 1 in sending data and add the parity bit.
Copyright:
Attribution Non-Commercial (BY-NC)
Verfügbare Formate
Als TXT, PDF, TXT herunterladen oder online auf Scribd lesen
Even parity error checking void even_parity(int data ) int count=0,i,j; printf("ntt you are going to check with even parity."); / Loop to count the no's of 1 in sending data and add the parity bit.
Copyright:
Attribution Non-Commercial (BY-NC)
Verfügbare Formate
Als TXT, PDF, TXT herunterladen oder online auf Scribd lesen
/* Function defination for even parity error checking */
void even_parity(int data[8][6])
{ int count=0,i,j; printf("\n\t\t you are going to check with even parity."); /* Loop to count the no's of 1 in sending data & add the parity bit Horizontally */ for(i=0;i<7;i++) { for(j=0;j<5;j++) { if(data[i][j]==1) count++; } if(count%2==0) data[i][j]=0; else data[i][j]=1; count=0; } /* Vertically */ for(i=0;i<6;i++) { for(j=0;j<7;j++) { if(data[j][i]==1) count++; } if(count%2==0) data[j][i]=0; else data[j][i]=1; count=0; } printf("\n\t\t sender will send : \n\t\t"); /* Loop to print the sending data after adding parity bit */ for(i=0;i<8;i++) { for(j=0;j<6;j++) { printf(" %d",data[i][j]); } printf("\n\t\t"); } }