I don't know the mathematics to it.
Yet I do know that matching blocks on each drive is XOR'ed with one another and written to the parity drive.
Think in terms of RAID4 only with out stripping across multiple drives.
Instead of stripping a filesystem across multiple drives, a filesystem is contiguous on one spindle.
Multiple matching sectors across multiple drives are used to calculate a parity.
In the image,
DISK 0 is a filesystem,
but block A1, A2, A3 (on each filesystem) is used to create the parity for the respectively addressed block.
When the system sees that a disk has ended, ot assumes 0 in the XOR calculation and just uses what is left.
DISK3, Parity needs to be the largest disk. so that there is at least one parity block for every sector on other drives.
Hope my oversimplified explanation helps.
In updating parity, there is a bit of performance penalty for a sector.
The process is:
* Read the old data block
* Read the old parity block
* Compare the old data block with the write request. For each bit that has flipped (changed from 0 to 1, or from 1 to 0) in the data block, flip the corresponding bit in the parity block
* Write the new data block
* Write the new parity block