|Are you using any particular language?|
From your description, I guess you have a 7-bit value stored
inside an 8-bit byte, with only the lowest 7 bits holding the
value and the 8th bit is ignored.
You then want to calculate the parity bit and insert it in bit 4.
So you need to leave the lowest 3 bits as they are, then the
next four bits need to be shifted left 1 bit so that you can set
the 4th bit as the parity bit.
If you are using C, you should use an unsigned char. You can
either do it using the operators <<, & and |, or you can cheat
by putting the unsigned char inside a union with a bitfield.