I am writing a program to generate timecode. I don't understand in which case I need to set the parity bit. That for 25FPS it is 59 bits and for 24/30FPS it is 27 bits I understand.
Wikipedia says
"Polarity correction bit" (bit 59 at 25 frame/s, bit 27 at other rates): this bit is chosen to provide an even number of 0 bits in the whole frame, including the sync code. (Since the frame is an even number of bits long, this implies an even number of 1 bits, and is thus an even parity bit. Since the sync code includes an odd number of 1 bits, it is an odd parity bit over the data.) This keeps the phase of each frame consistent, so it always starts with a rising edge at the beginning of bit 0.
I need to count the number of zeros and ones in an 80 bit parcel and depending on the number set the bit? I've tried to figure it out, but I can't figure it out.