Manchester Encoding and Decoding

In manchester encoding and decoding, it takes a number of 8 bits as 1 number transmit it and receive it. This code is actualy a combining of two. one that does the manchester and one that reads port D and write port D

which means it takes the 8 bits from A0 to A7 and combineit and save it as one data. after the transmission it does the opisot. it takes that one date and change it to 8- bit output from A0 to A7.

I could have used
PORTD maps to Arduino digital pins 0 to 7

DDRD - The Port D Data Direction Register - read/write

PORTD - The Port D Data Register - read/write

PIND - The Port D Input Pins Register - read only

but unfortunately I did not get how to use it in the code

I have re-edited the post so you can see one of the codes.