# Parity Data Checking

Commonly used in many RAID types and certain parity based RAM technology. Comparing bits of data can retrieve lost data by

*simply*checking if the numerical result is ODD or EVEN. In computing the XOR bit comparison operator can be used for this. Check out the - hopefully intuitive - example below.

Parity bits in this example are calculated based on EVEN numbers. To make it simple to understand, I'm using a dedicated parity disk.

Disk1 Disk2 Parity-data/disk 1 0 1 (1+0 needs +1 to become even) 0 1 1 (0+1 needs +1 to become even) 1 1 0 (1+1+0 already even) 1 0 1 (...) 0 1 1 (...) Disk1 Disk2 Disk3 Disk4 Disk5 Disk6 Parity-data/disk 1 1 0 0 1 1 P0 (1+1+0+0+1+1 already even) 1 0 1 1 0 1 P0 (...) 1 1 1 0 0 1 P0 (...) 1 1 0 1 0 0 P1 (1+1+0+1+0+0 needs +1 to become even) 0 0 1 1 0 1 P1 (...) If you remove Disk3, the missing data can be calculated the same way if you still have the parity-data/disk. Disk1 Disk2 - Disk4 Disk5 Disk6 Parity-data/disk Missing data/disk 1 1 - 0 1 1 0 0 (1+1+0+1+1+P0) 1 0 - 1 0 1 0 1 (1+0+1+0+1+P0) 1 1 - 0 0 1 0 1 (1+1+0+0+1+P0) 1 1 - 1 0 0 1 0 (1+1+1+0+0+P1) 0 0 - 1 0 1 1 1 (0+0+1+0+1+P1)

**Requirements**

- Parity storage must be at least the size of the biggest unit of data in the storage array.
- Only a single unit of data can be lost without data loss with this kind of parity storage.

By being creative you can loose more units of storage without loosing data, but it will also require more space.