0% found this document useful (0 votes)
69 views15 pages

Error Detection

The document discusses error detection codes used in digital communication. It explains that parity bits are the most common method of error detection, where an extra bit is added to make the total number of 1's in a message either even or odd. The document provides examples of even and odd parity. It also discusses Hamming codes, which can detect up to two simultaneous bit errors or correct single bit errors using redundant bits. The encoding and decoding process for Hamming codes is explained through examples.

Uploaded by

Daniel Rizvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views15 pages

Error Detection

The document discusses error detection codes used in digital communication. It explains that parity bits are the most common method of error detection, where an extra bit is added to make the total number of 1's in a message either even or odd. The document provides examples of even and odd parity. It also discusses Hamming codes, which can detect up to two simultaneous bit errors or correct single bit errors using redundant bits. The encoding and decoding process for Hamming codes is explained through examples.

Uploaded by

Daniel Rizvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

COMPUTER ORGANISATION &

ARCHITECTURE

Presented by
Prof. Salwan Tajjour
1

DATA
REPRESENTATION
 Error Detection
 Parity
 Hamming code
Contents
2
ERROR DETECTING CODES
Binary information transmitted through some form of communication medium is
subject to external noise that could alters certain bits. (0 to 1 and vice versa).

An error detection code is a binary code that detects digital errors during
transmission (cannot correct).

If the errors occur at random, the message is transmitted again.

If the error is too often, the system is checked for mal function.

Most common error detection code is the parity bit.


parity bit

The most common error detection code used is the parity bit . A
parity bit is an extra bit included with a binary message to make
the total number of 1’s either odd or even. The P(odd) bit is
chosen in such a way as to make the sum of 1's (in all four bits)
odd . The P(even) bit is chosen to make the sum of all 1's even. In
either case, the sum is taken over the message and the P bit. In
any particular application, one or the other type of parity will be
adopted. The even-parity scheme has the disadvantage of having a
bit combination of all O’s, while in the odd parity there is always
one bit (of the four bits that constitute the message and P) that is
1. Note that the P(odd) is the complement of the P(even).
Even/Odd Parity
Even Parity Odd Parity
One bit is attached to the
information so that the total One bit is attached to the
number of 1 bits is an even information so that the total
number number of 1 bits is an odd
number
Message Parity
Message Parity
10110010
10110011
1010010 1
1010010 0

20
Parity generator
21
Hamming Code
• Hamming code is a block code that is
capable of detecting up to two
simultaneous bit errors and correcting
single-bit errors.
• Redundant bits are extra binary bits that
are generated and added to the
information-carrying bits of data transfer
to ensure that no bits were lost during
the data transfer.
• The number of redundant bits can be
calculated using the following formula:
2^p ≤ m + p + 1
where:
p = redundant bit
m = data bit
Encoding messages By Hamming
Code

1 2 3
Calculating the Positioning the Calculating the
number of redundant bits value of each
redundant bits redundant bit.
Example
Generate Hamming code for
the message 1010 using even
parity.

P1 take care of (1,3,5,7) 


1 2 3 4 5 6 7 x100  P1 = 1
P2 take care of (2,3,6,7) 
P1 P2 M1 P3 M2 M3 M4
x110  P2 = 0
x x 1 x 0 1 0 P3 take care of (4,5,6,7) 
x010  P3 = 1
1 0 1 1 0 1 0
Calculation of the number
of redundant bits.

Decoding a Positioning the redundant


bits.
message in
Hamming
Code Parity checking.

Error detection and


correction
Example A (7,4) hamming code is
received as 1010111.
Determine the correct code
when even parity is there.

P1 take care of (1,3,5,7) 


1111  E1 = 0
1 2 3 4 5 6 7 P2 take care of (2,3,6,7) 
0111  E2 = 1
P1 P2 M1 P3 M2 M3 M4
P3 take care of (4,5,6,7) 
x x 1 x 0 1 0 0111  E3 = 1
1 0 1 0 1 1 1
So that the error in the 6th bit
(110).
Review
23

You might also like