PROJECT 06 – PARITY CHECK

 


OVERVIEW

 

In mathematics, the parity of an number refers to whether it is even or odd.  Parity checks are used in computers to check if transferred data is corrupted or not.  It is also useful when adding numbers.

 

In this circuit, we will look at how to create a circuit that checks the parity of any numbers of inputs.

 

THEORY

 

As opposed to checking the parity of a specific number (which is very simple in binary), we will be checking if the number of ones in a number is odd or even.

 

a) Two inputs

 

For two inputs, here is the truth table where 0 is given for even amounts of ones and 1 is given for odd amounts.

 

A          B          Q

0          0          0

0          1          1

1          0          1

1          1          0

 

This truth table is the same as the XOR gate.  Therefore, A XOR B = Q

 

b) Three inputs

 

Lets consider the truth table for three inputs.

 

A          B          C          Q

            0          0          0          0

            0          0          1          1

            0          1          0          1

            0          1          1          0

            1          0          0          1

            1          0          1          0

            1          1          0          0

            1          1          1          1

 

While it might not be clear, this truth table is equal to A XOR B XOR C = Q.

 


c) Four inputs

 

            A          B          C          D          Q

            0          0          0          0          0

            0          0          0          1          1

            0          0          1          0          1

            0          0          1          1          0

            0          1          0          0          1

            0          1          0          1          0

            0          1          1          0          0

            0          1          1          1          1

            1          0          0          0          1

            1          0          0          1          0

            1          0          1          0          0

            1          0          1          1          1

            1          1          0          0          0

            1          1          0          1          1

            1          1          1          0          1

            1          1          1          1          0

 

Again, if you inspect this, you will see that A XOR B XOR C XOR D = Q.

 

PATTERN

 

The pattern continues indefinitely.  We can simply add more and more XOR gates for each input.

 

TASK

 

Use an XOR IC chip (TTL 7486) to check the parity of 3 inputs. 

 

Your teacher might give you bonus marks if you make this work for five inputs.