Manchester Encoding and Decoding

   if (a7==1)
  {
    digitalWrite(D7,HIGH);
  }
  else
  { digitalWrite(D7,LOW);
  }

Aren't you just writing the value in a7 to D7? You don't need 8 lines of code to do that (8 times).