Ee2 chapter4 parity_checking
Transcript of Ee2 chapter4 parity_checking
Apr 13, 2023
Lecturer Name [email protected]
Contact Number
IT2001PAEngineering Essentials (2/2)
Chapter 4 - Parity Checking
2
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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.
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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
4
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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.
5
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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).
6
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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
7
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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)
8
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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
9
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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
10
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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.
11
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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?
Step 1: how many 1’s are there in the byte?
Answer : 6
Step 2: Since the number of bits are already even, the parity bit will be ‘0’.
Total number of ‘1’s is even.
Parity bit added to make even number of 1’s
12
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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
13
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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.
14
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Parity bit generator circuit
How we use the XOR and XNOR logic gates to generate the parity bit?
15
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Odd Parity bit generator circuit
16
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Odd Parity bit generator circuit
17
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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.
18
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Odd Parity bit error detector circuit
19
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Odd Parity bit error detector circuit
20
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Parity Generator and Checking CircuitA
B
C
D
A
B
C
D
Pe Error indicator
Parity-checking circuitParity-bit generator
Transmitting system Receiving system
21
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
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.
22
Chapter 4 - Parity Checking
IT2001PA Engineering Essentials (2/2)
Next Lesson