2. Chapter 4 - Parity Checking
Lesson Objectives
Upon completion of this topic, you should be able to:
Explain the purpose of parity bit and how EX-OR/NOR
can be used for this purpose.
IT2001PA Engineering Essentials (2/2) 2
3. Chapter 4 - Parity Checking
Specific Objectives
Students should be able to :
State the uses of a parity bit.
Define what is even parity.
Define what is odd parity.
Give examples of applications where the exclusive
OR/NOR are widely used :
Parity generator and
Parity checker
IT2001PA Engineering Essentials (2/2)
4. Chapter 4 - Parity Checking
Introduction
When you receive a parcel from a friend, how would
you know that the contents are what your friend has
send to you?
One way is to call your friend up and confirm with him
what he has sent to you.
Another way is for your friend to include a packing list
detailing what is in the parcel, and you can tally the
items in the parcel with the packing list.
IT2001PA Engineering Essentials (2/2) 4
5. Chapter 4 - Parity Checking
Introduction
In the same way when your computer/ printer receives a
message, how would your computer/printer know that the
received message is correct?
One way is for the computer to double check with the sending
computer what he has received, just like you calling up your
friend to check the contents of the parcel.
Another way is for the sending computer to include some
information in the message, so that by examining the information
you are able to know whether the received message is correct.
(Like the packing list).
IT2001PA Engineering Essentials (2/2) 5
6. Chapter 4 - Parity Checking
Parity bit generation and error detection
In this topic, we will study how the sending computer
includes additional information for the receiver
(computer/printer/modem) to check if the message
received is correct.
The method we study is called
parity bit generation and error detection
IT2001PA Engineering Essentials (2/2) 6
7. Chapter 4 - Parity Checking
Parity bit generation and error detection
In this method, for every byte transmitted, one
additional bit is added to the byte for error checking.
Therefore, the total number of bits transmitted would
be 9 bits.
( 8 bits of information + 1 bit parity)
IT2001PA Engineering Essentials (2/2) 7
8. Chapter 4 - Parity Checking
Parity Systems
There are two ways to generate a parity bit.
One is called even parity and the other is odd parity.
What is even parity?
the total number of 1’s transmitted must be even.
What is odd parity?
the total number of 1’s transmitted must be odd
IT2001PA Engineering Essentials (2/2) 8
9. Chapter 4 - Parity Checking
Generating Even Parity Bit
How is the even parity bit generated?
Example: If the byte that we want to transmit is
1 0 1 0 1 1 0 1
What is the value of the even parity bit?
Step 1: count the number of 1’s in the byte.
Answer: 5
IT2001PA Engineering Essentials (2/2) 9
10. Chapter 4 - Parity Checking
Generating Even Parity Bit
Step 2: the parity bit is the 9th bit.
Since the total number of 1’s is 5, the even parity bit will
have a value of 1.
This will make a total of 6 1’s in the nine bits send across
to the receiver. This is even parity.
IT2001PA Engineering Essentials (2/2) 10
11. Chapter 4 - Parity Checking
Generating Even Parity Bit
Review Question
Original Byte to be send = 1 0 1 1 1 1 0 1 0
What should the parity bit be?
Parity bit
Step 1: how many 1’s are there in the byte? added to
make even
Answer : 6 number of 1’s
Step 2: Since the number of bits are already even, the parity
bit will be ‘0’.
Total number of ‘1’s is even.
IT2001PA Engineering Essentials (2/2) 11
12. Chapter 4 - Parity Checking
Generating Odd Parity
How is the old parity bit generated?
Example: If the byte that we want to transmit is
1 0 1 0 1 1 0 0
What is the value of the old parity bit?
Step 1: count the number of 1’s in the byte.
Answer: 4
IT2001PA Engineering Essentials (2/2) 12
13. Chapter 4 - Parity Checking
Generating Odd Parity Bit
Step 2: the parity bit is the 9th bit.
Since the total number of 1’s is 4, the odd parity bit will
have a value of 1.
This will make a total of 5 1’s in the nine bits send across
to the receiver. This is odd parity.
IT2001PA Engineering Essentials (2/2) 13
14. Chapter 4 - Parity Checking
Parity bit generator circuit
How we use the XOR and XNOR logic gates to
generate the parity bit?
IT2001PA Engineering Essentials (2/2) 14
17. Chapter 4 - Parity Checking
What happens at the printer?
When the printer receives the word, it will have to
check if the word is correctly received.
We will now study a circuit that is used to check the
correctness of the word received.
IT2001PA Engineering Essentials (2/2) 17
20. Chapter 4 - Parity Checking
Parity Generator and Checking Circuit
A A
B B
C C
D D
Pe Error
indicator
Parity-bit generator Parity-checking circuit
Transmitting system Receiving system
IT2001PA Engineering Essentials (2/2) 20
21. Chapter 4 - Parity Checking
Summary
Parity checking is a means of checking if the
communication of a sequence of bits has been
correctly received. The two types of most commonly
used parity checking are:
odd parity
even parity
Parity bit is an extra bit that is attached to the data bits
that is being transferred from one location to another.
Parity bit checking can detect single error only, double
errors will not be detected.
IT2001PA Engineering Essentials (2/2) 21