Ee2 chapter4 parity_checking

22
Jun 13, 2022 Lecturer Name [email protected] Contact Number IT2001PA Engineering Essentials (2/2) Chapter 4 - Parity Checking

Transcript of Ee2 chapter4 parity_checking

Page 1: Ee2 chapter4 parity_checking

Apr 13, 2023

Lecturer Name [email protected]

Contact Number

IT2001PAEngineering Essentials (2/2)

Chapter 4 - Parity Checking

Page 2: Ee2 chapter4 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.

Page 3: Ee2 chapter4 parity_checking

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

Page 4: Ee2 chapter4 parity_checking

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.

Page 5: Ee2 chapter4 parity_checking

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).

Page 6: Ee2 chapter4 parity_checking

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

Page 7: Ee2 chapter4 parity_checking

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)

Page 8: Ee2 chapter4 parity_checking

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

Page 9: Ee2 chapter4 parity_checking

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

Page 10: Ee2 chapter4 parity_checking

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.

Page 11: Ee2 chapter4 parity_checking

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

Page 12: Ee2 chapter4 parity_checking

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

Page 13: Ee2 chapter4 parity_checking

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.

Page 14: Ee2 chapter4 parity_checking

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?

Page 15: Ee2 chapter4 parity_checking

15

Chapter 4 - Parity Checking

IT2001PA Engineering Essentials (2/2)

Odd Parity bit generator circuit

Page 16: Ee2 chapter4 parity_checking

16

Chapter 4 - Parity Checking

IT2001PA Engineering Essentials (2/2)

Odd Parity bit generator circuit

Page 17: Ee2 chapter4 parity_checking

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.

Page 18: Ee2 chapter4 parity_checking

18

Chapter 4 - Parity Checking

IT2001PA Engineering Essentials (2/2)

Odd Parity bit error detector circuit

Page 19: Ee2 chapter4 parity_checking

19

Chapter 4 - Parity Checking

IT2001PA Engineering Essentials (2/2)

Odd Parity bit error detector circuit

Page 20: Ee2 chapter4 parity_checking

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

Page 21: Ee2 chapter4 parity_checking

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.

Page 22: Ee2 chapter4 parity_checking

22

Chapter 4 - Parity Checking

IT2001PA Engineering Essentials (2/2)

Next Lesson