This might be of interest to some (heh)
I am sure people (some again) may have heard of PAR archive's etc. What is a PAR file anyhow?
The simple version is PAR is short for PARITY. Parity refers to the count of 1's bits in a string of bits (byte word double word quad word are strings of bits).
So .. what's the deal?
Let's say we have Data sets A B C D E F G H and P (P for parity)
where A XOR B ...G XOR H = P
The exclusive or (XOR for short) is used to generate parity because by nature (see table) it will indicate there is an odd or even number of 1's bits in a given word.
Say A and B are 2 bits of a binary string, the XOR table shows that if they are both 0 there is an EVEN number of 1's if both are 1 then there is also an even number of 1's.
XOR gates can be cascaded to generate the same parity over a larger number of bits.
If you wish to play with an XOR gate to see for yourself try this URL. click on F and G and watch I21 output to see what happens.
Cascading them is simply wiring the output of 2 gates to another XOR gate in series.
Therefore A XOR B ... G XOR H is the same as ((A XOR B) XOR (C XOR D))XOR((E XOR F)XOR(G XOR H)). ( I suppose I could write the C ^ symbol for XOR operator however I'll restrain myself).
P = this value is the parity data generated by all that bitting around.
So lets say one of those bits gets corrupted? What do you do?
So lets say it's bit C (why not?), well first the parity of C would be reversed of it's original state. That means the parity is changed. This also means that you know that block of data is wrong. Hence this is called the PARITY CHECK.
Now how do we correct this? Ahhh that's the rub isn't it?
It turns out C = A XOR B XOR D XOR E XOR F XOR G XOR H XOR P, thus we know what C is by the parity bit.
This is by no means a very acurate method of error correction. Trust me it's not very good at all but gives you an idea of what is going on and what one can do with just a simple logic gate to fix errors.
Until the next illogical write up.
Cyb
I am sure people (some again) may have heard of PAR archive's etc. What is a PAR file anyhow?
The simple version is PAR is short for PARITY. Parity refers to the count of 1's bits in a string of bits (byte word double word quad word are strings of bits).
So .. what's the deal?
Let's say we have Data sets A B C D E F G H and P (P for parity)
where A XOR B ...G XOR H = P
The exclusive or (XOR for short) is used to generate parity because by nature (see table) it will indicate there is an odd or even number of 1's bits in a given word.
Code:
_A_B_|_R_
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0
XOR gates can be cascaded to generate the same parity over a larger number of bits.
If you wish to play with an XOR gate to see for yourself try this URL. click on F and G and watch I21 output to see what happens.
Cascading them is simply wiring the output of 2 gates to another XOR gate in series.
Therefore A XOR B ... G XOR H is the same as ((A XOR B) XOR (C XOR D))XOR((E XOR F)XOR(G XOR H)). ( I suppose I could write the C ^ symbol for XOR operator however I'll restrain myself).
P = this value is the parity data generated by all that bitting around.
So lets say one of those bits gets corrupted? What do you do?
So lets say it's bit C (why not?), well first the parity of C would be reversed of it's original state. That means the parity is changed. This also means that you know that block of data is wrong. Hence this is called the PARITY CHECK.
Now how do we correct this? Ahhh that's the rub isn't it?
It turns out C = A XOR B XOR D XOR E XOR F XOR G XOR H XOR P, thus we know what C is by the parity bit.
This is by no means a very acurate method of error correction. Trust me it's not very good at all but gives you an idea of what is going on and what one can do with just a simple logic gate to fix errors.
Until the next illogical write up.
Cyb