code: public static int parity_pitch(     /* output: parity bit (XOR of 6 MSB bits)     */
  	  int pitch_index     /* input : index for which parity is computed */
  	)
  	{
  	    int temp, sum, i, bit;
  
  	    temp = pitch_index >> 1;
  
  	    sum = 1;
  	    for (i = 0; i <= 5; i++) {
  	        temp >>= 1;
  	        bit = temp & 1;
  	        sum = sum + bit;
  	    }
  	    sum = sum & 1;
  	    return (sum);
  	}
docs: /*-----------------------------------------------------*
  parity_pitch - compute parity bit for first 6 MSBs  *
  -----------------------------------------------------