Why Is Total Parity of Bits Important in Computing?

  • Thread starter Thread starter Callaghan
  • Start date Start date
  • Tags Tags
    Bit Bits Parity
AI Thread Summary
The discussion centers on the concept of universal gates in classical computing, specifically focusing on the NAND gate's ability to compute any function using combinations of gates. It highlights that while NAND is universal, XOR is not, due to its inability to change the total parity of bits. Total parity refers to whether the count of 1s in a set of bits is odd or even, impacting the outputs generated by XOR operations. The conversation explains that XOR gates, even when combined with NOT gates, cannot produce certain logical functions like AND, OR, NAND, or NOR, as these functions can yield odd parity results, which XOR cannot achieve. The discussion also clarifies that in practical applications, constant inputs of 0 and 1 can be used to facilitate logical operations, reinforcing the idea that XOR alone is insufficient for universal computation.
Callaghan
Messages
13
Reaction score
0
Below is the extraction from quantum computer book, but I think my question is related to classical computing;

"Now let us generalize from one to multiple qubits. Figure 1.6 shows five notable multiple bit classical gates, the AND, OR, XOR (exclusive-OR ), NAND and NOR gates. An important theoretical result is that any function on bits can be computed from the composition of NAND gates alone, which is thus known as a universal gate. By contrast, the XOR alone or even together with NOT is not universal. One way of seeing this is to note that applying an XOR gate does not change the total parity of the bits. As a result, any circuit involving only NOT and XOR gates will, if two inputs x and y have the same parity, give outputs with the same parity, restricting the class of functions which may be computed, and thus precluding universality."

I searched over the dictionary and understood the meaning of universal gate, but I do not get the total parity of the bits.

What does that mean? and what does that underlined, bold sentence imply?

I searched, and I found parity bits, but it seems that it's little bit different from what I am looking for.
 
Technology news on Phys.org
If you have N bits and M of them are one, then the "total parity" will depend only on "M". If M is odd, the "total parity" will be 1. If M is even, then "total parity" will be 0. The word "total" is not usually included - but they are probably referring to the fact that an XOR is the same as a modulo 2 addition.

Stepping back, they are trying to show that there are some gates that cannot be created with only XORs. They are also letting you use NOT - but this is no gift. You can generate a NOT from an XOR by XORing with 1. Starting with A, B, and as many XORs as you wish, these are the symbols you can generate:
0, A, B, A XOR B, 1, NOT A, NOT B, or NOT(A XOR B)

XORing any of those with any of the others will not generate anything new.
What they are getting at can be seen in the table below. The columns are:
1) Result when A=0, B=0
2) Result when A=0, B=1
3) Result when A=1, B=0
4) Result when A=1, B=1
5) The XOR operation generating the result.
0000 0
0011 A
0101 B
0110 A XOR B
1111 1
1100 NOT A
1010 NOT B
1001 NOT(A XOR B)

Here's the key. Notice two things:
1) For each row, the number of 1's in the the table above is always even.
2) Whenever you XOR two even patterns, you will get an even result.

Therefore, something like an AND, OR, NAND, or NOR can never be generated from XOR gates only.
0001 AND (1 is odd)
0111 OR (3 is odd)
1110 NAND (3 is odd)
1000 NOR (1 is odd)
 
Last edited:
  • Like
Likes poseidon721 and jim mcnamara
So, I understand that the gate can be viewed as combination of 0 and 1 for 4 binary digits by using 0, A, B, 1.

But how do you make 1 by XOR??
 
Callaghan said:
So, I understand that the gate can be viewed as combination of 0 and 1 for 4 binary digits by using 0, A, B, 1.

But how do you make 1 by XOR??
In practice, you can always tie the input to a gate high or low. This is the same as providing a 1 or 0 as the input. So 1 and 0 are always available - unless you make a special rule to exclude them.
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top